Skip to content

Commit 24e7343

Browse files
committed
Fix all reportUnsupportedDunderAll and set as error
1 parent 97e16f0 commit 24e7343

File tree

8 files changed

+50
-51
lines changed

8 files changed

+50
-51
lines changed

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ reportPropertyTypeMismatch = false
104104
reportOverlappingOverload = false
105105
# The name of the self/cls parameter is out of third-party stubs' control.
106106
reportSelfClsParameterName = false
107+
# Not an error by default in standard mode
108+
reportUnsupportedDunderAll = "error"
107109

108110
# Error reports to fix in code
109111
reportArgumentType = "none" # TODO

stubs/matplotlib/dates.pyi

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import datetime
22

33
import numpy as np
44
from dateutil import rrule
5+
from dateutil.relativedelta import relativedelta
56

67
from .ticker import Formatter, Locator
78
from .units import ConversionInterface
@@ -174,8 +175,6 @@ __all__ = (
174175
"num2date",
175176
"num2timedelta",
176177
"drange",
177-
"epoch2num",
178-
"num2epoch",
179178
"set_epoch",
180179
"get_epoch",
181180
"DateFormatter",

stubs/sklearn/utils/_joblib.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import warnings as _warnings
22

3+
import joblib
34
from joblib import (
45
Memory,
56
Parallel,

stubs/sympy-stubs/printing/lambdarepr.pyi

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ from typing import Any
22

33
from sympy.printing.pycode import MpmathPrinter, PythonCodePrinter
44

5-
__all__ = ["PythonCodePrinter", "MpmathPrinter", "NumPyPrinter", "LambdaPrinter", "NumPyPrinter", "IntervalPrinter", "lambdarepr"]
5+
from .numpy import NumPyPrinter # NumPyPrinter is imported for backward compatibility
6+
7+
__all__ = [
8+
"PythonCodePrinter",
9+
"MpmathPrinter", # MpmathPrinter is published for backward compatibility
10+
"NumPyPrinter",
11+
"LambdaPrinter",
12+
"NumPyPrinter", # Duplicate, see https://github.com/sympy/sympy/pull/27229
13+
"IntervalPrinter",
14+
"lambdarepr",
15+
]
616

717
class LambdaPrinter(PythonCodePrinter):
818
printmethod = ...

stubs/vispy/gloo/wrappers.pyi

+33-21
Original file line numberDiff line numberDiff line change
@@ -97,35 +97,17 @@ class BaseGlooFunctions(object):
9797

9898
# glBlendFunc(Separate), glBlendColor, glBlendEquation(Separate)
9999

100-
def set_blend_func(
101-
self,
102-
srgb: str = "one",
103-
drgb: str = "zero",
104-
salpha: str | None = None,
105-
dalpha: str | None = None,
106-
): ...
100+
def set_blend_func(self, srgb: str = "one", drgb: str = "zero", salpha: str | None = None, dalpha: str | None = None): ...
107101
def set_blend_color(self, color): ...
108102
def set_blend_equation(self, mode_rgb: str, mode_alpha: str | None = None): ...
109103

110104
# glScissor, glStencilFunc(Separate), glStencilMask(Separate),
111105
# glStencilOp(Separate),
112106

113107
def set_scissor(self, x: int, y: int, w: int, h: int): ...
114-
def set_stencil_func(
115-
self,
116-
func: str = "always",
117-
ref: int = 0,
118-
mask: int = 8,
119-
face: str = "front_and_back",
120-
): ...
108+
def set_stencil_func(self, func: str = "always", ref: int = 0, mask: int = 8, face: str = "front_and_back"): ...
121109
def set_stencil_mask(self, mask: int = 8, face: str = "front_and_back"): ...
122-
def set_stencil_op(
123-
self,
124-
sfail: str = "keep",
125-
dpfail: str = "keep",
126-
dppass: str = "keep",
127-
face: str = "front_and_back",
128-
): ...
110+
def set_stencil_op(self, sfail: str = "keep", dpfail: str = "keep", dppass: str = "keep", face: str = "front_and_back"): ...
129111

130112
# glDepthFunc, glDepthMask, glColorMask, glSampleCoverage
131113

@@ -161,6 +143,36 @@ class GlooFunctions(BaseGlooFunctions):
161143
# GlooFunctions without queue: use queue of canvas that is current at call-time
162144
global_gloo_functions = ...
163145

146+
# Create global functions object and inject names here
147+
148+
# GlooFunctions without queue: use queue of canvas that is current at call-time
149+
def set_viewport(*args): ...
150+
def set_depth_range(near: float = 0.0, far: float = 1.0): ...
151+
def set_front_face(mode: str = "ccw"): ...
152+
def set_cull_face(mode: str = "back"): ...
153+
def set_line_width(width: float = 1.0): ...
154+
def set_polygon_offset(factor: float = 0.0, units: float = 0.0): ...
155+
def clear(color=True, depth: bool | float = True, stencil: bool | int = True): ...
156+
def set_clear_color(color="black", alpha: None | float = None): ...
157+
def set_clear_depth(depth: float = 1.0): ...
158+
def set_clear_stencil(index: int = 0): ...
159+
def set_blend_func(srgb: str = "one", drgb: str = "zero", salpha: str | None = None, dalpha: str | None = None): ...
160+
def set_blend_color(color): ...
161+
def set_blend_equation(mode_rgb: str, mode_alpha: str | None = None): ...
162+
def set_scissor(x: int, y: int, w: int, h: int): ...
163+
def set_stencil_func(func: str = "always", ref: int = 0, mask: int = 8, face: str = "front_and_back"): ...
164+
def set_stencil_mask(mask: int = 8, face: str = "front_and_back"): ...
165+
def set_stencil_op(sfail: str = "keep", dpfail: str = "keep", dppass: str = "keep", face: str = "front_and_back"): ...
166+
def set_depth_func(func: str = "less"): ...
167+
def set_depth_mask(flag: bool): ...
168+
def set_color_mask(red: bool, green: bool, blue: bool, alpha: bool): ...
169+
def set_sample_coverage(value: float = 1.0, invert: bool = False): ...
170+
def get_state_presets() -> Mapping: ...
171+
def set_state(preset: Literal["opaque", "translucent", "additive"] | None = None, **kwargs): ...
172+
def finish(): ...
173+
def flush(): ...
174+
def set_hint(target: str, mode: str): ...
175+
164176
# Functions that do not use the glir queue
165177

166178
def read_pixels(

stubs/vispy/util/dpi/__init__.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
55
# -----------------------------------------------------------------------------
66

7-
import sys as sys
8-
97
__all__ = ["get_dpi"]
8+
9+
def get_dpi(raise_error: bool = True) -> float: ...

stubs/vispy/util/dpi/_linux.pyi

-16
This file was deleted.

stubs/vispy/util/dpi/_quartz.pyi

-9
This file was deleted.

0 commit comments

Comments
 (0)