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

Include editable locations in JSON output of list #7670

Closed
wants to merge 3 commits into from

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jan 29, 2020

Fix #7664. This matches the JSON format with the default columns format.

Probably need to come up with a test to make sure the two formats match.

info['location'] = dist.location
if options.verbose >= 1:
info['installer'] = get_installer(dist)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not feel right to me to have the verbose flag influence the content of a json output.
What is also not completely right is to have the location field having two semantics: the editable project location and the installed location. These are two different things that should go in different fields IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The location semantic would also affect the column format. It has also existed for a while now so the compatibility issue would be important.

Regarding verbosity, I have no problem always outputting all fields.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the concern was backwards compatibility?

If this mode of output does not feel very reasonable, I don't mind changing it but I'm also not sure if there's a clear transition path to introduce these additional fields and who it might affect if we do so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, agreed. One solution I can think of is to introduce a --fields option that explicitly tells pip what fields to output (the default being to infer from verbosity).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think our tests breaking because of new fields does not necessarily indicate that there are people out there relying on the absence of such fields. So I'd still be inclined to add the fields unconditionally and adapting our tests.

@uranusjr
Copy link
Member Author

So I tried including the fields unconditionally, and it broke about 100 cases in the test suite because they don’t expect location to present for non-editable packages 😛

IMO this is a sign people are probably relying on this behaviour. Let’s stick to mimicking the column format for now.

@pradyunsg
Copy link
Member

@uranusjr could you rebase this PR? Or close this and open a new one from the same branch, so that the Github checks get updated?

@uranusjr
Copy link
Member Author

Rebased, waiting for CI.

@pradyunsg
Copy link
Member

pradyunsg commented Sep 18, 2021

@uranusjr Do you reckon you'd have time in the next 6 months or so, to update this PR? If not, let's close this out for now so that someone else could come in and pick this up?

@uranusjr
Copy link
Member Author

I think this is no longer relevant now we’re implementing PEP 660 and changing the location outputs. We can make that field always visible in the JSON output instead without must (any?) backward compatibility concerns. (Please comment @sbidoul if you feel otherwise.)

@uranusjr uranusjr closed this Sep 18, 2021
@sbidoul
Copy link
Member

sbidoul commented Sep 18, 2021

Yup, this is all covered in #10249.

@uranusjr uranusjr deleted the list-location-editable branch September 18, 2021 10:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs rebase or merge PR has conflicts with current master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip list in JSON format does not contain location for editable installs
3 participants