Skip to content
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
6 changes: 3 additions & 3 deletions misc/analyze_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def extract(chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:
if isinstance(chunk, dict):
yield chunk
yield from extract(chunk.values())
elif isinstance(chunk, list):
elif isinstance(chunk, list): # type: ignore[unreachable] #TODO: is this actually unreachable, or are our types wrong?
yield from extract(chunk)

yield from extract([chunk.data for chunk in chunks])
Expand Down Expand Up @@ -93,7 +93,7 @@ def compress(chunk: JsonDict) -> JsonDict:
def helper(chunk: JsonDict) -> JsonDict:
nonlocal counter
if not isinstance(chunk, dict):
return chunk
return chunk # type: ignore[unreachable] #TODO: is this actually unreachable, or are our types wrong?

if len(chunk) <= 2:
return chunk
Expand Down Expand Up @@ -124,7 +124,7 @@ def decompress(chunk: JsonDict) -> JsonDict:

def helper(chunk: JsonDict) -> JsonDict:
if not isinstance(chunk, dict):
return chunk
return chunk # type: ignore[unreachable] #TODO: is this actually unreachable, or are our types wrong?
if ".id" in chunk:
return cache[chunk[".id"]]

Expand Down
32 changes: 16 additions & 16 deletions misc/profile_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@ def check_requirements() -> None:
if sys.platform != "linux":
# TODO: How to make this work on other platforms?
sys.exit("error: Only Linux is supported")

try:
subprocess.run(["perf", "-h"], capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
print("error: The 'perf' profiler is not installed")
sys.exit(1)

try:
subprocess.run(["clang", "--version"], capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
print("error: The clang compiler is not installed")
sys.exit(1)

if not os.path.isfile("mypy_self_check.ini"):
print("error: Run this in the mypy repository root")
sys.exit(1)
else: # fun fact/todo: we have to use else here, because of https://github.com/python/mypy/issues/10773
try:
subprocess.run(["perf", "-h"], capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
print("error: The 'perf' profiler is not installed")
sys.exit(1)

try:
subprocess.run(["clang", "--version"], capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
print("error: The clang compiler is not installed")
sys.exit(1)

if not os.path.isfile("mypy_self_check.ini"):
print("error: Run this in the mypy repository root")
sys.exit(1)


def main() -> None:
Expand Down
3 changes: 0 additions & 3 deletions mypy_self_check.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ exclude = mypy/typeshed/|mypyc/test-data/|mypyc/lib-rt/
enable_error_code = ignore-without-code,redundant-expr
enable_incomplete_feature = PreciseTupleTypes
show_error_code_links = True

[mypy-mypy.*]
# TODO: enable for `mypyc` and other files as well
warn_unreachable = True
Loading