Add optional requires_python field to third-party stubs metadata (#10724)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Ali Hamdan
2023-09-24 19:39:12 +02:00
committed by GitHub
parent b1d4f29ed4
commit c5dde1e720
6 changed files with 127 additions and 29 deletions

View File

@@ -9,7 +9,7 @@ import sys
import venv
from functools import lru_cache
from pathlib import Path
from typing import Any, NamedTuple
from typing import Any, Final, NamedTuple
from typing_extensions import Annotated
import pathspec
@@ -22,6 +22,9 @@ except ImportError:
return text
PYTHON_VERSION: Final = f"{sys.version_info.major}.{sys.version_info.minor}"
# A backport of functools.cache for Python <3.9
# This module is imported by mypy_test.py, which needs to run on 3.8 in CI
cache = lru_cache(None)