Skip to content

mypy_test: Are exclude and filter useful? #8139

Closed

Description

@AlexWaygood

mypy_test.py has two command-line arguments that I find somewhat useless: filter and exclude. (It looks like they've stayed more-or-less the same since the script's inception 7 years ago.) I'd like to get rid of them and replace them with flags that would allow me to run specific parts of mypy_test locally, instead of running the whole thing at once (e.g. --stdlib to only test the stdlib, or --test-cases to only test the test cases).

Any objections to that?

Activity

  1. AlexWaygood commented on Jun 22, 2022

    @AlexWaygood
    MemberAuthor

    Alternatively, we could have a single command-line argument, --dir. Running only on the stdlib would be --dir stdlib, etc.

  2. AlexWaygood commented on Jun 23, 2022

    @AlexWaygood
    MemberAuthor

    I'm actually somewhat inclined to remove the --verbose and --dry-run options as well. I've never found them useful (but I'm happy to keep them if somebody else has).

  3. srittau commented on Jun 27, 2022

    @srittau
    Collaborator

    I'm fine with changing exclude and filter. The approach I find most intuitive was to just run mypy_test stdlib/foo.pyi or mypy_test stubs/bar to test a specific file or directory.

    --verbose seems useful in case you need the full mypy command line for some reason. --dry-run on the other hand seems mostly useful when developing mypy_test, so I don't think it's very useful in general.

    Unrelated: I would prefer not to test our own scripts in mypy_test. Instead we should have a separate step in CI and just manually call mypy. In my view, testing stubs and testing our support script are two unrelated activities.

  4. AlexWaygood commented on Jun 27, 2022

    @AlexWaygood
    MemberAuthor

    Unrelated: I would prefer not to test our own scripts in mypy_test. Instead we should have a separate step in CI and just manually call mypy. In my view, testing stubs and testing our support script are two unrelated activities.

    This makes sense, and @hauntsaninja said something similar to me at PyCon. I'm fine with making this change.

  5. AlexWaygood commented on Jun 27, 2022

    @AlexWaygood
    MemberAuthor

    I'm fine with changing exclude and filter. The approach I find most intuitive was to just run mypy_test stdlib/foo.pyi or mypy_test stubs/bar to test a specific file or directory.

    I generally just invoke mypy directly if I want to test just a specific file or subdirectory. I don't think it makes sense to try to reproduce all of the mypy command-line options in mypy_test, so I'd prefer to keep things simple and just remove these options, personally.

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