MNT: move matplotlibrc.template to mpl-data #19602
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Alternative to #19588, closes #19578
This simply makes
lib/matplotlib/mpl-data/matplotlibrc
the file under source control and soft-links back tomatplotlibrc.template
.setup.py
now modifies the file in place if the backend needs to be edited.More detail:
Previously
matplotlibrc.template
was changed in #15029 to be the canonical place to get the defaults for all the rcParams. However, these were read during__init__.py
fromlib/matplotlib/mpl-data/matplotlibrc
.lib/matplotlib/mpl-data/matplotlibrc
doesn't exist in the repo, and only gets created whensetup.py
is called. We can't read the defaults frommatplotlbrc.template
because that file probably doesn't exist in most user installs.Aside from being somewhat rickety, the problem is that developers working from an editable install don't want to always call
setup.py
as it requires compiling the C extensions, and hence theirlib/matplotlib/mpl-data/matplotlibrc
can get out of sync with the library.The solution here is to simply make
lib/matplotlib/mpl-data/matplotlibrc
the canonical source of the defaults, add it to version control, and softlink it tomatplotlib.template
.setup.py
can changelib/matplotlib/mpl-data/matplotlibrc
in-place (I think)See also:
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).