Repolode
pypa

pypa/pip-tools

A set of command-line tools (pip-compile and pip-sync) that pin Python dependencies into reproducible requirements files and keep environments in sync with them.

Stars
8,003
Forks
686
Open issues
174
Last commit
2 days ago

What is it?

pip-tools helps Python projects keep pinned dependencies up to date while keeping builds predictable. pip-compile reads dependencies from pyproject.toml, setup.py, setup.cfg, or a requirements.in file and produces a fully pinned requirements.txt that includes all transitive dependencies, with optional hash generation for pip's hash-checking mode.

pip-sync takes a compiled requirements file and installs, upgrades, or uninstalls packages in the current virtual environment so that it matches the file exactly. Upgrades can be applied to all packages or to selected ones, and layered requirement files can constrain one another so development and production pins stay consistent.

The tools are installed per virtual environment with pip, and the project notes that pin files should be generated separately for each target Python environment.

Key features

  • 01Compiles pinned requirements.txt files from pyproject.toml, setup.py, setup.cfg, or requirements.in.
  • 02Includes transitive dependencies and annotates which package requires each pin.
  • 03Generates sha256 hashes for pip's hash-checking mode with --generate-hashes.
  • 04Upgrades all packages or selected ones with --upgrade and --upgrade-package.
  • 05Syncs a virtual environment to exactly match a requirements file with pip-sync.
  • 06Supports layered requirement files that constrain one another.

Use cases

  • Pinning application dependencies for reproducible production builds.
  • Keeping a library's CI environment stable while still updating pins deliberately.
  • Maintaining separate production and development requirement sets with shared constraints.
  • Running pip-compile as a pre-commit hook to regenerate pins when inputs change.

Quick start

  1. 1

    Activate your project's virtual environment and install pip-tools

    python -m pip install pip-tools
  2. 2

    Compile your requirements.in into a pinned requirements.txt

    pip-compile requirements.in
  3. 3

    Sync your virtual environment to match requirements.txt

    pip-sync

Topics

#python#dependency-management#pip#requirements#lockfile#packaging#hashes#pip-compile#pip-tools#setuptools

FAQ

What is pip-tools?
A set of command-line tools (pip-compile and pip-sync) that pin Python dependencies into reproducible requirements files and keep environments in sync with them. pip-tools helps Python projects keep pinned dependencies up to date while keeping builds predictable. pip-compile reads dependencies from pyproject.toml, setup.py, setup.cfg, or a requirements.in file and produces a fully pinned requirements.txt that includes all transitive dependencies, with optional hash generation for pip's hash-checking mode.
Is pip-tools free to use? What license does it have?
pip-tools is open source under the BSD-3-Clause license. Check the license terms before using it in commercial products.
Is pip-tools still maintained?
Actively maintained. The last commit to pip-tools was on Nov 6, 2026.
What can I use pip-tools for?
Pinning application dependencies for reproducible production builds. Keeping a library's CI environment stable while still updating pins deliberately. Maintaining separate production and development requirement sets with shared constraints. Running pip-compile as a pre-commit hook to regenerate pins when inputs change.
How do I install pip-tools?
Activate your project's virtual environment and install pip-tools: python -m pip install pip-tools Compile your requirements.in into a pinned requirements.txt: pip-compile requirements.in Sync your virtual environment to match requirements.txt: pip-sync
Where can I get pip-tools?
The source code and installation instructions are on GitHub: https://github.com/pypa/pip-tools

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects