Pip-tools is a command-line toolset for managing dependencies in Python projects. It streamlines the process of handling project dependencies by providing essential functionalities.
Pip-tools helps manage a project's dependencies by resolving and pinning specific versions. It ensures that everyone working on the project uses the same versions of dependencies, promoting consistency and reproducibility.
The requirements.in file contains high-level dependencies, while the requirements.txt file contains the pinned versions. This separation enables easy updating and maintenance of dependencies.
Install or upgrade pip.
pip install --upgrade pip
Install pip-tools.
pip install pip-tools
To generate pinned versions, add or update a package and its version specifier according to your needs in the requirements.in or requirements.dev.in file.
pip-compile --generate-hashes --resolver=backtracking -o <requirements_file>.txt <requirements_file>.in
Add or update the package and its version specifier according to your needs in a *.in file. In the project root directory.
make compile-requirements
Alternatively, you could run pip-compile
directly in the builder container.
docker compose -f docker-compose.builder.yml run --rm builder pip-compile ...