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

App bundling strategy incompatible with future pip? #521

Open justvanrossum opened 6 months ago

justvanrossum commented 6 months ago

We're running into a deprecation warning while using pip together with an app built with py2app.

We have a small UI on top of pip that allows the user to install additional packages in a folder inside the Application Support folder for the app. That folder is appended to sys.path when the app starts.

This works wonderfully, but with recent pips we get a deprecation warning, that will escalate to an error with pip 24

DEPRECATION: Loading egg at /Users/just/code/git/drawbot/dist/DrawBot.app/Contents/Resources/lib/python312.zip is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330

We don't full understand what is causing this. Is python312.zip technically an egg? Do you happen to be able to make more sense of this warning, and what we could possibly do about it?

Cc @typemytype

ronaldoussoren commented 3 months ago

One thing to try is to add 'pip' to the packages option to ensure that is bundled outside of the zip file, although I don't know if this will fix the problem for you.

I've asked the pip project what might trigger this warning as the zip file that py2app creates is not an egg.

justvanrossum commented 3 months ago

I'm not sure it's the bundling of pip itself that is causing the problem (although I will try your suggestion), but rather that pip sees the .zip, and decides it can't resolve dependencies agains things that are in the .zip.

justvanrossum commented 3 months ago

Oh, pip is already included in py2app's packages, so it itself is not in the .zip.