Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e5f7a7

Browse files
authored
Drop support for Python 3.7 (#11234)
1 parent 262d73c commit 4e5f7a7

10 files changed

Lines changed: 8 additions & 48 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
strategy:
126126
matrix:
127127
python-platform: ["Linux", "Windows", "Darwin"]
128-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
128+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
129129
fail-fast: false
130130
steps:
131131
- uses: actions/checkout@v4

CONTRIBUTING.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ new features to the Python type system. In general, new features can
279279
be used in typeshed as soon as the PEP has been accepted and implemented
280280
and most type checkers support the new feature.
281281

282-
Accepted features that *cannot* yet be used in typeshed include:
283-
- [PEP 570](https://www.python.org/dev/peps/pep-0570/) (positional-only
284-
arguments): see [#4972](https://github.com/python/typeshed/issues/4972),
285-
use argument names prefixed with `__` instead
286-
287282
The following features are partially supported:
288283
- [PEP 702](https://peps.python.org/pep-0702/) (`@deprecated()`)
289284
- For now, cannot be used in combination with other decorators
@@ -309,21 +304,13 @@ Features from the `typing` module that are not present in all
309304
supported Python 3 versions must be imported from `typing_extensions`
310305
instead in typeshed stubs. This currently affects:
311306

312-
- `Final` and `@final` (new in Python 3.8)
313-
- `Literal` (new in Python 3.8)
314-
- `SupportsIndex` (new in Python 3.8)
315-
- `TypedDict` (new in Python 3.8)
316307
- `Concatenate` (new in Python 3.10)
317308
- `ParamSpec` (new in Python 3.10)
318309
- `TypeGuard` (new in Python 3.10)
319310
- `Self` (new in Python 3.11)
320311
- `LiteralString` (new in Python 3.11)
321312
- `@deprecated` (new in Python 3.13; in the `warnings` module)
322313

323-
Two exceptions are `Protocol` and `runtime_checkable`: although
324-
these were added in Python 3.8, they can be used in stubs regardless
325-
of Python version.
326-
327314
Some type checkers implicitly promote the `bytearray` and
328315
`memoryview` types to `bytes`.
329316
[PEP 688](https://www.python.org/dev/peps/pep-0688/) removes

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ the project the stubs are for, but instead report them here to typeshed.**
2020
Further documentation on stub files, typeshed, and Python's typing system in
2121
general, can also be found at https://typing.readthedocs.io/en/latest/.
2222

23-
Typeshed fully supports Python versions 3.8 and up. Support for Python 3.7
24-
is limited: see https://github.com/python/typeshed/issues/10113
25-
for details.
23+
Typeshed supports Python versions 3.8 and up.
2624

2725
## Using
2826

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ known-first-party = ["parse_metadata", "utils"]
9595

9696
[tool.typeshed]
9797
pyright_version = "1.1.342"
98-
oldest_supported_python = "3.7"
98+
oldest_supported_python = "3.8"

stubs/gevent/METADATA.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version = "23.9.*"
22
upstream_repository = "https://github.com/gevent/gevent"
33
requires = ["types-greenlet", "types-psutil"]
4-
requires_python = ">=3.8"
54

65
[tool.stubtest]
76
# Run stubtest on all platforms, since there is some platform specific stuff

stubs/jsonschema/METADATA.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version = "4.20.*"
22
upstream_repository = "https://github.com/python-jsonschema/jsonschema"
33
requires = ["referencing"]
44
partial_stub = true
5-
requires_python = ">=3.8"
65

76
[tool.stubtest]
87
ignore_missing_stub = true

stubs/pyinstaller/METADATA.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version = "6.3.*"
22
upstream_repository = "https://github.com/pyinstaller/pyinstaller"
33
requires = ["types-setuptools"]
4-
requires_python = ">=3.8"
54

65
[tool.stubtest]
76
extras = ["completion"]

test_cases/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ Some tests will only pass on mypy
113113
with a specific Python version passed on the command line to the `tests/regr_test.py` script.
114114
To mark a test-case file as being skippable on lower versions of Python,
115115
append `-py3*` to the filename.
116-
For example, if `foo` is a stdlib feature that's new in Python 3.9,
117-
test cases for `foo` should be put in a file named `test_cases/stdlib/check_foo-py39.py`.
116+
For example, if `foo` is a stdlib feature that's new in Python 3.11,
117+
test cases for `foo` should be put in a file named `test_cases/stdlib/check_foo-py311.py`.
118118
This means that mypy will only run the test case
119-
if `--python-version 3.9`, `--python-version 3.10` or `--python-version 3.11`
119+
if `--python-version 3.11`, `--python-version 3.12`, etc.
120120
is passed on the command line to `tests/regr_test.py`,
121-
but it *won't* run the test case if `--python-version 3.7` or `--python-version 3.8`
121+
but it _won't_ run the test case if e.g. `--python-version 3.9`
122122
is passed on the command line.
123123

124124
However, `if sys.version_info >= (3, target):` is still required for `pyright`

tests/check_new_syntax.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,7 @@ def visit_If(self, node: ast.If) -> None:
2626
)
2727
self.generic_visit(node)
2828

29-
class PEP570Finder(ast.NodeVisitor):
30-
def __init__(self) -> None:
31-
self.lineno: int | None = None
32-
33-
def _visit_function(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None:
34-
old_lineno = self.lineno
35-
self.lineno = node.lineno
36-
self.generic_visit(node)
37-
self.lineno = old_lineno
38-
39-
visit_FunctionDef = visit_AsyncFunctionDef = _visit_function
40-
41-
def visit_arguments(self, node: ast.arguments) -> None:
42-
if node.posonlyargs:
43-
assert isinstance(self.lineno, int)
44-
errors.append(
45-
f"{path}:{self.lineno}: PEP-570 syntax cannot be used in typeshed yet. "
46-
f"Prefix parameter names with `__` to indicate positional-only parameters"
47-
)
48-
self.generic_visit(node)
49-
5029
IfFinder().visit(tree)
51-
PEP570Finder().visit(tree)
5230
return errors
5331

5432

tests/regr_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
TYPESHED = "typeshed"
4242

4343
SUPPORTED_PLATFORMS = ["linux", "darwin", "win32"]
44-
SUPPORTED_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"]
44+
SUPPORTED_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8"]
4545

4646

4747
def package_with_test_cases(package_name: str) -> PackageInfo:

0 commit comments

Comments
 (0)