Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stubtest ignores strict_bytes = true in pyproject.toml 1.15.0 #18744

Open
jorenham opened this issue Feb 27, 2025 · 0 comments
Open

stubtest ignores strict_bytes = true in pyproject.toml 1.15.0 #18744

jorenham opened this issue Feb 27, 2025 · 0 comments
Labels
bug mypy got something wrong topic-stubtest

Comments

@jorenham
Copy link

This causes mypy build errors to be reported when I run stubtest --mypy-config-file=pyproject.toml numpy (in numpy/numtype), where the pyproject.toml contains:

[tool.mypy]
# [...]
strict_bytes = true

The build error is of the overload-cannot-match kind, and is caused by a memoryview promotion in https://github.com/numpy/numtype/blob/2a9953a1be3c14660f29aabbaffc3e7fb6c2135a/src/numpy-stubs/__init__.pyi#L1143.


The workaround is to use the superseded (and undocumented) flags instead:

[tool.mypy]
# [...]
disable_bytearray_promotion = true
disable_memoryview_promotion = true

Running the command again with this pyproject.toml shows no build errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-stubtest
Projects
None yet
Development

No branches or pull requests

2 participants