FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prepare to turn matplotlib.style into a plain module. by anntzer · Pull Request #30163 · matplotlib/matplotlib · GitHub

Repository navigation

Prepare to turn matplotlib.style into a plain module. - #30163

Merged
jkseppan merged 1 commit into
matplotlib:mainfrom
anntzer:ms
Jun 24, 2025
Merged

jkseppan merged 1 commit into
matplotlib:mainfrom
anntzer:ms

Conversation

anntzer commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

Having matplotlib.style be a package with the entire implementation in matplotlib.style.core is a bit overkill, and also makes it slightly awkward that USER_LIBRARY_PATHS is effectively a public API (clearly intended as so, per the comment, even though we may do it differently nowadays...) but only available in matplotlib.style.core, whereas everything else is re-exported by matplotlib.style.

Prepare to flatten the implementation by deprecating matplotlib.style.core and reexporting USER_LIBRARY_PATHS in matplotlib.style. Once the deprecation elapses, we'll be able to move the implementation into a plain matplotlib/style.py module.

PR summary

PR checklist

anntzer force-pushed the ms branch 3 times, most recently from 6dbfc13 to 9d16b89 Compare June 11, 2025 18:49
tacaswell added this to the v3.11.0 milestone Jun 12, 2025

anntzer commented Jun 12, 2025

Copy link
Copy Markdown
Contributor Author

mypy seems unhappy

lib/matplotlib/style/__init__.py:241: error: Need type annotation for "library" (hint: "library: dict[<type>, <type>] = ...")  [var-annotated]
lib/matplotlib/style/__init__.py:242: error: Need type annotation for "available" (hint: "available: list[<type>] = ...")  [var-annotated]

even though these are clearly listed in __init__.pyi, do you know why/how to fix this?

Copy link
Copy Markdown
Member

I suspect it is the issue is that it is missing from the meson.build.

anntzer commented Jun 13, 2025

Copy link
Copy Markdown
Contributor Author

Ah, thanks for pointing it out. Dropping style/meson.build is probably another good reason for the change :)

Having matplotlib.style be a package with the entire implementation in
matplotlib.style.core is a bit overkill, and also makes it slightly
awkward that USER_LIBRARY_PATHS is effectively a public API (clearly
intended as so, per the comment, even though we may do it differently
nowadays...) but only available in matplotlib.style.core, whereas
everything else is re-exported by matplotlib.style.

Prepare to flatten the implementation by deprecating
matplotlib.style.core and reexporting USER_LIBRARY_PATHS in
matplotlib.style.  Once the deprecation elapses, we'll be able to
move the implementation into a plain matplotlib/style.py module.
jkseppan merged commit 68c67c9 into matplotlib:main Jun 24, 2025
anntzer deleted the ms branch June 24, 2025 15:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL