-
Notifications
You must be signed in to change notification settings - Fork 102
Replace validate_stubs
scripts with stubtest
#371
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
Avasam
wants to merge
12
commits into
microsoft:main
Choose a base branch
from
Avasam:Replace-validate_stubs-scripts-with-stubtest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Replace validate_stubs
scripts with stubtest
#371
Avasam
wants to merge
12
commits into
microsoft:main
from
Avasam:Replace-validate_stubs-scripts-with-stubtest
+11,193
−741
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c700e37
to
dbf819b
Compare
debonte
approved these changes
May 23, 2025
…into Replace-validate_stubs-scripts-with-stubtest
…into Replace-validate_stubs-scripts-with-stubtest
@debonte If you prefer, I can split off the changes to test across different Python versions |
I think I'm through all the issues anyway ^^ |
…into Replace-validate_stubs-scripts-with-stubtest
This was referenced May 24, 2025
As this PR grows, I ended up splitting it off after all: #375 |
…into Replace-validate_stubs-scripts-with-stubtest
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
validate_stubs.py
doesn't really work in its current state. I'm sure there's plenty more issues, but mainly it tries to import stub files and stubs-only symbols.Stubtest is as actively maintained as mypy and is a core tool to typeshed's own testing to validate that stubs match the content of implementation.
https://mypy.readthedocs.io/en/stable/stubtest.html
Updated.github/workflows/test.yml
to test both oldest and newest python version. This will help uncover issues likenumpy.distutils
not being available on Python 3.12+utils/validate_stubs.py
in favor oftests/run_stubtest.py
Whilst all other tools help you ensure your stubs are valid, sane, or simply follow modern standards. This is actually the best metric you'll have to see how close the stubs are to actual implementation (or rather, how much they've diverged over time)