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

Skip to content

Commit e038a0e

Browse files
authored
[flake8-typing-imports] Complete stubs (#14262)
1 parent 0a26a83 commit e038a0e

3 files changed

Lines changed: 30 additions & 11 deletions

File tree

pyrightconfig.stricter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"stubs/defusedxml",
3737
"stubs/docker",
3838
"stubs/docutils",
39-
"stubs/flake8-typing-imports",
4039
"stubs/Flask-SocketIO",
4140
"stubs/fpdf2",
4241
"stubs/gdb",
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
version = "1.16.*"
22
upstream_repository = "https://github.com/asottile/flake8-typing-imports"
3-
partial_stub = true
4-
5-
[tool.stubtest]
6-
ignore_missing_stub = true
Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
11
import argparse
22
import ast
33
from collections.abc import Generator
4-
from typing import Any, ClassVar
4+
from typing import Any, Final, NamedTuple
5+
from typing_extensions import Self
6+
7+
class Version(NamedTuple):
8+
major: int = 0
9+
minor: int = 0
10+
patch: int = 0
11+
@classmethod
12+
def parse(cls, s: str) -> Self: ...
13+
14+
SYMBOLS: Final[list[tuple[Version, frozenset[str]]]]
15+
VERSIONS: Final[frozenset[Version]]
16+
17+
class Visitor(ast.NodeVisitor):
18+
imports: dict[str, list[tuple[int, int]]]
19+
attributes: dict[str, list[tuple[int, int]]]
20+
defined_overload: bool
21+
unions_pattern_or_match: list[tuple[int, int]]
22+
from_imported_names: set[str]
23+
namedtuple_methods: list[tuple[int, int]]
24+
namedtuple_defaults: list[tuple[int, int]]
25+
def __init__(self) -> None: ...
26+
def visit_ImportFrom(self, node: ast.ImportFrom) -> None: ...
27+
def visit_Attribute(self, node: ast.Attribute) -> None: ...
28+
def visit_FunctionDef(self, node: ast.FunctionDef) -> None: ...
29+
def visit_Subscript(self, node: ast.Subscript) -> None: ...
30+
def visit_ClassDef(self, node: ast.ClassDef) -> None: ...
31+
def visit_AnnAssign(self, node: ast.AnnAssign) -> None: ...
32+
def generic_visit(self, node: ast.AST) -> None: ...
533

634
class Plugin:
7-
name: ClassVar[str]
8-
version: ClassVar[str]
935
@staticmethod
1036
def add_options(option_manager: Any) -> None: ...
1137
@classmethod
1238
def parse_options(cls, options: argparse.Namespace) -> None: ...
1339
def __init__(self, tree: ast.AST) -> None: ...
14-
def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ...
15-
16-
def __getattr__(name: str): ... # incomplete module (other attributes are normally not accessed)
40+
def run(self) -> Generator[tuple[int, int, str, type[Any]]]: ...

0 commit comments

Comments
 (0)