Commit 404ff5d
committed
Deprecate the MATPLOTLIBDATA environment variable.
The MATPLOTLIBDATA environment variable is only relevant to non-standard
installs (e.g., debian) that move the mpl-data directory to a separate
location (in debian's case, /usr/share/matplotlib/mpl-data); but for
whoever is already patching Matplotlib to achieve this, they may as well
also patch `get_data_path` to always return the new correct path (which
debian already does in their `20_matplotlibrc_path_search_fix.patch`),
reproduced here:
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 9339707..563b0a8 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -738,10 +738,12 @@ def _get_data_path():
return path
_file = _decode_filesystem_path(__file__)
- path = os.sep.join([os.path.dirname(_file), 'mpl-data'])
+ path = '/usr/share/matplotlib/mpl-data'
if os.path.isdir(path):
return path
+ raise RuntimeError('Could not find the matplotlib data files')
+
# setuptools' namespace_packages may highjack this init file
# so need to try something known to be in matplotlib, not basemap
import matplotlib.afm
@@ -836,7 +838,7 @@ def matplotlib_fname():
yield matplotlibrc
yield os.path.join(matplotlibrc, 'matplotlibrc')
yield os.path.join(_get_configdir(), 'matplotlibrc')
- yield os.path.join(get_data_path(), 'matplotlibrc')
+ yield '/etc/matplotlibrc'
for fname in gen_candidates():
if os.path.exists(fname):1 parent 4754b58 commit 404ff5d
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| 655 | + | |
| 656 | + | |
655 | 657 | | |
656 | 658 | | |
657 | 659 | | |
| |||
0 commit comments