Skip to content

Commit b64dd55

Browse files
authored
Merge pull request #26945 from meeseeksmachine/auto-backport-of-pr-26927-on-v3.8.x
Backport PR #26927 on branch v3.8.x ([TYP] Remove some stubtest allowlist entries)
2 parents 7764c49 + d49096b commit b64dd55

File tree

4 files changed

+21
-34
lines changed

4 files changed

+21
-34
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@ matplotlib.ticker.LogitLocator.nonsingular
3232
matplotlib.backend_bases._Mode.__new__
3333
matplotlib.units.Number.__hash__
3434

35-
# Property read-write vs read-only weirdness, fix if possible
36-
matplotlib.offsetbox.DraggableBase.canvas
37-
matplotlib.offsetbox.DraggableBase.cids
38-
matplotlib.transforms.BboxTransform.is_separable
39-
matplotlib.transforms.BboxTransformFrom.is_separable
40-
matplotlib.transforms.BboxTransformTo.is_separable
41-
matplotlib.transforms.BlendedAffine2D.is_separable
42-
matplotlib.transforms.CompositeGenericTransform.is_separable
43-
matplotlib.transforms.TransformWrapper.input_dims
44-
matplotlib.transforms.TransformWrapper.is_separable
45-
matplotlib.transforms.TransformWrapper.output_dims
46-
4735
# 3.6 Pending deprecations
4836
matplotlib.figure.Figure.set_constrained_layout
4937
matplotlib.figure.Figure.set_constrained_layout_pads
@@ -150,16 +138,10 @@ matplotlib.text.Text.set_weight
150138
matplotlib.axes._base._AxesBase.get_fc
151139
matplotlib.axes._base._AxesBase.set_fc
152140

153-
# Other dynamic python behaviors not type hinted
154-
matplotlib.rcsetup.defaultParams
155-
156141
# Maybe should be abstractmethods, required for subclasses, stubs define once
157142
matplotlib.tri.*TriInterpolator.__call__
158143
matplotlib.tri.*TriInterpolator.gradient
159144

160-
# Functionally a method call, but actually a class instance, type hinted as former
161-
matplotlib.rcsetup.validate_fillstyle
162-
163145
# TypeVar used only in type hints
164146
matplotlib.backend_bases.FigureCanvasBase._T
165147
matplotlib.backend_managers.ToolManager._T

lib/matplotlib/offsetbox.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,15 @@ class AnnotationBbox(martist.Artist, mtext._AnnotationBase):
287287
class DraggableBase:
288288
ref_artist: martist.Artist
289289
got_artist: bool
290-
canvas: FigureCanvasBase
291-
cids: list[int]
292290
mouse_x: int
293291
mouse_y: int
294292
background: Any
293+
294+
@property
295+
def canvas(self) -> FigureCanvasBase: ...
296+
@property
297+
def cids(self) -> list[int]: ...
298+
295299
def __init__(self, ref_artist: martist.Artist, use_blit: bool = ...) -> None: ...
296300
def on_motion(self, evt: Event) -> None: ...
297301
def on_pick(self, evt: Event) -> None: ...

lib/matplotlib/rcsetup.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ def validate_fontstretch(
129129
def validate_font_properties(s: Any) -> dict[str, Any]: ...
130130
def validate_whiskers(s: Any) -> list[float] | float: ...
131131
def validate_ps_distiller(s: Any) -> None | Literal["ghostscript", "xpdf"]: ...
132-
def validate_fillstyle(
133-
s: Any,
134-
) -> Literal["full", "left", "right", "bottom", "top", "none"]: ...
132+
133+
validate_fillstyle: ValidateInStrings
134+
135135
def validate_fillstylelist(
136136
s: Any,
137137
) -> list[Literal["full", "left", "right", "bottom", "top", "none"]]: ...
@@ -152,3 +152,6 @@ def validate_hist_bins(
152152
) -> Literal["auto", "sturges", "fd", "doane", "scott", "rice", "sqrt"] | int | list[
153153
float
154154
]: ...
155+
156+
# At runtime is added in __init__.py
157+
defaultParams: dict[str, Any]

lib/matplotlib/transforms.pyi

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,17 @@ class LockableBbox(BboxBase):
175175
def locked_y1(self, y1: float | None) -> None: ...
176176

177177
class Transform(TransformNode):
178-
input_dims: int | None
179-
output_dims: int | None
180-
is_separable: bool
181-
# Implemented as a standard attr in base class, but functionally readonly and some subclasses implement as such
178+
179+
# Implemented as a standard attrs in base class, but functionally readonly and some subclasses implement as such
180+
@property
181+
def input_dims(self) -> int | None: ...
182+
@property
183+
def output_dims(self) -> int | None: ...
184+
@property
185+
def is_separable(self) -> bool: ...
182186
@property
183187
def has_inverse(self) -> bool: ...
188+
184189
def __add__(self, other: Transform) -> Transform: ...
185190
@property
186191
def depth(self) -> int: ...
@@ -225,8 +230,6 @@ class Affine2DBase(AffineBase):
225230
input_dims: Literal[2]
226231
output_dims: Literal[2]
227232
def frozen(self) -> Affine2D: ...
228-
@property
229-
def is_separable(self): ...
230233
def to_values(self) -> tuple[float, float, float, float, float, float]: ...
231234

232235
class Affine2D(Affine2DBase):
@@ -255,7 +258,6 @@ class _BlendedMixin:
255258
class BlendedGenericTransform(_BlendedMixin, Transform):
256259
input_dims: Literal[2]
257260
output_dims: Literal[2]
258-
is_separable: bool
259261
pass_through: bool
260262
def __init__(
261263
self, x_transform: Transform, y_transform: Transform, **kwargs
@@ -265,8 +267,6 @@ class BlendedGenericTransform(_BlendedMixin, Transform):
265267
def contains_branch(self, other: Transform) -> Literal[False]: ...
266268
@property
267269
def is_affine(self) -> bool: ...
268-
@property
269-
def has_inverse(self) -> bool: ...
270270

271271
class BlendedAffine2D(_BlendedMixin, Affine2DBase):
272272
def __init__(
@@ -279,8 +279,6 @@ def blended_transform_factory(
279279

280280
class CompositeGenericTransform(Transform):
281281
pass_through: bool
282-
input_dims: int | None
283-
output_dims: int | None
284282
def __init__(self, a: Transform, b: Transform, **kwargs) -> None: ...
285283

286284
class CompositeAffine2D(Affine2DBase):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy