mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
Drop support for Python 3.7 (#11234)
This commit is contained in:
@@ -26,29 +26,7 @@ def check_new_syntax(tree: ast.AST, path: Path, stub: str) -> list[str]:
|
||||
)
|
||||
self.generic_visit(node)
|
||||
|
||||
class PEP570Finder(ast.NodeVisitor):
|
||||
def __init__(self) -> None:
|
||||
self.lineno: int | None = None
|
||||
|
||||
def _visit_function(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None:
|
||||
old_lineno = self.lineno
|
||||
self.lineno = node.lineno
|
||||
self.generic_visit(node)
|
||||
self.lineno = old_lineno
|
||||
|
||||
visit_FunctionDef = visit_AsyncFunctionDef = _visit_function
|
||||
|
||||
def visit_arguments(self, node: ast.arguments) -> None:
|
||||
if node.posonlyargs:
|
||||
assert isinstance(self.lineno, int)
|
||||
errors.append(
|
||||
f"{path}:{self.lineno}: PEP-570 syntax cannot be used in typeshed yet. "
|
||||
f"Prefix parameter names with `__` to indicate positional-only parameters"
|
||||
)
|
||||
self.generic_visit(node)
|
||||
|
||||
IfFinder().visit(tree)
|
||||
PEP570Finder().visit(tree)
|
||||
return errors
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ VENV_DIR = ".venv"
|
||||
TYPESHED = "typeshed"
|
||||
|
||||
SUPPORTED_PLATFORMS = ["linux", "darwin", "win32"]
|
||||
SUPPORTED_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"]
|
||||
SUPPORTED_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8"]
|
||||
|
||||
|
||||
def package_with_test_cases(package_name: str) -> PackageInfo:
|
||||
|
||||
Reference in New Issue
Block a user