Skip to content
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

meaning of "DEPRECATION: Loading egg at .. is deprecated"? #12297

Closed
1 task done
blsz opened this issue Sep 27, 2023 · 11 comments
Closed
1 task done

meaning of "DEPRECATION: Loading egg at .. is deprecated"? #12297

blsz opened this issue Sep 27, 2023 · 11 comments
Labels
resolution: wrong project Should be reported elsewhere

Comments

@blsz
Copy link

blsz commented Sep 27, 2023

Description

Why is /usr/local/Cellar/gpgme/1.22.0/lib/python3.11/site-packages/gpg-1.22.0-py3.11-macosx-11-x86_64.egg deprecated and is there anything I can do?

Expected behavior

Give a reason for the deprecation?

pip version

23.2.1

Python version

3.11

OS

MacOS 11.7.10

How to Reproduce

  1. Install python with Homebrew on MacOS.
  2. Install gpgme with Homebrew.
  3. Run any pip3 command.

Output

Most pip3 commands include the following warning.

$ pip3 show pip
DEPRECATION: Loading egg at /usr/local/Cellar/gpgme/1.22.0/lib/python3.11/site-packages/gpg-1.22.0-py3.11-macosx-11-x86_64.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
Name: pip
Version: 23.2.1
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig@python.org
License: MIT
Location: /usr/local/lib/python3.11/site-packages
Requires:
Required-by:
$ pip3 --version
pip 23.2.1 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)

/usr/local/bin/pip3 -> ../Cellar/python@3.11/3.11.5/bin/pip3

Code of Conduct

@blsz blsz added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Sep 27, 2023
@uranusjr
Copy link
Member

uranusjr commented Sep 27, 2023

It’s literally that, loading a file in the .egg format is deprecated and the functionality will be removed in the future. You need to talk to the maintainers of the gpg package (or the package gpgme’s Homebrew distributors) to update the package to use a newer format.

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@uranusjr uranusjr added resolution: wrong project Should be reported elsewhere and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Sep 27, 2023
@mara004
Copy link

mara004 commented Oct 8, 2023

Is there any chance of converting an existing .egg to a supported format?
(FWIW, the packages for which I get this warning are python_efl-1.26.0 and JCC-3.13, on python 3.11)

@pfmoore
Copy link
Member

pfmoore commented Oct 8, 2023

Just reinstalling should work. You might need to add the --use-pep517 option. Pip will then install the package in the modern dist-info format instead of the egg format.

@mara004
Copy link

mara004 commented Oct 8, 2023

The thing is, these packages were rather difficult to get build, and IIRC at least one of them was not installable using pip by then. Does this simply mean they are not usable anymore unless upstream projects update to a PEP 517 compatible setup?

@pfmoore
Copy link
Member

pfmoore commented Oct 8, 2023

It might be possible to convert the egg format to dist-info by moving files around, but there's no tool to do this, so you'd be on your own, reading the relevant specs and making manual changes. It's not something I'd recommend, TBH. Maybe the library developers could ship wheels? That would be another solution.

Does this simply mean they are not usable anymore unless upstream projects update to a PEP 517 compatible setup?

If the project simply won't build under --use-pep517, then yes, I'm afraid so. But many projects don't actually need any changes to build under PEP 517 - they can still be hard to build of course, if they have complex build processes, but using PEP 517 may at least not make things worse. However, if the projects do lots of build system customisations, that aren't compatible with the PEP 517 build hooks, then in that case yes, you do need the upstream project to make their build process compatible with PEP 517.

@mara004
Copy link

mara004 commented Oct 9, 2023

Thanks for the informative answer.

However, I imagine already installed egg-based modules would still be importable in python, only pip would not be able to manage (e.g. uninstall) them anymore - is that correct?

BTW, may I ask what is the matter with egg-info? Is it also covered by the deprecation? I noticed with another, supposedly PEP 517 compliant package that an egg-info dir is still generated and automatically included in the sdist.

@pfmoore
Copy link
Member

pfmoore commented Oct 9, 2023

only pip would not be able to manage (e.g. uninstall) them anymore - is that correct?

More or less, yes. But the consequences could be significant - pip won't recognise that the package is installed, so if you try to install something else that depends on it, pip could think it's not present and want to reinstall it. Essentially, "things might break" if you use pip in that environment, and we don't support it so we can't really tell you what to do if that happens.

BTW, may I ask what is the matter with egg-info?

Nothing, as such. It's not standardised data, it's setuptools-specific, so I have no idea whether it should be in a sdist or not.

The significant aspect of .egg directories is that they are a non-standard, setuptools-specific installation method, and pip has until now included special code to read that data, as a transition mechanism to avoid an abrupt change where pip stops recognising a bunch of installed packages. The deprecation is part of the process of removing that special code, and relying solely on standardised metadata (the .dist-info directory) to know what's installed.

Unlike .egginstallations, the .egg-info stuff isn't used directly by pip, so we don't need to care about it or deprecate it. I think it's related to the legacy mechanism setuptools used for editable installs (although I have no clue why it would be in a sdist in that case), but pip doesn't care how backends implement editable installs, so again, we don't need to care about .egg-info.

(Just to be clear here, all of the egg stuff is non-standard, and I'm not 100% sure on the details of how any of it works. So if any of this matters to you, I'd suggest checking the details for yourself - if you can find documentation. I don't know how well the egg stuff is documented these days).

@mara004
Copy link

mara004 commented Oct 10, 2023

Ah yes, the changelog actually tells that .egg-info metadata is not affected, linking setuptools docs:
https://github.com/pypa/pip/blob/main/NEWS.rst#232-2023-07-15

@uranusjr
Copy link
Member

Is there any chance of converting an existing .egg to a supported format?

Hmm, this should be technically possible, especially for simple packages (either pure Python or straightforward extension modules without weird dylib loading). Setuptools has all the logic packaging an egg and egg-info so it should have enough information to convert between the two; pip can deal with that egg-info directly, and even converting (setuptools’s) egg-info to the standard dist-info format is quite straightforward.

This may be too much to include in pip (we’ll need to pull in too much of setuptools), but it may be very worthwhile to propose this to setuptools.

@luckman212
Copy link

Can anyone TL;DR how to fix this deprecation warning? I have the same error as OP.

@sbidoul
Copy link
Member

sbidoul commented Oct 27, 2023

@luckman212 please see #12330

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: wrong project Should be reported elsewhere
Projects
None yet
Development

No branches or pull requests

6 participants