BLD: Ensure meson.build has the right version of Python#29997
BLD: Ensure meson.build has the right version of Python#29997timhoffm merged 1 commit intomatplotlib:mainfrom
Conversation
If `python3` is in the path, it might be picked up instead of the one used to build. This is the case on GitHub actions, where cibuildwheel seems to explicitly call the Python (3.11+) it wants, but `python3` is in the hosted tool cache as an older version (3.9) that gets picked by Meson. This matters because we need to run `setuptools_scm` to produce the version, and it may not be installed in the `PATH`-based copy. By specifying the version, Meson should skip the `PATH` option, and choose its final fallback, the interpreter that it is itself running on. While still not guaranteed to be correct everywhere, this should at least work for CI.
|
As an addendum, it seems like the fallback I was hoping for didn't work (possibly a bug in Meson to fix?) However, adding |
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…ersion of Python (cherry picked from commit 440eb61)
|
Conflict was expected due to the differing Python requirements; backport is #29999. |
PR summary
If
python3is in the path, it might be picked up instead of the one used to build. This is the case on GitHub actions, where cibuildwheel seems to explicitly call the Python (3.11+) it wants, butpython3is in the hosted tool cache as an older version (3.9) that gets picked by Meson. This matters because we need to runsetuptools_scmto produce the version, and it may not be installed in thePATH-based copy.By specifying the version, Meson should skip the
PATHoption, and choose its final fallback, the interpreter that it is itself running on. While still not guaranteed to be correct everywhere, this should at least work for CI.PR checklist