To know about the required dependencies, their minimum required versions check the requirements*.txt files. Whenever we pin to a specific version in requirements*.in, we add a comment explaining why we are doing so. We also have comments on their use.
Note : The pip-compile command lets you compile a requirements*.txt from your dependencies, specified in either setup.py or requirements*.in. So, ensure you don’t have requirements.txt if you compile setup.py or requirements*.in from scratch, otherwise, it might interfere. You can also specify a file name other than requirements.txt in the following command.
Replace [package_name] with the dependency name you want from requirements.txt file.
Whenever we pin to a specific version in requirements*.in, we add a comment explaining why we are doing so. You can also specify the version you want to compile by running.
Note : Make sure you check the requirements*.in file comments before you change the version.
To update a specific package to the latest version use the --upgrade-package or -P flag:
Replace [package_name] with the dependency name you want from requirements.txt file.
Whenever we pin to a specific version in requirements*.in, we add a comment explaining why we are doing so. You can also specify the version you want to upgrade to by running.
Example of bcrypt package
You can combine --upgrade and --upgrade-package in one command, to provide constraints on the allowed upgrades. For example to upgrade all packages whilst constraining bcrypt to the latest version less than 3.0: