News for hackers. Stuff that matters.
Re:Pypi.org is running a survey on the state of Python packa... by woodruffw on Wednesday September 07, 2022 @12:23PM (#32752684)
> pip doesn't even ask when reinstalling a version currently being used.

Just as an explanation: a "version" in Python packaging can come from one of many potential distributions, including a local distribution (such as a path on disk) that might different from a canonical released distribution on PyPI. Having `pip install ...` always re-install based on its candidate selection rules is generally good (IMO), since an explicit run of `pip install` implies user intent to search for a potentially new or changed distribution.

Re:Pypi.org is running a survey on the state of Python packa... by YetAnotherNick on Wednesday September 07, 2022 @01:15PM (#32753379)
I meant this for dependency not the package I am installing.
Re:Pypi.org is running a survey on the state of Python packa... by woodruffw on Wednesday September 07, 2022 @01:38PM (#32753628)
I'm not sure I understand what you mean -- `pip` should not be reinstalling transitive dependencies. If you install A and B and both depend on C, C should only be installed once.
Re:Pypi.org is running a survey on the state of Python packa... by Izkata on Wednesday September 07, 2022 @02:25PM (#32754276)
I think they're referring to requirements files. I've seen the same behavior - on day 1, pip installs packages A and B, then on day 2 when someone else modified the requirements file it installs C and reinstalls B even though B hasn't changed.

This one I've seen when the dependency doesn't specify an exact version and you included "--upgrade".

There's a second case that I think was fixed in pip 21 or 22, where two transitive dependencies overlap - A and B depend on C, but with different version ranges. If A allows a newer version of C than B allows, C can get installed twice.