From ronaldoussoren at mac.com Sun Sep 19 05:38:08 2021 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 19 Sep 2021 11:38:08 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.26 Message-ID: I've spend some more time on py2app over the last week or so, in between relaxing while being away from work. That results in a larger release for py2app than I've done in a long while. The most important changes are support for Python 3.10 and (finally!) bundling package metadata ("dist-info" directories). The latter should fix issues with code that uses pkg_resources and looks for distribution information such as entry points. As always: Py2app is supposed to be a "DWIM" tool, please file issues when you need to adjust the bundled application, either through py2app options or (especially) manually. And a public service announcement: Don't use the "argv_emulator" option with GUI applications. That option tends to cause options with GUI eventloops, and most GUI libraries have better options to handle "file-open" events. I expect to work less on py2app in the coming weeks, the current plan is to continue working on PyObjC during my last week of from work. The current repository is up-to-date w.r.t. support for the upcoming macOS Monterey, and I hope to land land some interesting other improvements during the week... The full changelog: Stub executables were recompiled on macOS 11 This means support for light mode/dark mode should now work out of the box. The old stub executables are still used when detecting that Tkinter is used with an old build of Tk. Issue 1: Include ".egg-info" and ".dist-info" information in the bundled application This fixes any python package that uses pkg_resources to look for specific distributions. py2app.filters.not_stdlib_filter now knows about Python's "venv" Issue 368: Add recipe detect_dunder_file This recipe will ensure that a Python package is stored outside of site-packages.zip when a module in that package uses the __file__ variable. This variable is most commonly used to load resources stored in the package (instead of the newer importlib.resources and pkg_resources libraries). Issue 339: Add recipe for pydantic The recipe is needed because pydantic uses Cython to compile all sources (including the package __init__) and therefore hides imports from the dependency analyzer. Issue 338: Add "imageio_ffmpeg" to autopackages PR367: Add recipes for pandas, pylsp, and zmq PR367: Add docutils and pylint to autopackages PR by Ryan Clary (mrclary on GitHub) Issue 344: Invocation of codesign on the whole bundle sometimes fails Py2app will now try this a number of times before giving up. This is at best a workaround for and doesn't completely fix the problem. Issue 370: py2app now works with Python 3.10 Python 3.10 no longer exports a (private) symbol used by the py2app stub executable. Switched to a public API to accomplish the same task where available. Issue 110: Add recipe for SQLAlchemy The recipe includes all dialects and connectors, including implicit dependencies, because SQLAlchemy uses __import__ to load dependencies. Issue 328: Add recipe for gcloud Issue 195: Add USER_BASE, getuserbase() and getusersitepackages() to py2app's version of site.py. Issue 184: Add recipe for 'ssl' This recipe is only used for Python 3.4 or later and ensures that the CA bundle used by Python's ssl module is included in the app bundle and OpenSSL is configured to look for that bundle in the application bundle. Issue 371: change default error message on launch problems The default error message shown when the application cannot be launched is now slightly more useful and refers the py2app debug page . Issue 345, 169: Adjust qt5 and qt6 recipes for non-PyPI installations The qt5 and qt6 recipes now should work when the Qt installation prefix is outside of the PyQt package, for example when PyQt was installed through homebrew. I've tested this for PyQt5 and made the same change to the PyQt6 recipe, although I haven't tested that change. ? Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From macytdl at gmail.com Tue Sep 28 01:12:00 2021 From: macytdl at gmail.com (Vincentius Vincentius) Date: Tue, 28 Sep 2021 15:12:00 +1000 Subject: [Pythonmac-SIG] How to include or install a Python runtime in an AppleScript applet Message-ID: <189E9197-1769-47CD-9364-3F0E409CFC3C@gmail.com> Hello, I am not a Python developer. So, please forgive the intrusion. I have developed an AppleScript applet which provides a GUI ?frontend? for a Python script provided by another developer. The applet runs on any version of macOS from OSX 10.10 up. The Python script is very functional but only works from Terminal and invoking it correctly it is complex especially for users not familiar with Terminal. My applet simplifies all that so Mac users can more easily access the functionality of the Python script. As you will guess, the applet currently works because Apple for many years have included Python2.7 in macOS. But, recently, development of the Python script has ceased and I have to move to another Python script (forked from the original) which is actively developed. My problem is that the new Python script requires Python3 which is not in macOS. So, I need to find a way of providing a Python runtime to users of my applet. Can anyone help me with advice on how to create and distribute a Python runtime (with my applet) ? The shebang in the script has this: #! usr/bin/env Python3. I guess that means the script will call the Python3 stub located in /usr/bin/. But, that will invoke the Xcode Command Line tools download which most of my users will not want. How do I redirect that call to a Python3 runtime ? As the wider Mac developer and user community learn that they need Python3, there will be a growing need for simple Python3 runtimes. But, the macOS distribution currently available includes the IDE and other development tools which, again, most of my users will not want. Would it possible to prepare a runtime installer suitable for users who wish to run Python apps and scripts ? Thanks. Garry macytdl at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: