Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
Further improve non-types dependency handling in pytype_test.py#10393
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -13,7 +13,7 @@ | ||
| ReturnCode: TypeAlias = int | ||
| SUPPORTED_PLATFORMS = ("linux", "darwin", "win32") | ||
| SUPPORTED_VERSIONS = ("3.12", "3.11", "3.10") | ||
| SUPPORTED_VERSIONS = ("3.12", "3.11", "3.10", "3.9") | ||
| LOWEST_SUPPORTED_VERSION = min(SUPPORTED_VERSIONS, key=lambda x: int(x.split(".")[1])) | ||
| DIRECTORIES_TO_TEST = ("scripts", "tests") | ||
| EMPTY: list[str] = [] | ||
| @@ -63,6 +63,8 @@ def run_mypy_as_subprocess(directory: str, platform: str, version: str) -> Retur | ||
| "possibly-undefined", | ||
| "--enable-error-code", | ||
| "redundant-expr", | ||
| "--custom-typeshed-dir", | ||
| ".", | ||
Comment on lines
+66
to
+67
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now necessary to get our test suite to typecheck, since we're now passing an | ||
| ] | ||
| if directory == "tests" and platform == "win32": | ||
| command.extend(["--exclude", "tests/pytype_test.py"]) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I drew on the implementation of
packages_distributions()heavily when writing this function: https://github.com/python/cpython/blob/904aef994262383ae916545908f0578c2d53cf31/Lib/importlib/metadata/__init__.py#L933-L964