-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Improvements around stubtest #3728
Comments
It seems that stubtest chokes on 'private' names, like |
Thanks for reporting! Just added python/mypy@f1a1b66 to an already open pull request (python/mypy#8502) that should fix this |
Is there a good way to whitelist a module on only certain OSes? Stubtest complains for a bunch of modules that don't exist on windows, while I would like to start it running on things like winreg and msvcrt when it's run on windows |
If you run For whitelisting additional errors on Windows, maybe try modifying If you start running into issues with unused whitelist entries, there are two tools at your disposal:
Are you working your way towards running stubtest on Windows in CI, or are you just looking to make improvements based on local runs? |
Currently I'm just looking at local improvements. While I wouldn't be against working towards windows CI, I can't dedicate to that cause right now. Maybe once I've finished my current main project, stdlib module/package existence. |
@hauntsaninja Currently stubtest fails if a whitelist entry has become obsolete due to a PR. I think this is a bit problematic, since its easily missed when providing an easy fix, and makes it a bit harder to contribute them. Do you think something like the following would make sense?
|
Yeah, that makes sense! stubtest already supports |
I will see whether I can try something out over the weekend. |
This is currently a GitHub workflow that runs daily and lists all unused whitelist entries found by running stubtest against current Python versions on Linux and Windows. The workflow run will succeed if there are no such entries, and fail otherwise. In a second step, this should collate the output of the various runs and create a PR to remove the entries. In that case, the workflow should probably only run weekly or even monthly to keep the noise down. Cf. python#3728
* Find unused stubtest whitelist entries This is currently a GitHub workflow that runs daily and lists all unused whitelist entries found by running stubtest against current Python versions on Linux and Windows. The workflow run will succeed if there are no such entries, and fail otherwise. In a second step, this should collate the output of the various runs and create a PR to remove the entries. In that case, the workflow should probably only run weekly or even monthly to keep the noise down. Cf. #3728
* Find unused stubtest whitelist entries This is currently a GitHub workflow that runs daily and lists all unused whitelist entries found by running stubtest against current Python versions on Linux and Windows. The workflow run will succeed if there are no such entries, and fail otherwise. In a second step, this should collate the output of the various runs and create a PR to remove the entries. In that case, the workflow should probably only run weekly or even monthly to keep the noise down. Cf. python#3728
Closing this. I think the only action item here is to run stubtest on third party libraries, which I'd be more inclined to take on once we have modular typeshed. |
Creating this issue to discuss and document areas of improvement from using stubtest. Note when I use "in CI" below, I mean as in current draft pull request #3727
inspect.signature
sometimes throws, in which casestubtest
doesn't analyse further. However, the functions it fails for differ from python version to python version. If you're not sure whether you need to branch on version, run stubtest without the branch (the documentation is also helpful).cmath.log
). For avoidable stubtest false positives, please tag me!--ignore-missing-stub
. Running stubtest without this flag is an easy way to find missing stubs to add.--ignore-missing-stub
).Changes:
Additions:
The text was updated successfully, but these errors were encountered: