Python Framework build for macOS?
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?
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.
The system Python on macOS is the hopelessly obsolete Python 2.7, so unfortunately that is not an option.
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.
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.
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)
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.
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.