-
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
5780: Always reinstall linked packages #5781
5780: Always reinstall linked packages #5781
Conversation
@@ -337,7 +337,7 @@ def check_if_exists(self, use_user_site): | |||
no_marker = Requirement(str(self.req)) | |||
no_marker.marker = None | |||
self.satisfied_by = pkg_resources.get_distribution(str(no_marker)) | |||
if self.editable and self.satisfied_by: | |||
if (self.editable or self.link) and self.satisfied_by: |
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.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #5780
Will wait to add NEWS and tests until maintainers give initial feedback on this approach