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

Refactor the freeze command #10410

Merged
merged 6 commits into from
Sep 22, 2021
Merged

Refactor the freeze command #10410

merged 6 commits into from
Sep 22, 2021

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Aug 28, 2021

This is a followup to and sits on top of #10249.

This slightly changes the output of pip freeze in case the detection of the VCS reference of an editable install fails.
Before it returned a non editable requirement in some VCS error situations.
Now it always returns an editable requirement, but pointing to the local directory when the VCS could not be determined for any reason.

This is more consistent, avoids information loss, and greatly simplifies the logic.

@github-actions github-actions bot added the needs rebase or merge PR has conflicts with current master label Aug 28, 2021
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Aug 29, 2021
@sbidoul sbidoul added this to the 21.3 milestone Aug 29, 2021
@github-actions github-actions bot added the needs rebase or merge PR has conflicts with current master label Sep 21, 2021
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Sep 21, 2021
@sbidoul sbidoul marked this pull request as ready for review September 21, 2021 11:01
Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

A few minor stylistic suggestions. The rest LGTM.

@@ -0,0 +1,2 @@
Allways fallback to reporting the editable project location when pip freeze
Copy link
Member

Choose a reason for hiding this comment

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

typo:

Suggested change
Allways fallback to reporting the editable project location when pip freeze
Always fallback to reporting the editable project location when pip freeze

Copy link
Member

Choose a reason for hiding this comment

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

nit-ish: I would rephrase this to something like:

pip freeze will now ...

I find it easier to skim, when we mention the "thing-that-we-affected" at the start of the message.

else:
# name==version requirement
req = _format_as_name_version(dist)
comments = []
Copy link
Member

Choose a reason for hiding this comment

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

nit: I'd put this at the start of the else.

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label Sep 21, 2021
Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

Feel free to merge, once you fix the typo.

Drop the "awaiting response" label, if you wanna include this in the 21.3 release and want me to do a review before merging. :)

At the beginning this function returns if not dist.editable.
So returning editable=False after that does not make sense.
Return an editable with the file system location instead when
there is any issue getting VCS information.
@sbidoul sbidoul removed the S: awaiting response Waiting for a response/more information label Sep 21, 2021
@uranusjr uranusjr merged commit b55ec00 into pypa:main Sep 22, 2021
@sbidoul sbidoul deleted the refactor-freeze-sbi branch September 22, 2021 05:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants