From eb42d8637ba5891aa806fa6b0ed73835c16b2741 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 28 Sep 2025 14:08:57 +0100 Subject: [PATCH] Backport PR #30612: MNT: update black pin --- environment.yml | 2 +- lib/matplotlib/pyplot.py | 30 ++++++++++++++--------------- lib/matplotlib/tests/test_pyplot.py | 2 +- requirements/testing/all.txt | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/environment.yml b/environment.yml index d95cab0509ff..bea37db1e10f 100644 --- a/environment.yml +++ b/environment.yml @@ -51,7 +51,7 @@ dependencies: - sphinxcontrib-video>=0.2.1 - pikepdf # testing - - black<24 + - black<26 - coverage - flake8>=3.8,<7.2 - flake8-docstrings>=1.4.0 diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 2dd8e76d98b4..9cca3b0370a6 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -3145,8 +3145,9 @@ def cohere( NFFT: int = 256, Fs: float = 2, Fc: int = 0, - detrend: Literal["none", "mean", "linear"] - | Callable[[ArrayLike], ArrayLike] = mlab.detrend_none, + detrend: ( + Literal["none", "mean", "linear"] | Callable[[ArrayLike], ArrayLike] + ) = mlab.detrend_none, window: Callable[[ArrayLike], ArrayLike] | ArrayLike = mlab.window_hanning, noverlap: int = 0, pad_to: int | None = None, @@ -3203,9 +3204,9 @@ def csd( NFFT: int | None = None, Fs: float | None = None, Fc: int | None = None, - detrend: Literal["none", "mean", "linear"] - | Callable[[ArrayLike], ArrayLike] - | None = None, + detrend: ( + Literal["none", "mean", "linear"] | Callable[[ArrayLike], ArrayLike] | None + ) = None, window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None, noverlap: int | None = None, pad_to: int | None = None, @@ -3876,9 +3877,9 @@ def psd( NFFT: int | None = None, Fs: float | None = None, Fc: int | None = None, - detrend: Literal["none", "mean", "linear"] - | Callable[[ArrayLike], ArrayLike] - | None = None, + detrend: ( + Literal["none", "mean", "linear"] | Callable[[ArrayLike], ArrayLike] | None + ) = None, window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None, noverlap: int | None = None, pad_to: int | None = None, @@ -3986,9 +3987,9 @@ def specgram( NFFT: int | None = None, Fs: float | None = None, Fc: int | None = None, - detrend: Literal["none", "mean", "linear"] - | Callable[[ArrayLike], ArrayLike] - | None = None, + detrend: ( + Literal["none", "mean", "linear"] | Callable[[ArrayLike], ArrayLike] | None + ) = None, window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None, noverlap: int | None = None, cmap: str | Colormap | None = None, @@ -4299,10 +4300,9 @@ def violinplot( showmedians: bool = False, quantiles: Sequence[float | Sequence[float]] | None = None, points: int = 100, - bw_method: Literal["scott", "silverman"] - | float - | Callable[[GaussianKDE], float] - | None = None, + bw_method: ( + Literal["scott", "silverman"] | float | Callable[[GaussianKDE], float] | None + ) = None, side: Literal["both", "low", "high"] = "both", *, data=None, diff --git a/lib/matplotlib/tests/test_pyplot.py b/lib/matplotlib/tests/test_pyplot.py index 1aaa8dd93ca2..46bd6e456d32 100644 --- a/lib/matplotlib/tests/test_pyplot.py +++ b/lib/matplotlib/tests/test_pyplot.py @@ -12,7 +12,7 @@ def test_pyplot_up_to_date(tmp_path): - pytest.importorskip("black") + pytest.importorskip("black", minversion="24.1") gen_script = Path(mpl.__file__).parents[2] / "tools/boilerplate.py" if not gen_script.exists(): diff --git a/requirements/testing/all.txt b/requirements/testing/all.txt index a41073bdf47e..dd1dbf3f29fd 100644 --- a/requirements/testing/all.txt +++ b/requirements/testing/all.txt @@ -1,6 +1,6 @@ # pip requirements for all the CI builds -black<24 +black<26 certifi coverage!=6.3 psutil