Skip to content

Run pyright with stricter options for "known-good" stubs #5607

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

Closed
srittau opened this issue Jun 9, 2021 · 3 comments · Fixed by #5612
Closed

Run pyright with stricter options for "known-good" stubs #5607

srittau opened this issue Jun 9, 2021 · 3 comments · Fixed by #5612
Labels
project: infrastructure typeshed build, test, documentation, or distribution related

Comments

@srittau
Copy link
Collaborator

srittau commented Jun 9, 2021

See #5597 for background. To quote @erictraut:

Here's an idea. Pyright allows you to specify a config file by path. By default it looks for a config file called "pyrightconfig.json" in the root directory, but you can specify a different config file. We could define two separate config files and run two separate passes. The first pass would use stricter settings and would exclude libraries that are not complete, the second pass would use laxer settings and would include all libraries. Thoughts?

@srittau srittau added the project: infrastructure typeshed build, test, documentation, or distribution related label Jun 9, 2021
@erictraut
Copy link
Contributor

Would you like help with this? @jakebailey wrote the pyright test scripts for typeshed, so he could probably do this most efficiently.

@jakebailey
Copy link
Contributor

Likely we can have two configs where the stricter one includes the stdlib and some specific libs in the stubs dir, ignoring the rest, then have the more generic one run on everything (I don't think it will be any faster to restrict things on the non-strict end). Then, a flag to run the stricter config can be documented for local use (for those using that wrapper script).

To run, we'd either need to double up the GHA jobs (faster) or run them back to back (fewer jobs).

@srittau
Copy link
Collaborator Author

srittau commented Jun 9, 2021

Running them back to back has the advantage that we can easily skip the run of the second invocation when the first one fails, removing duplicate errors. Time-wise, pyright is one of the fastest checks, so it shouldn't make much of a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: infrastructure typeshed build, test, documentation, or distribution related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants