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

5780: Always reinstall linked packages #5781

Closed

Conversation

cam72cam
Copy link

Fixes #5780

Will wait to add NEWS and tests until maintainers give initial feedback on this approach

@@ -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:
Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

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.

@cam72cam cam72cam closed this Sep 13, 2018
@lock
Copy link

lock bot commented Jun 1, 2019

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.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating remote links with new URLs for PEP508 functionallity
2 participants