Confusion: --keep-outdated --selective-upgrade
See original GitHub issueJust to get some clarity. I’m trying to update a specific package. The docs say I should do:
pipenv update my_package
The help says that --selective-upgrade
“Updates specified packages.”… isn’t that what the above command does? And shouldn’t we rename it to selective-update
instead of selective-upgrade
😅
I’m just trying to update a specific package without pipenv trying to update all other outdated dependencies. The docs suggest that this is what --keep-outdated
does… but shouldn’t that be the default behaviour?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Upgrade confusion? - Raspberry Pi Forums
Upgrade confusion ? Sat May 19, 2018 2:41 am. I encountered an issue mounting an exfat USB thumb drive: Code: Select all
Read more >How to disable upgrade/update of selective packages ...
One way is to use apt-get dist-upgrade instead of the software ... If you want to do them all at once, you can...
Read more >7.9 to 8.1 Upgrade Guide - Ignition User Manual 8.1
We generally discourage this practice, as it results in unintended consequences. We recommend you take the "Using the Installer to Upgrade" ...
Read more >Does Red Hat support upgrades between major versions of ...
The upgrade option is known to cause erratic system behavior in some cases. In cases where unexpected results occur, Red Hat Global Support ......
Read more >6.8. Keeping a System Up to Date
While it is of course possible to periodically run a tool to check for available updates and run the upgrades, such a repetitive...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apologies for not responding to this sooner, I’ve been super busy with work but more significantly there were a number of breaking changes related to PEP514 implementation which first pip rolled out and then setuptools rolled out and then there was a bit of a stalemate-fingerpointing situation and then some more breakages which has all been a bit of a nightmare
The result of this is that pipenv just does its own dependency resolution with
requirementslib
which needed a resolver to handle direct url dependencies as someone mentioned with regard to #3304With regard to the specific question here, there is significant confusion about
--keep-outdated
(which should really do nothing under optimal circumstances unless things are no longer available or installable on PyPI when you re-lock, which can happen if you are on OSX for example),--selective-upgrade
only works withinstall
and can be used to install the minimum viable set of changes into the lockfile (that is, still using the highest available versions etc, but not upgrading packages unnecessarily)The only real difference is that you can add something to your
Pipfile
and lock with--keep-outdated
for the same behavior – and formally speaking,--keep-outdated
should never remove something from the lockfile (I am not sure what--selective-upgrade
does on this front).Here is the important caveat:
pipenv update
always targets every package in your lockfile, without exception. It does not accept arguments. If you want to upgrade a specific package, you must do it withpipenv install --selective-upgrade <package>
(which naturally will add it to your lockfile)This needs to be reviewed at some point because it is super inconvenient and probably is a major gap in normal workflows
@techalchemy Thank you for explaining the difference and pointing out how to upgrade a selective package. It seems like
pipenv install --selective-upgrade <package>
does what you stated, but only misses out on updating the hash of the new version in the lockfile. 😞 Is this a already tracked issue?