Skip to content

Remove matplotlibrc.template. #19603

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

Merged
merged 1 commit into from
Mar 31, 2021
Merged

Remove matplotlibrc.template. #19603

merged 1 commit into from
Mar 31, 2021

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 28, 2021

PR Summary

See #19588, #19602.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@anntzer anntzer added the Build label Feb 28, 2021
@anntzer anntzer mentioned this pull request Feb 28, 2021
7 tasks
@jklymak
Copy link
Member

jklymak commented Feb 28, 2021

We can close #19602 if simpler, though suggest stealing some of the commentary. Also suggest the softlink so no one complains...

@jklymak
Copy link
Member

jklymak commented Feb 28, 2021

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 from lib/matplotlib/mpl-data/matplotlibrc. lib/matplotlib/mpl-data/matplotlibrc doesn't exist in the repo, and only gets created when setup.py is called. We can't read the defaults from matplotlbrc.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 their lib/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, (maybe softlink it to matplotlib.template). setup.py can change lib/matplotlib/mpl-data/matplotlibrc in-place

See also:

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me, though I do not fully grok the setup.py changes.

@anntzer anntzer force-pushed the mrc branch 2 times, most recently from d572ccd to 058b683 Compare March 24, 2021 10:52
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modulo making sure it is a no-op in the default case.

@anntzer
Copy link
Contributor Author

anntzer commented Mar 27, 2021

added a test checking the default backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants