Skip to content

MNT: make matplotlib an optional dependency #3755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

samthurston
Copy link

Applications that make use of the metpy analytical tools without the need for visualization may avoid importing matplotlib due to large import size.

In response to MetPy#2163

Description Of Changes

  • matplotlib removed from base dependencies
  • matplotlib added to "plot" optional group
  • "plot" optional group added to "extras" optional group
  • ci requirements files updated
  • installation guide updated

Checklist

@samthurston samthurston requested a review from a team as a code owner February 11, 2025 15:05
@samthurston samthurston requested review from dcamron and removed request for a team February 11, 2025 15:05
@CLAassistant
Copy link

CLAassistant commented Feb 11, 2025

CLA assistant check
All committers have signed the CLA.

@dopplershift
Copy link
Member

Looks like re-running has fixed the doc errors. One thing to fix up is that the email on the commits doesn't appear to be associated with your GitHub account, which is why the CLA check isn't passing.

Right now, everything is passing because pytest-mpl is a fixed test requirement, which pulls in matplotlib. So for this to go forward we need a few things to be worked out on the test/CI system:

  • Version ranges for testing with matplotlib as an optional dependency
  • Only pulling in pytest-mpl when we need it
  • Marking plotting tests (or perhaps whole test plotting files) to skip when matplotlib isn't available

@samthurston
Copy link
Author

whoops. when you forget to reset the local user.email on your work machine :)

great points. I will take a look at the tests and see what I can do there.

Applications that make use of the metpy analytical tools without
the need for visualization may avoid importing matplotlib due to
large import size.

resolves [MetPy#2163](Unidata#2163)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make matplotlib an optional dependency
3 participants