Skip to content

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

Closed

Description

@srittau

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?

Activity

  1. erictraut commented on Jun 9, 2021

    @erictraut
    Contributor

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

  2. jakebailey commented on Jun 9, 2021

    @jakebailey
    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).

  3. srittau commented on Jun 9, 2021

    @srittau
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions