Skip to content

mypy: fix all name-defined and import-not-found #365

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
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
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ disable_error_code = [
"assert-type",
"assignment",
"attr-defined",
"import-not-found",
"misc",
"name-defined",
"no-redef",
"operator",
"override",
Expand Down
2 changes: 1 addition & 1 deletion stubs/matplotlib/backends/_backend_gtk.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PyGObject is not easily installable on Windows, let tests pass as-is
from gi.repository import Gtk # pyright: ignore[reportMissingImports]
from gi.repository import Gtk # type: ignore[import-not-found] # pyright: ignore[reportMissingImports]
from matplotlib import backend_tools
from matplotlib._typing import *
from matplotlib.backend_bases import FigureCanvasBase, FigureManagerBase, NavigationToolbar2, TimerBase, _Backend
Expand Down
2 changes: 1 addition & 1 deletion stubs/matplotlib/backends/backend_gtk3.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Callable

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

Expand Down
6 changes: 6 additions & 0 deletions stubs/networkx/algorithms/community/divisive.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from ...classes.graph import Graph

__all__ = ["edge_betweenness_partition", "edge_current_flow_betweenness_partition"]

def edge_betweenness_partition(G: Graph, number_of_sets: int, *, weight: str | None = None) -> list: ...
def edge_current_flow_betweenness_partition(G: Graph, number_of_sets: int, *, weight: str | None = None) -> list: ...
17 changes: 17 additions & 0 deletions stubs/sympy-stubs/assumptions/predicates/calculus.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from sympy.assumptions import Predicate

class FinitePredicate(Predicate):
name = ...
handler = ...

class InfinitePredicate(Predicate):
name = ...
handler = ...

class PositiveInfinitePredicate(Predicate):
name = ...
handler = ...

class NegativeInfinitePredicate(Predicate):
name = ...
handler = ...
49 changes: 49 additions & 0 deletions stubs/sympy-stubs/assumptions/predicates/sets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from sympy.assumptions import Predicate

class IntegerPredicate(Predicate):
name = ...
handler = ...

class NonIntegerPredicate(Predicate):
name = ...
handler = ...

class RationalPredicate(Predicate):
name = ...
handler = ...

class IrrationalPredicate(Predicate):
name = ...
handler = ...

class RealPredicate(Predicate):
name = ...
handler = ...

class ExtendedRealPredicate(Predicate):
name = ...
handler = ...

class HermitianPredicate(Predicate):
name = ...
handler = ...

class ComplexPredicate(Predicate):
name = ...
handler = ...

class ImaginaryPredicate(Predicate):
name = ...
handler = ...

class AntihermitianPredicate(Predicate):
name = ...
handler = ...

class AlgebraicPredicate(Predicate):
name = ...
AlgebraicHandler = ...

class TranscendentalPredicate(Predicate):
name = ...
handler = ...
2 changes: 0 additions & 2 deletions stubs/transformers-stubs/models/auto/auto_factory.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ from typing_extensions import TypeAlias
from transformers.configuration_utils import PretrainedConfig
from transformers.tokenization_utils_fast import PreTrainedTokenizerFast

from .configuration_auto import AutoConfig as AutoConfig

_LazyAutoMappingValue: TypeAlias = tuple[
# Tokenizers will depend on packages installed, too much variance and there are no common base or Protocol
type[Any | None],
Expand Down
3 changes: 1 addition & 2 deletions stubs/transformers-stubs/models/auto/tokenization_auto.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ from collections import OrderedDict
from typing import Any

from transformers.configuration_utils import PretrainedConfig
from transformers.models.auto.auto_factory import _LazyAutoMapping
from transformers.tokenization_utils import PreTrainedTokenizer
from transformers.tokenization_utils_fast import PreTrainedTokenizerFast

from .auto_factory import _LazyAutoMapping

TOKENIZER_MAPPING_NAMES: OrderedDict[str, tuple[str | None, str | None]]
TOKENIZER_MAPPING: _LazyAutoMapping
CONFIG_TO_TYPE: dict[type[PretrainedConfig], str]
Expand Down