New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] setuptools auto discovery in 61.0 breaks py2app #3248
Comments
Hi @ronaldoussoren, sorry to hear that you are facing problems with the auto-discovery. Currently, you can disable auto-discovery by implementing a If you already have |
I think I can also add a environment variable to disable auto-discovery if that helps. There are some aspects of the auto-discovery that are triggered before the command is called, so I don't think it is possible right now to have a per-command mechanism to disable it. |
finalize_distribution_options might work for me, but I'd have to be very careful because that entry-point will be called in every call to AFAIK distutils.setup_keywords won't work, because those extensions are only called if the named option is present in the call to setup(). |
@ronaldoussoren, if I understood the docs correctly, the If that is the case, Similarly, if you have a |
Looking for the app and plugin attributes works for me. I've added a setuptools.finalize_distribution_options entry point to py2app and that fixes the issue for me. |
Thank you very much @ronaldoussoren . |
One problem with having a finalize_distribution_options entry point is that this makes it harder to build sdists and wheels, I had to install the Not a big problem, but worth noting. Thanks for your help! |
I don't now if I understand correctly, but for wheels and sdists specifically can you rely on Or is it a bootstrapping issue? Using |
I don not yet use pyproject.toml in py2app, partially because the current release still minimally supports Python 2.7. That will change after the upcoming release. |
setuptools version
setuptools == 61.0
Python version
Python 3.10
OS
macOS
Additional environment information
This only happens when using
py2app
(https://pypi.org/project/py2app).Description
py2app is a setuptools plugin command that basically uses distutils as a command runner with a similar interface as py2exe.
In general the
setup()
call for py2app does not contain arguments specifying the distribution name or modules/packages, the files acted upon are specified in py2app-specific arguments. The distribution name is optimally used as the name of the generated application, and by default calculates the name from the name of main script in the application.With setuptools 61.0 release I see two common failures:
setup.py
contains multiple python files, due to the auto discovery assuming the directory contains a flat layout which shouldn't contains multiple toplevel names:Expected behavior
Both behaviours are new and break py2app.
Please add an easy way to disable this feature, preferably a way in which a setuptools plugin command can disable auto discovery when it is used.
How to Reproduce
This results in a working application bundle with setuptools 60.0, and breaks with the error below when using setuptools 61.0.
Output
The text was updated successfully, but these errors were encountered: