Skip to content

Commit 9fc91eb

Browse files
authored
mypy: fix all name-defined and import-not-found (#365)
1 parent a4aaeef commit 9fc91eb

File tree

8 files changed

+75
-8
lines changed

8 files changed

+75
-8
lines changed

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ disable_error_code = [
128128
"assert-type",
129129
"assignment",
130130
"attr-defined",
131-
"import-not-found",
132131
"misc",
133-
"name-defined",
134132
"no-redef",
135133
"operator",
136134
"override",

stubs/matplotlib/backends/_backend_gtk.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# PyGObject is not easily installable on Windows, let tests pass as-is
2-
from gi.repository import Gtk # pyright: ignore[reportMissingImports]
2+
from gi.repository import Gtk # type: ignore[import-not-found] # pyright: ignore[reportMissingImports]
33
from matplotlib import backend_tools
44
from matplotlib._typing import *
55
from matplotlib.backend_bases import FigureCanvasBase, FigureManagerBase, NavigationToolbar2, TimerBase, _Backend

stubs/matplotlib/backends/backend_gtk3.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Callable
22

33
# PyGObject is not easily installable on Windows, let tests pass as-is
4-
from gi.repository import Gtk # pyright: ignore[reportMissingImports]
4+
from gi.repository import Gtk # type: ignore[import-not-found] # pyright: ignore[reportMissingImports]
55
from matplotlib._api import classproperty
66
from matplotlib.backend_bases import FigureCanvasBase, ToolContainerBase
77

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from ...classes.graph import Graph
2+
3+
__all__ = ["edge_betweenness_partition", "edge_current_flow_betweenness_partition"]
4+
5+
def edge_betweenness_partition(G: Graph, number_of_sets: int, *, weight: str | None = None) -> list: ...
6+
def edge_current_flow_betweenness_partition(G: Graph, number_of_sets: int, *, weight: str | None = None) -> list: ...
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from sympy.assumptions import Predicate
2+
3+
class FinitePredicate(Predicate):
4+
name = ...
5+
handler = ...
6+
7+
class InfinitePredicate(Predicate):
8+
name = ...
9+
handler = ...
10+
11+
class PositiveInfinitePredicate(Predicate):
12+
name = ...
13+
handler = ...
14+
15+
class NegativeInfinitePredicate(Predicate):
16+
name = ...
17+
handler = ...
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
from sympy.assumptions import Predicate
2+
3+
class IntegerPredicate(Predicate):
4+
name = ...
5+
handler = ...
6+
7+
class NonIntegerPredicate(Predicate):
8+
name = ...
9+
handler = ...
10+
11+
class RationalPredicate(Predicate):
12+
name = ...
13+
handler = ...
14+
15+
class IrrationalPredicate(Predicate):
16+
name = ...
17+
handler = ...
18+
19+
class RealPredicate(Predicate):
20+
name = ...
21+
handler = ...
22+
23+
class ExtendedRealPredicate(Predicate):
24+
name = ...
25+
handler = ...
26+
27+
class HermitianPredicate(Predicate):
28+
name = ...
29+
handler = ...
30+
31+
class ComplexPredicate(Predicate):
32+
name = ...
33+
handler = ...
34+
35+
class ImaginaryPredicate(Predicate):
36+
name = ...
37+
handler = ...
38+
39+
class AntihermitianPredicate(Predicate):
40+
name = ...
41+
handler = ...
42+
43+
class AlgebraicPredicate(Predicate):
44+
name = ...
45+
AlgebraicHandler = ...
46+
47+
class TranscendentalPredicate(Predicate):
48+
name = ...
49+
handler = ...

stubs/transformers-stubs/models/auto/auto_factory.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ from typing_extensions import TypeAlias
77
from transformers.configuration_utils import PretrainedConfig
88
from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
99

10-
from .configuration_auto import AutoConfig as AutoConfig
11-
1210
_LazyAutoMappingValue: TypeAlias = tuple[
1311
# Tokenizers will depend on packages installed, too much variance and there are no common base or Protocol
1412
type[Any | None],

stubs/transformers-stubs/models/auto/tokenization_auto.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ from collections import OrderedDict
33
from typing import Any
44

55
from transformers.configuration_utils import PretrainedConfig
6+
from transformers.models.auto.auto_factory import _LazyAutoMapping
67
from transformers.tokenization_utils import PreTrainedTokenizer
78
from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
89

9-
from .auto_factory import _LazyAutoMapping
10-
1110
TOKENIZER_MAPPING_NAMES: OrderedDict[str, tuple[str | None, str | None]]
1211
TOKENIZER_MAPPING: _LazyAutoMapping
1312
CONFIG_TO_TYPE: dict[type[PretrainedConfig], str]

0 commit comments

Comments
 (0)