Apps rejected by macOS App Store due to "use of non-public or deprecated APIs" #2131
Labels
bug
A crash or error in behavior.
documentation
An improvement required in the project's documentation.
macOS
The issue relates to Apple macOS support.
Describe the bug
If you use Briefcase package an app for distribution in the macOS App Store, the app will be rejected with the following message:
Steps to reproduce
Expected behavior
It should be possible to distribute a macOS app in the App Store.
Screenshots
No response
Environment
Logs
No response
Additional context
This is caused by a known issue with Tk.
It has been reported to Python (see python/cpython#129247) - however, there's nothing Python can do to fix this issue.
If your app uses Tkinter, you are unfortunately out of luck. With the current state of Tk, it is not possible to distribute a Tk app in the macOS App Store. You will need to use other distribution mechanisms.
However, if your app does not use Tkinter, you can use the Briefcase
cleanup_paths
option to purge the Tkinter libraries as part of the app packaging process. If you add the following to your the macOS section of your pyproject.toml:the tk binaries will be deleted, which should allow your app to be released. This has the added benefit of reducing the size of your app binary.
At the very least, this issue should be documented as a macOS platform quirk (with the fix described above).
It may also be worth formalizing this fix by providing customizable options for what parts of the standard library are installed. Tkinter is only needed by apps that actually use tkinter; for all other apps, it's dead weight in the app bundle. The same goes for curses, maybe sqlite and openssl, and some parts of the non-binary standard library (e.g., the
test
module is almost 31MB, but most apps won't need any of it). Having an analog of "extras" (i.epip install foo[extra1,extra2]
), but for the Python standard library, would provide a way to formalize what is removed.Ideally, this "extras" philosophy would be pushed completely upstream, so that there's a "minimal" standard library, and tkinter is a binary wheel on PyPI... but that's a much bigger argument to be had.
The text was updated successfully, but these errors were encountered: