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

pip freeze of editable does not point to project location when using src layout #10243

Open
1 task done
sbidoul opened this issue Jul 31, 2021 · 0 comments
Open
1 task done
Labels
C: editable Editable installations type: bug A confirmed bug or unintended behavior

Comments

@sbidoul
Copy link
Member

sbidoul commented Jul 31, 2021

Description

This is something I (re)discovered while working on making pip list and pip freeze support PEP 610 for modern editables.

Assume a setuptools project using the src layout, without VCS, and installed in editable mode.

Running pip freeze will output the parent directory of the .egg-info directory, which is the src directory and not where setup.py is located, making reinstallation from the frozen requirement impossible.

This is fixable in principle because the .egg-link file contains a second line pointing to the setup.py directory.

I'm not sure this is something we will want to fix, but I report it for the record and discussion in case anyone has an any insight on the matter.

Expected behavior

No response

pip version

latest and probably all

Python version

3

OS

any

How to Reproduce

Assuming this setup.py:

from setuptools import setup

setup(
    name="pkga",
    packages=["pkga"],
    package_dir={"": "src"},
)

Run pip install -e ., followed by pip freeze. Notice that the directory produced by pip freeze does not point to the setup.py directory but to the src directory.

Output

No response

Code of Conduct

@sbidoul sbidoul added type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jul 31, 2021
@sbidoul sbidoul added C: editable Editable installations and removed S: needs triage Issues/PRs that need to be triaged labels Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: editable Editable installations type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant