Skip to content

Commit b2dd999

Browse files
committed
Revert "Remove requires_python check"
This reverts commit e3d5f49.
1 parent 6c818ef commit b2dd999

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ts_utils/metadata.py

+4
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ def read_metadata(distribution: str) -> StubMetadata:
269269
assert type(requires_python_str) is str
270270
requires_python = Specifier(requires_python_str)
271271
assert requires_python != oldest_supported_python_specifier, f'requires_python="{requires_python}" is redundant'
272+
# Check minimum Python version is not less than the oldest version of Python supported by typeshed
273+
assert oldest_supported_python_specifier.contains(
274+
requires_python.version
275+
), f"'requires_python' contains versions lower than typeshed's oldest supported Python ({oldest_supported_python})"
272276
assert requires_python.operator == ">=", "'requires_python' should be a minimum version specifier, use '>=3.x'"
273277

274278
empty_tools: dict[object, object] = {}

0 commit comments

Comments
 (0)