-
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
Un-deprecate source distribution re-installation behaviour #10543
Conversation
issue=8711, | ||
# is a local sdist -- disallow. | ||
raise SamePackageAlreadyInstalled( | ||
refused_to_install=candidate.source_link.file_path |
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.
Should that really be an error ? Or just a Requirement already satisfied: ...
message ?
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 think an error is better, because otherwise this would be a "silent" behaviour change -- the behaviour changed but the user has no way to know how/why; especially if they don't have checks to ensure that the behaviour doesn't affect them. Given that the deprecation message explicitly advertised a replacement, I think it's a good idea to fail loudly in these cases.
@pypa/pip-committers Re-reading #8711 and #5780 (comment), I do feel a bit confused about this behaviour change. From the feedback we've gotten since the deprecation was announced, it's clear that using I'm not a 100% sure what to do here TBH. I'm inclined to pull out this deprecation, and then kick the can down the road for this, into #5780 -- since it does look like we want |
+1 This needs to be done in one shot (which is most of the reason why I haven't touched it one bit) |
This will be handled as part of a broader effort to make the reinstall behaviours more ergonomic and easier to reason about.
abd9f17
to
68e22aa
Compare
Alrighty. Here's a patch removing the deprecation then! I'm hoping that this doesn't fail CI in some weird way. :) |
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.
Tests failed due network issues. Unrelated.
@pradyunsg @uranusjr sorry to be late to the game but, is it not better to keep this deprecation ? IMO, "Reinstalling a source distribution despite an installed package having the same name and version as the installed package" is stil a behaviour that is dubious and we will probably want to change in the future. So continuing to warn users that they are doing something unusual seems like a good thing to do ? |
I think “reinstalling a (direct URL; the warning did not happen for version-specified requirements) source distribution despite an installed package having the same name and version” in itself isn’t actually dubious on paper—in fact, it’s exactly what I’d want if I |
This was deprecated in favour of explicitly passing
--force-reinstall
.