Repository navigation
mypy_test.py: rework filter, exclude and --dir arguments - #8711
Merged
Merged
Conversation
AlexWaygood
marked this pull request as draft
September 8, 2022 20:01
AlexWaygood
force-pushed
the
exclude-and-filter
branch
from
September 8, 2022 20:06
3b1b5f8 to
257af5c
Compare
AlexWaygood
marked this pull request as ready for review
September 8, 2022 20:06
JelleZijlstra
approved these changes
Sep 21, 2022
| from utils import VERSIONS_RE as VERSION_LINE_RE, colored, print_error, print_success_msg, read_dependencies, strip_comments | ||
|
|
||
| SUPPORTED_VERSIONS = [(3, 11), (3, 10), (3, 9), (3, 8), (3, 7)] | ||
| SUPPORTED_VERSIONS = ["3.11", "3.10", "3.9", "3.8", "3.7"] |
Member
There was a problem hiding this comment.
Any reason not to centralize this in utils.py? It would be nice to minimize the number of places we have to change when 3.12 comes around or when we drop 3.7.
Member
Author
There was a problem hiding this comment.
Yup, definitely. I'd like to do something like that in a follow-up PR, though — I have a few more ideas about things I'd like to do in that vein :)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
(1) I accidentally disabled the
filterandexcludecommand-line arguments in #8680 (oops). Get those working again.(2) Rework
filterandexcludeso they use paths instead of regexes.Currently the behaviour is such that if you do
python tests/mypy_test.py typing, you'll pick upstdlib/typing.pyiandstdlib/typing_extensions.pyi(likely the files you wanted to test), but you'll also pick up random files from third-party stubs, likeredis/typing.pyi. It doesn't make much sense to me. With this PR, you'll be able to do (for example):python tests/mypy_test.py stdlib/typing.pyito test just the stdlibtypingmodulepython tests/mypy_test.py stdlib/asyncio stdlib/distutilsto test thestdlib/asyncioandstdlib/distutilsdirectories.python tests/mypy_test.py stubs/protobufto test just the protobuf stubspython tests/mypy_test.py stubs --exclude stubs/SQLAlchemyto test all third-party stubs, excluding SQLALchemypython tests/mypy_test.py stdlibto test all stdlib stubs(3) Get rid of the
--dirargument. With these changes, it's no longer needed.Closes #8139