10000 Merge pull request #30006 from dstansby/lint-pyi · matplotlib/matplotlib@75d9199 · GitHub
[go: up one dir, main page]

Skip to content

Commit 75d9199

Browse files
authored
Merge pull request #30006 from dstansby/lint-pyi
Enable linting of .pyi files
2 parents f7051b5 + da6b32e commit 75d9199

File tree

9 files changed

+10
-13
lines changed

9 files changed

+10
-13
lines changed

lib/matplotlib/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ __all__ = [
2626
"interactive",
2727
"is_interactive",
2828
"colormaps",
29+
"multivar_colormaps",
30+
"bivar_colormaps",
2931
"color_sequences",
3032
]
3133

lib/matplotlib/_enums.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import cast
21
from enum import Enum
32

43

lib/matplotlib/axes/_axes.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ from matplotlib.axes._base import _AxesBase
22
from matplotlib.axes._secondary_axes import SecondaryAxis
33

44
from matplotlib.artist import Artist
5-
from matplotlib.backend_bases import RendererBase
65
from matplotlib.collections import (
76
Collection,
87
FillBetweenPolyCollection,
@@ -32,7 +31,6 @@ import matplotlib.table as mtable
3231
import matplotlib.stackplot as mstack
3332
import matplotlib.streamplot as mstream
3433

35-
import datetime
3634
import PIL.Image
3735
from collections.abc import Callable, Iterable, Sequence
3836
from typing import Any, Literal, overload

lib/matplotlib/colorizer.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from matplotlib import cbook, colorbar, colors, artist
22

3-
from typing import overload
43
import numpy as np
54
from numpy.typing import ArrayLike
65

lib/matplotlib/colors.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ class BivarColormap:
196196
M: int
197197
n_variates: int
198198
def __init__(
199-
self, N: int = ..., M: int | None = ..., shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
200-
origin: Sequence[float] = ..., name: str = ...
199+
self, N: int = ..., M: int | None = ..., shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
200+
origin: Sequence[float] = ..., name: str = ...
201201
) -> None: ...
202202
@overload
203203
def __call__(
@@ -245,8 +245,8 @@ class SegmentedBivarColormap(BivarColormap):
245245

246246
class BivarColormapFromImage(BivarColormap):
247247
def __init__(
248-
self, lut: np.ndarray, shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
249-
origin: Sequence[float] = ..., name: str = ...
248+
self, lut: np.ndarray, shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
249+
origin: Sequence[float] = ..., name: str = ...
250250
) -> None: ...
251251

252252
class Normalize:

lib/matplotlib/contour.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import matplotlib.cm as cm
22
from matplotlib.artist import Artist
33
from matplotlib.axes import Axes
4-
from matplotlib.collections import Collection, PathCollection
4+
from matplotlib.collections import Collection
55
from matplotlib.colorizer import Colorizer, ColorizingArtist
66
from matplotlib.colors import Colormap, Normalize
77
from matplotlib.path import Path

lib/matplotlib/table.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from .transforms import Bbox
88
from .typing import ColorType
99

1010
from collections.abc import Sequence
11-
from typing import Any, Literal, TYPE_CHECKING
11+
from typing import Any, Literal
1212

1313
from pandas import DataFrame
1414

lib/matplotlib/text.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from .transforms import (
1414
Transform,
1515
)
1616

17-
from collections.abc import Callable, Iterable
17+
from collections.abc import Iterable
1818
from typing import Any, Literal
1919
from .typing import ColorType, CoordsType
2020

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ exclude = [
9999
"tools/gh_api.py",
100100
".tox",
101101
".eggs",
102-
# TODO: fix .pyi files
103-
"*.pyi",
104102
# TODO: fix .ipynb files
105103
"*.ipynb"
106104
]
@@ -173,6 +171,7 @@ external = [
173171
convention = "numpy"
174172

175173
[tool.ruff.lint.per-file-ignores]
174+
"*.pyi" = ["E501"]
176175
"doc/conf.py" = ["E402"]
177176
"galleries/examples/animation/frame_grabbing_sgskip.py" = ["E402"]
178177
"galleries/examples/images_contours_and_fields/tricontour_demo.py" = ["E201"]

0 commit comments

Comments
 (0)
0