> On Jun 25, 2016, at 5:31 PM, Nick Coghlan <[email protected]> wrote: > > On 25 June 2016 at 03:25, Pradyun Gedam <[email protected]> wrote: >> Hello List! >> >> There is currently a proposal to change the behaviour to pip install to >> upgrade a package that is passed even if it is already installed. >> >> This behaviour change is accompanied with a change in the upgrade strategy - >> pip would stop “eagerly” upgrading dependencies and would become more >> conservative, upgrading a dependency only when it doesn’t meet lower >> constraints of the newer version of a parent. Moreover, the behaviour of pip >> install --target would also be changed so that --upgrade no longer affects >> it. >> >> A PEP-style write-up >> (https://gist.github.com/pradyunsg/4c9db6a212239fee69b429c96cdc3d73) >> documents the reasoning behind this proposed change, what the change is and >> some alternate proposals that were rejected in the discussions. >> >> This is a request for comments on the pull-request implementing this >> proposal (https://github.com/pypa/pip/pull/3806) for your views, thoughts >> and possible concerns related to it. > > Hi Pradyun, > > Thanks for putting that together. The assertion in the write-up that > the proposed behaviour matches that of operating system level package > managers doesn't sound right to me: > > $ sudo dnf install -q python > Package python-2.7.11-5.fc24.x86_64 is already installed, skipping. > > (My system actually has a Python update pending, so the "-q" option is > suppressing the output telling me about that, but either way, it > doesn't make any local changes unless I use the update or upgrade > subcommand or supply the "--best" upgrade strategy option to the > install command)
Yum behaves as indicated, see: https://s.caremad.io/0E3gYYBWFP/ It appears that maybe DNF decided to be an odd duck like pip currently is and put this behind a flag (``dnf install —best``). Although it arguably makes more sense for a distro package manager to use pip’s current behavior since they don’t tend to do major upgrades inside of a single distro (so you’re like to only get bug fixes and security fixes available) and they tend to have dedicated “upgrade all the things” commands that people run regularly. > > As far as I am aware, apt-get install behaves the same way - if you > only give a package name, and that package is already installed on the > system, it won't do anything, even if a newer version of that > component is available, and you need to use the "upgrade" subcommand > instead to say "upgrade to the latest available version”. No, apt-get install <foo> upgrades if <foo> is already installed, see: https://askubuntu.com/questions/44122/how-to-upgrade-a-single-package-using-apt-get > > Switching pip's "--upgrade" command line option to a non-eager upgrade > strategy sounds good to me, but making "install" upgrade the requested > component by default when given just a name (rather than a specific > file or URL reference) would be very surprising and problematic. I think the current behavior is surprising and problematic TBH and has lead projects to telling people they should do ``pip install -U <thing>`` instead of just ``pip install <thing>``. It’s a bit weird that you get different versions of <foo> installed based on what version you already have installed when you run ``pip install <foo>``. The proposed behavior matches that of all of the other language package managers I tried as well. — Donald Stufft _______________________________________________ Distutils-SIG maillist - [email protected] https://mail.python.org/mailman/listinfo/distutils-sig
