ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
340 stars 36 forks source link

Build error when including black #518

Open justvanrossum opened 7 months ago

justvanrossum commented 7 months ago

If the black package is included in the app, running python setup.py py2app ends with this error:

Usage: setup.py [OPTIONS] SRC ...
Try 'setup.py -h' for help.

Error: Invalid value for 'SRC ...': Path 'py2app' does not exist.

This happens all the way at the end of the build process, and as far as I can tell, the app actually builds correctly.

This is on macOS 14.2.1 with Python 3.12.1, and black 24.1.0

This could also be a problem with black, in fact the problem does not occur with black 23.10.0. But then again, could it relate to the black recipe?

mrclary commented 6 months ago

Seeing the same issue with spyder-ide/spyder.

I don't know if OP is an issue with the updated black recipe, altgraph 0.16->0.17.3, or macholib 1.16->1.16.2. All these were introduced in py2app 0.28.5.

Our original error under py2app 0.28.4 was

error: [Errno 2] No such file or directory: '/Users/runner/hostedtoolcache/Python/3.9.14/x64/lib/python3.9/site-packages/black-23.12.0.dist-info/top_level.txt'

Our workaround is to manually add some missing files (see this comment).

py2app 0.28.5, I believe, was intended to fix that issue but introduced the issue observed in the OP.