Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Don't fail if we can't query system fonts on macOS #28498

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
Jul 2, 2024

Conversation

K900
Copy link
Contributor

@K900 K900 commented Jul 2, 2024

PR summary

The query can fail in some environments where system_profiler is not available on PATH, but we don't want it to just crash the entire thing.

PR checklist

The query can fail in some environments where system_profiler is not
available on PATH, but we don't want it to just crash the entire thing.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@oscargus oscargus added this to the v3.9.1 milestone Jul 2, 2024
@oscargus
Copy link
Member

oscargus commented Jul 2, 2024

Thanks! Seems to make sense to back port.

@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

I'm not really familiar with the process for that, sorry :(

@oscargus
Copy link
Member

oscargus commented Jul 2, 2024

Sure, more of a comment to the next reviewer to see if they agree and clarify that I didn't press the 3.9.1 milestone by accident. :-)

@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

The test failures don't seem related, by the way.

@tacaswell
Copy link
Member

Agree that the test is probably unrelated, but it is in the same general vicinity so re-running just to be sure.

Agree that this should be back-ported.

I suspect that we are going to have a second wave of errors with 3.9.1 that are "my fonts are missing" until we understand why what I thought was a macOS system utility is not always available.

@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

I think you kinda have to explicitly shoot yourself in the foot for this to actually matter, e.g. by unsetting PATH. We encountered it in Nixpkgs, where we generally only allow known package dependencies onto PATH, and then when a package tries to run tests, the executable matplotlib expects isn't there.

@tacaswell
Copy link
Member

#28485 (comment) is also seeing it with conda

@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

Looks like they're using some sort of a similar build orchestrator, maybe?

@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

But yeah I think the most basic repro is just PATH= python -c 'import matplotlib'.

@tacaswell
Copy link
Member

Something like:

MPLCONFIGDIR=/tmp/test PATH= /FULL/PATH/bin/coverage run -m matplotlib.font_manager

is probably what we need to put in CI to make sure we force generating the font cache (rather than loading an existing one). Don't want to hold this PR on it though.

milljm added a commit to milljm/moose that referenced this pull request Jul 2, 2024
Temporarily pin an older matplotlib, until matplotlib/matplotlib#28498
is resolved.

Closes idaholab#28045
@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

I don't think this change really has anything to do with when to generate the font cache? Unless there's already an existing one from the previous test runs?

milljm added a commit to milljm/moose that referenced this pull request Jul 2, 2024
Temporarily pin an older matplotlib, until matplotlib/matplotlib#28498
is resolved.

Closes idaholab#28045
milljm added a commit to milljm/moose that referenced this pull request Jul 2, 2024
Temporarily pin an older matplotlib, until matplotlib/matplotlib#28498
is resolved.

Closes idaholab#28045
@tacaswell
Copy link
Member

The mplconfig setting is just to make sure there is no order dependency on when tests are run. At least on GHA we cache this result to save time time on CI.

I'm going to go ahead and merge this as-is. I'm getting ideas of a bigger overhaul so we can deal with exhaustive testing with that.

@tacaswell tacaswell merged commit 286e53b into matplotlib:main Jul 2, 2024
47 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 2, 2024
@tacaswell
Copy link
Member

Thank you for your work on this @K900 and congratulations on your first merged Matplotlib PR 🎉 . I hope we hear from you again.

@K900
Copy link
Contributor Author

K900 commented Jul 2, 2024

Thanks! I hope not, to be honest - I'm more interested in the distro side of things, so no PRs from me would mean things are working as intended, generally :P

QuLogic added a commit that referenced this pull request Jul 3, 2024
…498-on-v3.9.x

Backport PR #28498 on branch v3.9.x (Don't fail if we can't query system fonts on macOS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants