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
andpkg_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()
andgetusersitepackages()
to py2app’s version ofsite.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.