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

Commit 36b3e2a

Browse files
authored
disable py-cache prior to mypy on cli (#408)
1 parent e222b01 commit 36b3e2a

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ jobs:
104104
flake8 .
105105
black onefuzz examples tests --check
106106
isort --profile black ./onefuzz ./examples/ ./tests/ --check
107-
mypy . --ignore-missing-imports
108107
pytest -v tests
108+
../ci/disable-py-cache.sh
109+
mypy . --ignore-missing-imports
109110
110111
# set a minimum confidence to ignore known false positives
111112
vulture --min-confidence 61 onefuzz

src/ci/disable-py-cache.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ set -ex
1515
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
1616

1717
sed -i "s/^from memoization import cached/##### from memoization import cached/" $(find . -name '*.py' -not -path .python_packages)
18-
sed -i "s/^@cached/##### @cached/" $(find . -name '*.py' -not -path .python_packages)
18+
sed -i "s/@cached/##### @cached/" $(find . -name '*.py' -not -path .python_packages)

src/ci/enable-py-cache.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ set -ex
1414
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
1515

1616
sed -i "s/^##### from memoization import cached/from memoization import cached/" $(find . -name '*.py' -not -path .python_packages)
17-
sed -i "s/^##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages)
17+
sed -i "s/##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages)

src/cli/onefuzz/api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import uuid
1212
from enum import Enum
1313
from shutil import which
14-
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar, cast
14+
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar
1515
from uuid import UUID
1616

1717
import pkg_resources
@@ -178,7 +178,7 @@ def get(self, container: str, filename: str) -> bytes:
178178
""" get a file from a container """
179179
self.logger.debug("getting file from container: %s:%s", container, filename)
180180
client = self._get_client(container)
181-
downloaded = cast(bytes, client.download_blob(filename))
181+
downloaded = client.download_blob(filename)
182182
return downloaded
183183

184184
def upload_file(

0 commit comments

Comments
 (0)