From e131ec7ab83a1b415e27e31af87d8e9b900c0789 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 2 May 2025 22:11:29 -0400 Subject: [PATCH] Fix many small mypy issues --- pyproject.toml | 21 +++++++++------------ stubs/matplotlib/ft2font.pyi | 5 ----- stubs/networkx/classes/ordered.pyi | 2 +- stubs/sympy-stubs/core/cache.pyi | 4 +--- stubs/vispy/ext/cocoapy.pyi | 2 -- 5 files changed, 11 insertions(+), 23 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 42a5b3a8..4005bb3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,16 +126,13 @@ disable_error_code = [ # Not all imports in these stubs are gonna be typed "import-untyped", # TODO - "assert-type", - "assignment", - "attr-defined", - "import-not-found", - "misc", - "name-defined", - "no-redef", - "operator", - "override", - "return", - "valid-type", - "var-annotated", + "valid-type", # 967 errors in 115 files + "override", # 790 errors in 220 files + "assignment", # 773 errors in 172 files + "misc", # 692 errors in 132 files + "attr-defined", # 202 errors in 75 files + "operator", # 118 errors in 35 files + "name-defined", # 15 errors in 1 file + "assert-type", # 6 errors in 1 file + "import-not-found", # 5 errors in 5 files ] diff --git a/stubs/matplotlib/ft2font.pyi b/stubs/matplotlib/ft2font.pyi index 29716b42..161adb27 100644 --- a/stubs/matplotlib/ft2font.pyi +++ b/stubs/matplotlib/ft2font.pyi @@ -1,7 +1,6 @@ # Python: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] # Library: matplotlib, version: 3.4.0 # Module: matplotlib.ft2font, version: unspecified -import builtins as _mod_builtins import typing BOLD: int @@ -123,11 +122,7 @@ MULTIPLE_MASTERS: int SCALABLE: int SFNT: int VERTICAL: int -__doc__: typing.Any -__file__: str __freetype_build_type__: str __freetype_version__: str -__name__: str -__package__: str def __getattr__(name) -> typing.Any: ... diff --git a/stubs/networkx/classes/ordered.pyi b/stubs/networkx/classes/ordered.pyi index 1c3670c2..ecc0e3ee 100644 --- a/stubs/networkx/classes/ordered.pyi +++ b/stubs/networkx/classes/ordered.pyi @@ -6,7 +6,7 @@ from .graph import Graph from .multidigraph import MultiDiGraph from .multigraph import MultiGraph -__all__ = [] +__all__: list[str] = [] class OrderedGraph(Graph): node_dict_factory = ... diff --git a/stubs/sympy-stubs/core/cache.pyi b/stubs/sympy-stubs/core/cache.pyi index bb43478f..ef74b3e4 100644 --- a/stubs/sympy-stubs/core/cache.pyi +++ b/stubs/sympy-stubs/core/cache.pyi @@ -13,6 +13,4 @@ SYMPY_CACHE_SIZE = ... cacheit = ... def cached_property(func) -> property: ... -def lazy_function(module: str, name: str) -> Callable: - class LazyFunctionMeta(type): ... - class LazyFunction(metaclass=LazyFunctionMeta): ... +def lazy_function(module: str, name: str) -> Callable: ... diff --git a/stubs/vispy/ext/cocoapy.pyi b/stubs/vispy/ext/cocoapy.pyi index 17eb80d6..05867113 100644 --- a/stubs/vispy/ext/cocoapy.pyi +++ b/stubs/vispy/ext/cocoapy.pyi @@ -364,8 +364,6 @@ kCGImageAlphaNoneSkipLast: int = ... kCGImageAlphaNoneSkipFirst: int = ... kCGImageAlphaOnly: int = ... -kCGImageAlphaPremultipliedLast: int = ... - kCGBitmapAlphaInfoMask: int = ... kCGBitmapFloatComponents = ...