-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Support PEP 610 editables in pip freeze and pip list #10249
Conversation
aae16c7
to
99f7a3b
Compare
99f7a3b
to
f095f9c
Compare
e2c9f41
to
73bbc05
Compare
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
73bbc05
to
391c029
Compare
e3abddd
to
6e21d74
Compare
I added a couple of tests. This is now ready for review. I recommend looking at individual commits separately. |
6e21d74
to
43ead14
Compare
1ef2aaf
to
5495f14
Compare
Rebased and blackened. I also added some documentation. |
5495f14
to
6b06b21
Compare
Thank for the review, @uranusjr. I handled your comments. |
4c8f529
to
699b432
Compare
699b432
to
4c82baf
Compare
Make them work without using pkg_resource.
Look for the editable flag in direct_url.json, and fall back to the .egg-link search if there is no direct_url.json.
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
I have tried to remove the .egg-link (in which case the package is not considered editable), and removing the package while leaving the .egg-link (in which case the package is not shown). I could not produce this "Editable install not found" message with pip 21.2. So I think this is dead code and I'm replacing this test by an assert.
7bf6b89
to
ca05176
Compare
Rebased and still green. So I'm going ahead and merging this. Thanks for the review @uranusjr! |
This makes pip list and freeze support PEP 610 editables (from direct_url.json), in preparation for PEP 660.
This should be fully backward compatible. The new column in pip list column format is not a breaking change because it is meant for human consumption (the json format is there for machines, and in the semantics of existing field did not change in the json output).
direct_url.json
, fallback on the legacy.egg-link
search.Editable project location
column in pip list default output. This column appears only when there is and editable project in the list. TheLocation
column appears in verbose mode only and shows the same value as before (i.e. the parent of the metadata directory). Closes New pip list column: Editable project location #10245.editable_project_location
field to pip list json output (closes pip list in JSON format does not contain location for editable installs #7664, supersedes Include editable locations in JSON output of list #7670).editable_project_location
in pip freeze.get_installed_distributions
function.This may be tested by installing a flit project with
flit install --pth
orflit install --symlink
and noticing that pip list and pip freeze correctly detect it as editable.