question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Confusion: --keep-outdated --selective-upgrade

See original GitHub issue

Just 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:open
  • Created 5 years ago
  • Reactions:14
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
techalchemycommented, May 20, 2019

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 #3304

With 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 with install 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 with pipenv 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

6reactions
saisankargochhayatcommented, Jun 17, 2020

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 #3304

With 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 with install 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 with pipenv 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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found