diff --git a/ci/mypy-stubtest-allowlist.txt b/ci/mypy-stubtest-allowlist.txt index 1d08a690d8f2..46ec06e0a9f1 100644 --- a/ci/mypy-stubtest-allowlist.txt +++ b/ci/mypy-stubtest-allowlist.txt @@ -1,7 +1,7 @@ # Non-typed (and private) modules/functions matplotlib\.backends\..* matplotlib\.tests(\..*)? -matplotlib\.pylab\..* +matplotlib\.pylab(\..*)? matplotlib\._.* matplotlib\.rcsetup\._listify_validator matplotlib\.rcsetup\._validate_linestyle diff --git a/pyproject.toml b/pyproject.toml index 48a174731440..5451e972de8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -222,7 +222,7 @@ enable_incomplete_feature = [ ] exclude = [ #stubtest - ".*/matplotlib/(sphinxext|backends|testing/jpl_units)", + ".*/matplotlib/(sphinxext|backends|pylab|testing/jpl_units)", #mypy precommit "galleries/", "doc/", @@ -234,7 +234,9 @@ exclude = [ "lib/matplotlib/tests/", # tinypages is used for testing the sphinx ext, # stubtest will import and run, opening a figure if not excluded - ".*/tinypages" + ".*/tinypages", + # pylab's numpy wildcard imports cause re-def failures since numpy 2.2 + "lib/matplotlib/pylab.py", ] files = [ "lib/matplotlib",