Skip to content

FIX: put newline in matplotlibrc when setting default backend #21662

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
Nov 19, 2021

Conversation

tacaswell
Copy link
Member

Closes #21660

PR Summary

We are missing a new line when formatting the matplotlibrc

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

@tacaswell tacaswell added this to the v3.5.1 milestone Nov 18, 2021
@@ -225,6 +225,13 @@ jobs:
fi
fi

cat <<EOT >> mplsetup.cfg
[rc_options]
##backend=Agg
Copy link
Member

Choose a reason for hiding this comment

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

Does this do anything with the double comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

The goal was to not change the resultant matplotlibrc file from what it would be without this configuration. Without the bug fix this would have put the webagg.port on the same line so it would be missing and any import would fail..

Copy link
Member

Choose a reason for hiding this comment

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

But the substitution doesn't care that this is double commented, it only inserts the value from here with a fixed key. And since this file is parsed by ConfigParser, it's not going to see this line at all, anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦🏻 🐑 I understand now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Third times the charm?

Copy link
Contributor

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

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

Can confirm that this fixes #21660, thanks @tacaswell!

@QuLogic QuLogic merged commit 75a8ec5 into matplotlib:main Nov 19, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 19, 2021
QuLogic added a commit that referenced this pull request Nov 19, 2021
…662-on-v3.5.x

Backport PR #21662 on branch v3.5.x (FIX: put newline in matplotlibrc when setting default backend)
@tacaswell tacaswell deleted the fix_rc_option branch November 20, 2021 23:26
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.

[Bug]: mplsetup.cfg parsing issue
4 participants