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
342 stars 36 forks source link

Adapt to import lib changes in Python 3.9 and Later #449

Closed alfwatt closed 2 years ago

alfwatt commented 2 years ago

importlib changed it's symbol packages_distributionsdistributions

glyph commented 2 years ago

@alfwatt Weird. I'm using py2app on python 3.10 I think without problems, and I don't think I've needed this.

glyph commented 2 years ago

Where would I notice the breakage?

ronaldoussoren commented 2 years ago

The current code is using a documented API, see https://docs.python.org/3/library/importlib.metadata.html?highlight=importlib.metadata#package-distributions, the proposal changes that to an API that is not documented.

Furthermore the new function has a different API that the old one.

ronaldoussoren commented 2 years ago

Note that there was a bug in the black recipe, the code iterated over the dict returned by packages_distributions() but assumed that the result was a list of items. Fixed that by calling the item methods (hence the PR now conflicts).

I won't accept this PR unless there is a very good reason for complicating the code by using a new function introduced in 3.9.

alfwatt commented 2 years ago

Issue was fixed in the v0.28.2 by different changes, we can close the PR