pip Requirements and Locking Cheat Sheet/Maintain layered requirement files

Example pattern for base + dev requirement layering.

Section: Constraints and Overrides

Maintain layered requirement files

text
text
# requirements-dev.txt
-r requirements.txt
pytest
black
ruff
Explanation

A clean way to maintain development-only tooling on top of runtime dependencies.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Constraints and Overrides
Constrain a direct install
Apply version constraints to a direct install.
OpenIn sheetbashsame section
Example constraints file
Show a constraints file with exact pins.
OpenIn sheettextsame section
Install from a wheelhouse offline
Install from local artifacts without contacting indexes.
OpenIn sheetbash1 tag match
Install with required hashes
Require hash verification for all requirements.
Generate JSON install report
Write a structured report during installation.
Build a local wheelhouse
Download all requirements into a local artifact directory.