Skip to content

Commit 269a09e

Browse files
author
Samuel Thurston
committed
MNT: make matplotlib an optional dependency
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)
1 parent 489b87c commit 269a09e

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

ci/extra_requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
matplotlib==3.10.0
12
cartopy==0.24.0
23
dask==2025.1.0
34
shapely==2.0.7

ci/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
matplotlib==3.10.0
21
numpy==2.2.2
32
pandas==2.2.3
43
pooch==1.8.2

docs/userguide/installguide.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ years. For Python itself, that generally means supporting the last two minor rel
1010
currently supports Python >= 3.10.
1111

1212
.. literalinclude:: ../../pyproject.toml
13-
:start-at: matplotlib
13+
:start-at: numpy
1414
:end-at: xarray
1515

1616
------------
@@ -37,6 +37,11 @@ the base of the source directory, run:
3737
3838
This will build and install MetPy into your current Python installation.
3939

40+
To include the plotting features run:
41+
42+
.. parsed-literal::
43+
pip install .[plot]
44+
4045
------------------
4146
Working With Conda
4247
------------------

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ classifiers = [
2626
]
2727
requires-python = ">=3.10"
2828
dependencies = [
29-
"matplotlib>=3.5.0",
3029
"numpy>=1.22.0",
3130
"pandas>=1.4.0",
3231
"pint>=0.17",
@@ -63,7 +62,11 @@ test = [
6362
extras = [
6463
"cartopy>=0.21.0",
6564
"dask>=2020.12.0",
66-
"shapely>=1.6.4"
65+
"shapely>=1.6.4",
66+
"metpy[plot]"
67+
]
68+
plot = [
69+
"matplotlib>=3.5.0"
6770
]
6871

6972
[project.urls]

0 commit comments

Comments
 (0)