-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_analysis.pyi
More file actions
90 lines (76 loc) · 2.89 KB
/
_analysis.pyi
File metadata and controls
90 lines (76 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File generated with docstub
import builtins
import importlib
import json
import logging
import re
from collections.abc import Iterable
from dataclasses import asdict, dataclass
from functools import cache
from pathlib import Path
from typing import Any, ClassVar
import libcst as cst
import libcst.matchers as cstm
from ._report import Stats
from ._utils import accumulate_qualname, module_name_from_path, pyfile_checksum
logger: logging.Logger
def _shared_leading_qualname(*qualnames: tuple[str]) -> str: ...
@dataclass(slots=True, frozen=True)
class PyImport:
import_: str | None = ...
from_: str | None = ...
as_: str | None = ...
implicit: str | None = ...
@classmethod
def typeshed_Incomplete(cls) -> PyImport: ...
def format_import(self, relative_to: str | None = ...) -> str: ...
@property
def target(self) -> str: ...
@property
def has_import(self) -> None: ...
def __post_init__(self) -> None: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def _is_type(value: Any) -> bool: ...
def _builtin_types() -> dict[str, PyImport]: ...
def _runtime_types_in_module(module_name: str) -> dict[str, PyImport]: ...
def common_known_types() -> dict[str, PyImport]: ...
class TypeCollector(cst.CSTVisitor):
class ImportSerializer:
suffix: ClassVar[str]
encoding: ClassVar[str]
def hash_args(self, path: Path) -> str: ...
def serialize(
self, data: tuple[dict[str, PyImport], dict[str, PyImport]]
) -> bytes: ...
def deserialize(
self, raw: bytes
) -> tuple[dict[str, PyImport], dict[str, PyImport]]: ...
@classmethod
def collect(cls, file: Path) -> tuple[dict[str, PyImport], dict[str, PyImport]]: ...
def __init__(self, *, module_name: str) -> None: ...
def visit_ClassDef(self, node: cst.ClassDef) -> bool: ...
def leave_ClassDef(self, original_node: cst.ClassDef) -> None: ...
def visit_FunctionDef(self, node: cst.FunctionDef) -> bool: ...
def visit_TypeAlias(self, node: cst.TypeAlias) -> bool: ...
def visit_AnnAssign(self, node: cst.AnnAssign) -> bool: ...
def visit_ImportFrom(self, node: cst.ImportFrom) -> bool: ...
def visit_Import(self, node: cst.Import) -> bool: ...
def _collect_type_annotation(self, stack: Iterable[str]) -> None: ...
class TypeMatcher:
types: dict[str, PyImport]
type_prefixes: dict[str, PyImport]
type_nicknames: dict[str, str]
successful_queries: int
unknown_qualnames: list
current_file: Path | None
def __init__(
self,
*,
types: dict[str, PyImport] | None = ...,
type_prefixes: dict[str, PyImport] | None = ...,
type_nicknames: dict[str, str] | None = ...,
stats: Stats | None = ...,
) -> None: ...
def _resolve_nickname(self, name: str) -> str: ...
def match(self, search: str) -> tuple[str | None, PyImport | None]: ...