Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

disable py-cache prior to mypy on cli #408

Merged
merged 4 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ jobs:
flake8 .
black onefuzz examples tests --check
isort --profile black ./onefuzz ./examples/ ./tests/ --check
mypy . --ignore-missing-imports
pytest -v tests
../ci/disable-py-cache.sh
mypy . --ignore-missing-imports

# set a minimum confidence to ignore known false positives
vulture --min-confidence 61 onefuzz
Expand Down
2 changes: 1 addition & 1 deletion src/ci/disable-py-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ set -ex
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/^@cached/##### @cached/" $(find . -name '*.py' -not -path .python_packages)
sed -i "s/@cached/##### @cached/" $(find . -name '*.py' -not -path .python_packages)
2 changes: 1 addition & 1 deletion src/ci/enable-py-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ set -ex
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/^##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages)
sed -i "s/##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages)
4 changes: 2 additions & 2 deletions src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import uuid
from enum import Enum
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

import pkg_resources
Expand Down Expand Up @@ -178,7 +178,7 @@ def get(self, container: str, filename: str) -> bytes:
""" get a file from a container """
self.logger.debug("getting file from container: %s:%s", container, filename)
client = self._get_client(container)
downloaded = cast(bytes, client.download_blob(filename))
downloaded = client.download_blob(filename)
return downloaded

def upload_file(
Expand Down