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 don't think
self.link
is exclusive to the PEP 508 link format of requirement. Have you ensured that this doesn't force reinstall in cases you aren't intending to change?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 am not sure, I am still new to the pip codebase. My hope was that this PR would generate discussion about the issue and one potential way to address it.
This approach is a bit overkill, but it's the smallest impact change I can think of. I would rather have a tool that was extra cautious and reinstalled more often than was necessary instead of missing cases where a reinstall should have been required.
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.
OK, no problem (this code is complex!) but I think it probably will affect things that it shouldn't in that case.
In contrast to you, I'd strongly prefer pip to not modify my system unless it needs to, so I'm keen that this change doesn't impact anything that it shouldn't. I haven't really got any direct experience of (or familiarity with) the situations where PEP 508 URL links (or their predecessors,
dependency_links
) are useful, so I can't really comment on whether the issue here should be handled by forcing a reinstall, I'll have to leave that to others. Although I will say that if there's no change to the project name or version, then IMO there should be no need to reinstall even if the URL changes - the idea is that the same project name and version should never refer to functionally different code (the one exception being local directories, which are assumed to be "in-development" code). I've added a comment to the original issue asking for more clarification on the need for this.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.
Seeing @benoit-pierre's comment here: #5780 (comment), I will close this PR. The proposed alternative is much cleaner and fits both of our requirements.