Skip to content

Fix default backend#19854

Closed
tacaswell wants to merge 2 commits into
matplotlib:masterfrom
tacaswell:fix_default_backend
Closed

Fix default backend#19854
tacaswell wants to merge 2 commits into
matplotlib:masterfrom
tacaswell:fix_default_backend

Conversation

@tacaswell

Copy link
Copy Markdown
Member

PR Summary

  • makes the source installed and real-install matplotlibrc identical
  • be forgiving of empty backend value and treat the same as no backend entry.

PR Checklist

  • Has pytest style unit tests (and pytest passes). (this is an import bug)
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).

There is logic in setup.py to either set the value to a build-time
config (so packagers can be opinionated about the default) or empty
to get the fallback default.

When working on a source-install this logic is not run.
See comment in code.  Accounts for the fact that we can to directly specify the
"fallback" backend value.  This interprets the lack of a backend entry and an
empty backend entry the same.

closes matplotlib#19848
@anntzer

anntzer commented Apr 2, 2021

Copy link
Copy Markdown
Contributor

Actually I had a different fix coming in soon.
The problem of the current approach (not this PR, just the current status) is that the ability of third-party packagers to put in a different default backend (via setup.cfg) has been lost, because we always default to auto_backend_sentinel, rather than respecting the entry in mpl-data/matplotlibrc if the packager set it. I'm not actually convinced that packagers need to be able to set a different default backend (again, I'd rather "matplotlib" to always mean the same thing, not customized versions), but some may care...

@ianhi

ianhi commented Apr 2, 2021

Copy link
Copy Markdown
Contributor

Happened to be online so giving it a go here: mpl-extensions/mpl-interactions#178 as a real world test

In particular this run: https://github.com/ianhi/mpl-interactions/pull/178/checks?check_run_id=2256624853

so this definitely fixes the pytest-mpl error.

@anntzer anntzer mentioned this pull request Apr 2, 2021
7 tasks
@tacaswell tacaswell modified the milestones: v3.5.0, unassigned Apr 2, 2021
@tacaswell tacaswell closed this Apr 2, 2021
@tacaswell tacaswell deleted the fix_default_backend branch April 2, 2021 22:35
@tacaswell

Copy link
Copy Markdown
Member Author

Closing in favor of #19855

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.

3 participants