Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install / update package with pipenv without updating the rest of packages

I use pipenv (version 2018.11.26) to manage dependencies in my project. Sometimes I want to add or update only one package and don't change versions of other packages. How can I achieve that? I've tried both

pipenv update --selective-upgrade requests 

and

pipenv update --keep-outdated requests 

but still versions of all the packages are updated during locking.

Pipfile & Pifile.lock: https://gist.github.com/jozo/d8351ed708e84c5ea0f69e82e585e5c6

like image 233
jozo Avatar asked Apr 09 '19 12:04

jozo


People also ask

How do I update Pipfile dependencies?

Record dependencies in Pipfile to manage project packagesAdd a new package dependency by modifying the packages section. pipenv lock — records the new requirements to the Pipfile. lock file. pipenv update — records the new requirements to the Pipfile.

What does Pipenv update do?

$ pipenv install is used for installing packages into the pipenv virtual environment and updating your Pipfile. The user can provide these additional parameters: --two — Performs the installation in a virtualenv using the system python2 link.

Does Pipenv install Dev packages?

Currently, this is required for Pipenv to do sub-dependency resolution. Providing the --dev argument will put the dependency in a special [dev-packages] location in the Pipfile . These development packages only get installed if you specify the --dev argument with pipenv install .

How do I update pip packages?

To update installed packages to the latest version, run pip install with the --upgrade or -U option.


1 Answers

Running pipenv install/uninstall/update with --keep-outdated will prevent pipenv from updating unrelated locked packages. (It's odd that this is not the default befavior).

If you don't want some packages to ever be updated automatically, you should pin those in your Pipfile, e.g:

[packages] django = "==2.2" djangorestframework = "==3.9.2" 
like image 83
Eugene Yarmash Avatar answered Sep 19 '22 21:09

Eugene Yarmash