-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove additional detection of .egg
packages when using the importlib.metadata
backend
#12330
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
Comments
- removed old and unused directories - added the new project manager according to [PEP621](https://peps.python.org/pep-0621/), (pypa/pip#12330)
@hanivianka have you tried the recommended action mentioned in the top post of this page? |
@sbidoul has pip 24.3 been released? im tired of seeing the bright message pop up on an otherwise dark screen |
@tahayparker 24.3 is planned for October 2024. It is important that affected users resolve the warning by applying the recommendation in the first post of this page. |
The problem is based on PIP updating. update to 23.3.2, rebuild the build. first, delete the build and the dist plus the .egg.info folder. build build:
then, the twine:
view document here: Packaging Python Projects |
@sbidoul did you ever take a look at #12330 (comment)? Not sure what's going on with |
@ichard26 I could indeed reproduce by downloading a wheel, changing it's extension to .zip, and adding the zip file full path to sys.path. At the same time I had a closer look at this egg discovery mechanism, and discovered something interesting. It looks like this additional .egg discovery mechanism we have was intended for situations where .egg files are found in directories that are in sys.path. But the regular setup.py install does add the egg files themselves to sys.path, so in that case our discovery mechanism is redundant. But if I use the At this point I'm not sure what to do... Maybe we should just enact this deprecation in 25.1 as we announced. |
An additional interesting bit concerns uninstallation. When a zip file is in sys.path, pip list shows it, but pip uninstall can't uninstall it, which makes sense. Update: it depends whether the setup.py was marked zip_safe or not. But for egg files discovered with our deprecated extended egg discovery mechanism, pip can uninstall them, but leaves the corresponding entry in |
I don’t understand the details of the problem, but from my end it looks like I have a legit zip on sys.path, and this deprecation means I won’t be able to use pip for the purpose I need it to, due to this false positive in the egg detection. |
@justvanrossum I agree it is a problem we need to address. Would it be possible for you to run |
Yes: every package inside the zip is indeed listed twice. |
Since the deprecation message is showing false positives, and apparently reveals a problem with this additional eggs discovery code path, I'll move forward and remove it in 25.1 as announced. |
.egg
packages when using the importlib.metadata
backend.egg
packages when using the importlib.metadata
backend
@justvanrossum thanks a lot for reporting. You will not see the warning anymore in 25.1, and duplicates in pip list will be resolved. If you wish, you can test #12308. |
Hm, I still see the warning when I install from that PR's branch. Assuming the following is correct to achieve that:
|
That is weird. Because if we trust the diff displayed by GitHub for that PR, the code that emits that warning is gone. |
Somehow installing pip directly from that fork's branch didn't quite work (I tried several times). However, if I clone the fork locally, and switch to the rm-find-eggs branch, and install pip from that local copy, I can confirm that the warning is gone. Thank you very much! |
pip has dropped support for installing
.egg
-based packages when it stopped invokingsetup.py install
.At some point pip will abandon support for detecting and uninstalling legacy
.egg
-based packages too.If you reach this issue from the pip deprecation message, it is likely that your Python environment has packages that have been installed with
setup.py install
,easy_install
, or an older pip version.The recommended action is to uninstall the package and reinstall it with a recent pip.
The text was updated successfully, but these errors were encountered: