-
Notifications
You must be signed in to change notification settings - Fork 642
Use the system-configured version of Python 3 when building #2798
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
Conversation
Release Notes PreviewFixed
Added
Other: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: pr-fix, pr-change, pr-feature, pr-maintenance
This comment has been minimized.
This comment has been minimized.
|
I certainly understand the motivation behind this change, but it's a bit more subtle than just changing those two files - we call Python/pip in various places throughout build/docbuild/test/CI and if we were to change away from the system Python, we'd need to verify that all of those sites are consistent, and that there are no surprises from Homebrew/other Pythons being installed/upgraded over time. Personally I would prefer to stick with the default system Python 3 - I recognise that it limits the versions of macOS that can be used to build Hammerspoon, but I suspect that making everything work reliably with whatever Python happens to be first in $PATH at any given moment, is going to be harder than it looks. |
|
Thanks for the explanation, it makes sense to use the known-good On my system (macOS Mojave) I don't have a When building, this is the output I saw: The Would an Feel free to close this out if you think it's fine the way it is - it's really not that bad to work around it. |
|
I just had a read of the
That will override It's not perfect, there are still some pip related ways things could go wrong, but it won't affect CI or my release builds, so I'd be happy to merge a change like that. |
|
I just tried this and unfortunately it doesn't seem to work. It looks like environment variables can't be expanded in the shebang line. |
|
hmm, yeah. |
This fixes a build issue on systems where `/usr/bin/python3` doesn't exist. It allows falling back to the first `python3` executable in the current `PATH`.
|
Huh, I've never seen that before but it seems to work. I've updated the PR to use this method, as well as mention that Python 3 needs to be installed in |
Codecov Report
@@ Coverage Diff @@
## master #2798 +/- ##
==========================================
- Coverage 27.24% 27.23% -0.02%
==========================================
Files 179 179
Lines 36063 36063
==========================================
- Hits 9826 9822 -4
- Misses 26237 26241 +4 |
This comment has been minimized.
This comment has been minimized.
|
Thanks for following up on this! |
This fixes a build issue on systems where Python isn't installed as
/usr/bin/python3