mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Filter pytype tests by stdlib/VERSIONS file (#12649)
Filter the files to run pytype tests on by stdlib/VERSIONS file. This becomes important for Python 3.12, where e.g. checking asynchat.pyi requires asyncore.pyi, both of which have been removed in 3.12.
This commit is contained in:
@@ -26,8 +26,6 @@ from _utils import (
|
||||
PYTHON_VERSION,
|
||||
STDLIB_PATH,
|
||||
TESTS_DIR,
|
||||
SupportedVersionsDict,
|
||||
VersionTuple,
|
||||
colored,
|
||||
get_gitignore_spec,
|
||||
get_mypy_req,
|
||||
@@ -35,6 +33,7 @@ from _utils import (
|
||||
print_error,
|
||||
print_success_msg,
|
||||
spec_matches_path,
|
||||
supported_versions_for_module,
|
||||
venv_python,
|
||||
)
|
||||
|
||||
@@ -375,14 +374,6 @@ def stdlib_module_name_from_path(path: Path) -> str:
|
||||
return ".".join(parts)
|
||||
|
||||
|
||||
def supported_versions_for_module(module_versions: SupportedVersionsDict, module_name: str) -> tuple[VersionTuple, VersionTuple]:
|
||||
while "." in module_name:
|
||||
if module_name in module_versions:
|
||||
return module_versions[module_name]
|
||||
module_name = ".".join(module_name.split(".")[:-1])
|
||||
return module_versions[module_name]
|
||||
|
||||
|
||||
@dataclass
|
||||
class TestSummary:
|
||||
mypy_result: MypyResult = MypyResult.SUCCESS
|
||||
|
||||
Reference in New Issue
Block a user