{"id":8424,"library":"pip-compile-multi","title":"pip-compile-multi","description":"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.","status":"active","version":"3.3.0","language":"en","source_language":"en","source_url":"https://github.com/peterdemin/pip-compile-multi","tags":["dependency management","pip","pip-tools","requirements","lockfile","cli","monorepo","python"],"install":[{"cmd":"pip install pip-compile-multi","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core dependency for actual requirements compilation. pip-compile-multi uses it underneath.","package":"pip-tools","optional":false},{"reason":"Alternative, faster resolver that can be enabled with the --uv flag.","package":"uv","optional":true}],"imports":[],"quickstart":{"code":"# 1. Create a directory for your requirement files\nmkdir requirements\n\n# 2. Define your base dependencies in requirements/base.in\n# requirements/base.in\n# click\n# pip-tools\n\n# 3. Define your test dependencies in requirements/test.in\n# Include base dependencies using -r\n# requirements/test.in\n# -r base.in\n# pytest\n\n# 4. Run pip-compile-multi to generate locked .txt files\npip-compile-multi\n\n# 5. Install your dependencies using the generated .txt files\npip install -r requirements/base.txt -r requirements/test.txt","lang":"bash","description":"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."},"warnings":[{"fix":"Ensure your project runs on Python 3.10 or a later supported version. Update your environment accordingly.","message":"Version 3.3.0 removes support for Python 3.9. Users must upgrade to Python 3.10 or newer.","severity":"breaking","affected_versions":">=3.3.0"},{"fix":"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`.","message":"In version 3.0.0, the `--use-cache` and `--skip-constraints` flags were enabled by default. Also, the new CLI entrypoint `requirements` was added, and the `-n, --only-name` option was removed in favor of `-t, --only-path`.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"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.","message":"Without the `--autoresolve` flag, separate `.in` files that share common dependencies might resolve those dependencies to different, incompatible versions. This can lead to unexpected behavior or installation failures if these `.txt` files are used together.","severity":"gotcha","affected_versions":"all"},{"fix":"Integrate `pip-compile-multi verify` into your Continuous Integration (CI) pipeline or as a pre-commit hook to detect and prevent desynchronized lock files.","message":"It's common for generated `.txt` lock files to become out of sync with their corresponding `.in` input files if changes are made to `.in` files but `pip-compile-multi` is not re-run.","severity":"gotcha","affected_versions":"all"},{"fix":"Structure your `.in` files logically, grouping dependencies based on their functional role within your project (e.g., `runtime.in`, `dev.in`, `test.in`).","message":"Poorly organized dependency groups across `.in` files (e.g., mixing linters with deep learning frameworks) can lead to dependency bloat or unnecessary conflicts.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"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.","cause":"Dependencies are not hard-pinned, leading to variations in installed package versions across environments or over time.","error":"Different developers have different dependency versions or production breaks after redeployment."},{"fix":"Run `pip-compile-multi` with the `--autoresolve` flag to ensure a globally consistent dependency resolution across all `.in` files.","cause":"Multiple `.in` files define a common package that `pip-compile-multi` resolves differently for each file, leading to a conflict when they are eventually used together.","error":"pip-compile-multi fails to resolve dependencies or produces incompatible lock files when multiple `.in` files share transitive dependencies."},{"fix":"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.","cause":"After modifying `requirements.in`, `pip-compile-multi` was not executed, or a `verify` check indicated a mismatch.","error":"The content of `requirements.txt` does not reflect recent changes made in `requirements.in`."},{"fix":"Use the `--upgrade-package <package_name>` option to specify which packages should be upgraded, keeping others at their currently pinned versions.","cause":"Running `pip-compile-multi` by default tries to upgrade all packages to their latest compatible versions.","error":"Cannot upgrade a single package or only a subset of packages without affecting all other dependencies."}]}