Skip to content

Commit 9a4f900

Browse files
committed
🐴 remove stubtest workaround for mypy<1.16
1 parent 44058f6 commit 9a4f900

File tree

2 files changed

+56
-68
lines changed

2 files changed

+56
-68
lines changed

tool/stubtest.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# requires-python = ">=3.11"
33
# dependencies = [
44
# "numtype[numpy]",
5-
# "mypy[faster-cache]>=1.15.0", # keep in sync with pyproject.toml
5+
# "mypy[faster-cache]>=1.16.0", # keep in sync with pyproject.toml
66
#
77
# "PyInstaller",
88
# "hypothesis",
@@ -69,26 +69,6 @@ def __check_simd() -> None:
6969
__check_simd()
7070

7171

72-
def __commit_pyi_genocide_for_mypy() -> None:
73-
"""
74-
Remove all ``__init__.pyi`` files from the installed numpy package.
75-
76-
This works around https://github.com/python/mypy/issues/18997 on `mypy<1.16.0`.
77-
78-
Raises
79-
------
80-
NotADirectoryError
81-
If `numpy` does not exist in the site-packages.
82-
"""
83-
package = SITE_DIR / "numpy"
84-
if not package.is_dir():
85-
raise NotADirectoryError(f"{package} does not exist")
86-
87-
graveyard_size = sum(not pyi.unlink() for pyi in package.rglob("__init__.pyi")) # type: ignore[func-returns-value]
88-
if VERBOSE and graveyard_size:
89-
print(f"deleted {graveyard_size} __init__.pyi from {package}\n")
90-
91-
9272
def _allowlists() -> list[str]:
9373
relpath = (TOOL_DIR / "allowlists").relative_to(CWD)
9474
return [str(relpath / fname) for fname in ALLOWLISTS]
@@ -147,8 +127,6 @@ def main() -> int:
147127
-------
148128
exit_code : int
149129
"""
150-
__commit_pyi_genocide_for_mypy()
151-
152130
if VERBOSE:
153131
import numpy as np # noqa: PLC0415
154132
import numtype as nt # noqa: PLC0415

0 commit comments

Comments
 (0)