[flake8-typing-imports] Complete stubs (#14262)

This commit is contained in:
Semyon Moroz
2025-07-07 14:10:34 +00:00
committed by GitHub
parent 0a26a8320b
commit e038a0e1c3
3 changed files with 30 additions and 11 deletions
-1
View File
@@ -36,7 +36,6 @@
"stubs/defusedxml",
"stubs/docker",
"stubs/docutils",
"stubs/flake8-typing-imports",
"stubs/Flask-SocketIO",
"stubs/fpdf2",
"stubs/gdb",
@@ -1,6 +1,2 @@
version = "1.16.*"
upstream_repository = "https://github.com/asottile/flake8-typing-imports"
partial_stub = true
[tool.stubtest]
ignore_missing_stub = true
@@ -1,16 +1,40 @@
import argparse
import ast
from collections.abc import Generator
from typing import Any, ClassVar
from typing import Any, Final, NamedTuple
from typing_extensions import Self
class Version(NamedTuple):
major: int = 0
minor: int = 0
patch: int = 0
@classmethod
def parse(cls, s: str) -> Self: ...
SYMBOLS: Final[list[tuple[Version, frozenset[str]]]]
VERSIONS: Final[frozenset[Version]]
class Visitor(ast.NodeVisitor):
imports: dict[str, list[tuple[int, int]]]
attributes: dict[str, list[tuple[int, int]]]
defined_overload: bool
unions_pattern_or_match: list[tuple[int, int]]
from_imported_names: set[str]
namedtuple_methods: list[tuple[int, int]]
namedtuple_defaults: list[tuple[int, int]]
def __init__(self) -> None: ...
def visit_ImportFrom(self, node: ast.ImportFrom) -> None: ...
def visit_Attribute(self, node: ast.Attribute) -> None: ...
def visit_FunctionDef(self, node: ast.FunctionDef) -> None: ...
def visit_Subscript(self, node: ast.Subscript) -> None: ...
def visit_ClassDef(self, node: ast.ClassDef) -> None: ...
def visit_AnnAssign(self, node: ast.AnnAssign) -> None: ...
def generic_visit(self, node: ast.AST) -> None: ...
class Plugin:
name: ClassVar[str]
version: ClassVar[str]
@staticmethod
def add_options(option_manager: Any) -> None: ...
@classmethod
def parse_options(cls, options: argparse.Namespace) -> None: ...
def __init__(self, tree: ast.AST) -> None: ...
def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ...
def __getattr__(name: str): ... # incomplete module (other attributes are normally not accessed)
def run(self) -> Generator[tuple[int, int, str, type[Any]]]: ...