disable py-cache prior to mypy on cli (#408)

This commit is contained in:
bmc-msft
2021-01-04 11:49:28 -05:00
committed by GitHub
parent e222b01003
commit 36b3e2a5aa
4 changed files with 6 additions and 5 deletions

View File

@ -104,8 +104,9 @@ jobs:
flake8 . flake8 .
black onefuzz examples tests --check black onefuzz examples tests --check
isort --profile black ./onefuzz ./examples/ ./tests/ --check isort --profile black ./onefuzz ./examples/ ./tests/ --check
mypy . --ignore-missing-imports
pytest -v tests pytest -v tests
../ci/disable-py-cache.sh
mypy . --ignore-missing-imports
# set a minimum confidence to ignore known false positives # set a minimum confidence to ignore known false positives
vulture --min-confidence 61 onefuzz vulture --min-confidence 61 onefuzz

View File

@ -15,4 +15,4 @@ set -ex
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
sed -i "s/^from memoization import cached/##### from memoization import cached/" $(find . -name '*.py' -not -path .python_packages) sed -i "s/^from memoization import cached/##### from memoization import cached/" $(find . -name '*.py' -not -path .python_packages)
sed -i "s/^@cached/##### @cached/" $(find . -name '*.py' -not -path .python_packages) sed -i "s/@cached/##### @cached/" $(find . -name '*.py' -not -path .python_packages)

View File

@ -14,4 +14,4 @@ set -ex
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
sed -i "s/^##### from memoization import cached/from memoization import cached/" $(find . -name '*.py' -not -path .python_packages) sed -i "s/^##### from memoization import cached/from memoization import cached/" $(find . -name '*.py' -not -path .python_packages)
sed -i "s/^##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages) sed -i "s/##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages)

View File

@ -11,7 +11,7 @@ import subprocess # nosec
import uuid import uuid
from enum import Enum from enum import Enum
from shutil import which from shutil import which
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar, cast from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar
from uuid import UUID from uuid import UUID
import pkg_resources import pkg_resources
@ -178,7 +178,7 @@ class Files(Endpoint):
""" get a file from a container """ """ get a file from a container """
self.logger.debug("getting file from container: %s:%s", container, filename) self.logger.debug("getting file from container: %s:%s", container, filename)
client = self._get_client(container) client = self._get_client(container)
downloaded = cast(bytes, client.download_blob(filename)) downloaded = client.download_blob(filename)
return downloaded return downloaded
def upload_file( def upload_file(