-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Rewrite direct URL reinstallation logic #10564
Open
uranusjr
wants to merge
18
commits into
pypa:main
Choose a base branch
from
uranusjr:explicit-url-upgrade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b3ae769
Add utilities to check PEP 610 to incoming link
uranusjr fd6d34a
Rewrite direct URL reinstallation logic
uranusjr 85628f8
News
uranusjr 9b15bf6
VCS link equivalency should use commit_id
uranusjr 21f7a61
Revise locally available dist reinstallation logic
uranusjr 90e5f07
Fix test for behaviour change
uranusjr 8c2216b
Allow saving a wheel to pathlib.Path
uranusjr 3190c36
Add failing test for URL reinstall
uranusjr df9eaab
Fix PEP 610 info comparison logic to incoming link
uranusjr 8b48efd
Tweak reinstall logic for VCS resolution
uranusjr 86a2124
Add test for reinstallation from wheel cache
sbidoul 15b39f7
Simplify link vs direct url comparison
sbidoul feb2900
Notes on direct URL equivalent logic
uranusjr d63edf1
Merge pull request #1 from sbidoul/pr/uranusjr/10564
uranusjr e938d2d
Merge branch 'main' into explicit-url-upgrade
uranusjr 28885d1
Use pathlib
uranusjr 32824c8
Improve handling of --upgrade and --editable
uranusjr 9eabee4
Clean up pathlib references
uranusjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Reinstallation and upgrade behaviour of direct URL requirements are completely | ||
rewritten to better match user expectation. Now pip will try to parse the URLs | ||
and VCS information (if applicable) from both the incoming direct URLs and the | ||
already-installed PEP 610 metadata to determine whether reinstallation is | ||
needed. If pip guesses wrong, the user can also force pip to always reinstall | ||
direct URL requirments (but not version-specified ones) with ``--upgrade``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I continue pondering this topic and I tried installing an editable then the same from index.
I was expecting to hit this line, but it did not, because
candidate.get_install_requirement()
returns None which makes_get_ireq
exit immediately. Instead we get "Requirement already satisfied".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "from index", you mean a
pip install -e .
installing a package namedcoffee
and apip install coffee
returningRequirement already statisfied
and no reinstall?If yes, that's the behaviour I'd expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I meant, yes.
Fair. But that is not the behaviour described in the comment at line 139.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behaviour described on line 139 is correct, because on line 113 we already established the incoming candidate at this point is URL-specified. The scenario you described would fall into the block around line 108.
This block can only be triggered by commands like this: