Support requires_python in runtests.py (#14051)

This commit is contained in:
Avasam
2025-05-13 12:51:46 -04:00
committed by GitHub
parent 6deddd7e20
commit 64875ee375
2 changed files with 15 additions and 8 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ def _is_nested_dict(obj: object) -> TypeGuard[dict[str, dict[str, Any]]]:
@functools.cache
def _get_oldest_supported_python() -> str:
def get_oldest_supported_python() -> str:
with PYPROJECT_PATH.open("rb") as config:
val = tomli.load(config)["tool"]["typeshed"]["oldest_supported_python"]
assert type(val) is str
@@ -276,7 +276,7 @@ def read_metadata(distribution: str) -> StubMetadata:
partial_stub: object = data.get("partial_stub", True)
assert type(partial_stub) is bool
requires_python_str: object = data.get("requires_python")
oldest_supported_python = _get_oldest_supported_python()
oldest_supported_python = get_oldest_supported_python()
oldest_supported_python_specifier = Specifier(f">={oldest_supported_python}")
if requires_python_str is None:
requires_python = oldest_supported_python_specifier