Skip to content

[flake8-typing-imports] Complete stubs #14262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"stubs/defusedxml",
"stubs/docker",
"stubs/docutils",
"stubs/flake8-typing-imports",
"stubs/Flask-SocketIO",
"stubs/fpdf2",
"stubs/gdb",
Expand Down
4 changes: 0 additions & 4 deletions stubs/flake8-typing-imports/METADATA.toml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 30 additions & 6 deletions stubs/flake8-typing-imports/flake8_typing_imports.pyi
Original file line number Diff line number Diff line change
@@ -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]]]: ...