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: better checking of runtime args with dunder names #18756

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Mar 5, 2025

Fixes #15302, fixes #14560. Linking #18343

hauntsaninja and others added 2 commits March 5, 2025 13:05
for more information, see https://pre-commit.ci
@jorenham
Copy link
Contributor

jorenham commented Mar 5, 2025

I just ran it on the numpy stubs in numpy/numtype, and when I remove the allowlist entry that I mentioned in #15302 (comment), it passes 🎉.

I'm not sure if it's relevant here, but if I don't remove that allowlist entry, stubtest doesn't report it as unused.


edit:

I published the code to https://github.com/numpy/numtype/tree/mypy-18756. To repro, run uv run tool/stubtest.py, and uncomment line 37 in the .mypyignore allowlist (https://github.com/numpy/numtype/blob/0c64f1e0cc3d17312a60a1c3f883367f9f9d39cb/.mypyignore#L37)

jorenham added a commit to numpy/numtype that referenced this pull request Mar 5, 2025

Verified

This commit was signed with the committer’s verified signature.
jorenham Joren Hammudoglu
@hauntsaninja hauntsaninja merged commit a067d84 into python:master Mar 7, 2025
12 checks passed
@hauntsaninja hauntsaninja deleted the stubrelax branch March 7, 2025 00:16
@hauntsaninja
Copy link
Collaborator Author

Thanks for checking, will look into the unused allowlist thing too...

hauntsaninja added a commit to hauntsaninja/numtype that referenced this pull request Mar 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
cc @jorenham 

I was looking into python/mypy#18756 (comment)

It looks like the pre-release version of mypy crashes (for some reason related to property changes, will investigate). Crash logs are emitted to stderr and process exits with exit code 2.

This code does correctly chain the exit code, but swallows stderr.
jorenham pushed a commit to numpy/numtype that referenced this pull request Mar 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
cc @jorenham 

I was looking into python/mypy#18756 (comment)

It looks like the pre-release version of mypy crashes (for some reason related to property changes, will investigate). Crash logs are emitted to stderr and process exits with exit code 2.

This code does correctly chain the exit code, but swallows stderr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants