Skip to content
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

Python Framework build for macOS? #58

Open
justvanrossum opened this issue Jan 24, 2020 · 7 comments
Open

Python Framework build for macOS? #58

justvanrossum opened this issue Jan 24, 2020 · 7 comments
Labels
enhancement New feature or request needs eyes

Comments

@justvanrossum
Copy link

justvanrossum commented Jan 24, 2020

Sorry, I am not 100% sure this is the correct place for my question/issue.

The Python build offered by setup-python on macOS is not a so-called "Framework build". This prohibits certain usages, such as building native Mac applications with Python.

I can use the supplied Python (3.7 in my case) to run my test suite, but to build my application, I will either have to resort to homebrew (ugh) or download an installer from python.org, which, while slightly less ugh will make my build time a lot longer, unnecessarily increasing my resource usage.

Here is some useful info: https://stackoverflow.com/questions/1444543/differences-between-framework-and-non-framework-builds-of-python-on-mac-os-x

Is there a chance GitHub actions could provide a Framework build of Python in the future?

@konradpabjan
Copy link
Collaborator

Perhaps system python might be able to work? https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#using-the-default-python-version

You would not use the setup-python action and instead python would default to whatever is on the system.

@justvanrossum
Copy link
Author

The system Python on macOS is the hopelessly obsolete Python 2.7, so unfortunately that is not an option.

@konradpabjan
Copy link
Collaborator

Python 2.7 has reach EOL so it will be interesting to see what Apple does with system Python. Rather unfortunate that it's not an option.

Is there a chance GitHub actions could provide a Framework build of Python in the future?

An extra version of Python would have to be added to our Mac images (we're also evaluating options that wouldn't require updates to our hosted images). When adding something to our hosted images, we consider these guidelines: https://github.com/actions/virtual-environments#software-guidelines

Extra options are always a good thing for developers and this could definitely be useful.

@konradpabjan konradpabjan added the enhancement New feature or request label Mar 6, 2020
@justvanrossum
Copy link
Author

On the other hand I would argue that you could replace the current Python with a framework build, as that's the norm on macOS.

Both python.org and homebrew's Pythons are framework builds, and are good for everything. The one on github actions is the odd one out, and not is usable for some applications.

@slokhorst
Copy link

Python 2.7 has reach EOL so it will be interesting to see what Apple does with system Python.

Apple will completely remove Python in a future macOS release. From macOS Catalina 10.15 Release Notes

Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app. (49764202)

@rtibbles
Copy link

Flagging that I think this would be even more useful now, since MacOS 14 has become the macos-latest runner image. I have observed in builds for my Mac app that our previous method of installing the framework build by downloading from python.org now seems to fail to supplant the built in Python version, which then triggers all sorts of issues with global python installs, that I've been unable to workaround.

@justvanrossum
Copy link
Author

I just had to work around this yesterday: I managed to make it work by using the full path into the Python framework:

https://github.com/googlefonts/fontra-pak/blob/4334132e2a6e22150fed2bff33809c255b307991/.github/workflows/python-app.yml#L34-L49

Ugly but effective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs eyes
Projects
None yet
Development

No branches or pull requests

5 participants