diff --git a/docs/dev/index.md b/docs/dev/index.md index afcdd123..7af13af5 100644 --- a/docs/dev/index.md +++ b/docs/dev/index.md @@ -60,10 +60,7 @@ See for IDE integration and other info. ### mypy -Mypy is used for type-checking the codebase and the type-tests. It takes more effort to run it on the codebase than `basedpyright`. -This is primarily a consequence of mypy's inconsequent prioritization of the stubs bundled -with NumPy over the `numpy-stubs` within a local development environment. -To get around this, you can delete all `*.pyi` from your **local** `numpy` installation directory by running `uv tool/unstub.py`. +Mypy is used for type-checking the codebase and the type-tests. **General Type Checking** diff --git a/tool/README.md b/tool/README.md index 591139ef..6b8de3f2 100644 --- a/tool/README.md +++ b/tool/README.md @@ -32,14 +32,6 @@ Test type stubs against actual implementations using MyPy's stubtest. uv run tool/stubtest.py ``` -## unstub.py - -Remove all `.pyi` files from the NumPy site-packages directory. - -```shell -uv run tool/unstub.py -``` - ## format_ignores.py Format pyright ignore comments to ensure they are alphabetically sorted with proper spacing. diff --git a/tool/unstub.py b/tool/unstub.py deleted file mode 100644 index 0c14e6e1..00000000 --- a/tool/unstub.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Delete all `__init__.pyi` files in the `numpy` site-packages directory. - -This is a workaround for https://github.com/python/mypy/issues/18997 on `mypy<1.16.0` - -Run with `uv run tool/unstub.py`. -""" - -import sysconfig -from pathlib import Path - -package = Path(sysconfig.get_paths()["purelib"]) / "numpy" -assert package.is_dir(), package - -bodycount = sum(not pyi.unlink() for pyi in package.rglob("__init__.pyi")) # type: ignore[func-returns-value] -print(f"{bodycount} files deleted from {package.relative_to(Path.cwd())}")