diff --git a/docs/developer/DEVELOP.md b/docs/developer/DEVELOP.md index 0f6f60c6b..4f5c9d476 100644 --- a/docs/developer/DEVELOP.md +++ b/docs/developer/DEVELOP.md @@ -460,6 +460,12 @@ $ source venv/bin/activate $ pip-compile --generate-hashes --allow-unsafe --upgrade-package django --upgrade-package requests==2.0.0 ``` +Instead of running this command manually, you can use the following make entrypoint: + +```bash +$ make upgrade-dep package=requests==2.0.0 reqfile=requirements.in +``` + To install the dependencies with `pip`, you simply pass the requirements file(s) to the `-r` option and all the requirements in the file will be installed, even if the file was generated by `pip-compile`! With `pip-tools`, the command for installing dependencies is `pip-sync requirements.txt` (or any other file generated by `pip-compile`), however `pip-sync` will not only install the requirements, but it will also uninstall any packages or versions that do **not** match the one defined in the requirements file. diff --git a/mk/setup.mk b/mk/setup.mk index c10423503..84841d2e0 100644 --- a/mk/setup.mk +++ b/mk/setup.mk @@ -71,6 +71,11 @@ sync-deps: check-venv-active $(ps) requirements.txt devel-requirements.txt $$([ -f local-requirements.txt ] && echo 'local-requirements.txt') +.PHONY : upgrade-dep +upgrade-dep: check-venv-active + @echo ">upgrading specified packages" + $(pc) --allow-unsafe --generate-hashes --no-emit-index-url -P $(package) $(reqfile) + #*********************************** ### Update installed python packages based on requirements.txt both in local venv and in all containers #***********************************