pip-compile-multi is a command-line utility for compiling multiple Python `requirements.in` files into locked `requirements.txt` files. It builds upon `pip-tools` (or `uv`) to manage complex dependency graphs, resolve cross-file conflicts, and ensure deterministic, reproducible environments across different project stages like development, testing, and production. The library is actively maintained, with recent updates, and is currently at version 3.3.0.
pip install pip-compile-multiNo compatibility data collected yet for this library.
This quickstart demonstrates how to set up two common dependency sets: `base` for runtime requirements and `test` for testing, which includes the `base` requirements. It shows how to generate the locked `.txt` files and install them.
Ensure your project runs on Python 3.10 or a later supported version. Update your environment accordingly.
Review your `pip-compile-multi` command-line arguments and configuration. Adjust scripts to use `--no-use-cache` or `--no-skip-constraints` if previous behavior is desired, use `requirements` instead of `pip-compile-multi` if desired, and replace `-n` with `-t`.
Always use the `--autoresolve` flag when dealing with interdependent `.in` files (e.g., `test.in` referencing `base.in`). Note that `--autoresolve` requires a single 'source node' (a single `.in` file that directly or indirectly references all others) in your dependency graph.
Integrate `pip-compile-multi verify` into your Continuous Integration (CI) pipeline or as a pre-commit hook to detect and prevent desynchronized lock files.
Structure your `.in` files logically, grouping dependencies based on their functional role within your project (e.g., `runtime.in`, `dev.in`, `test.in`).
Use `pip-compile-multi` to generate explicit, version-locked `.txt` files from your `.in` files. Ensure all environments `pip install -r` only from these `.txt` files.
Run `pip-compile-multi` with the `--autoresolve` flag to ensure a globally consistent dependency resolution across all `.in` files.
Execute `pip-compile-multi` to recompile your `.in` files into `.txt` files. Incorporate `pip-compile-multi verify` into your development workflow to catch such discrepancies early.
Use the `--upgrade-package <package_name>` option to specify which packages should be upgraded, keeping others at their currently pinned versions.