

You can also use plain text files for your requirements (e.g. Just define your dependencies and extras as usual and run Setup.cfg-based projects that use setuptools. Pip-compile has also full support for setup.py- and Of your open-source Python package stable. This is great for both pinning your applications, but also to keep the CI # via my-cool-django-app (pyproject.toml ) exceptiongroup=1.1.1 # pip-compile -extra =dev -output-file =dev-requirements.txt pyproject.toml # # via django $ pip-compile -extra dev -o dev-requirements.txt pyproject.toml # # via my-cool-django-app (pyproject.toml ) sqlparse=0.4.3 # pip-compile -output-file =requirements.txt pyproject.toml # # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # You can produce your pin files as easily as: $ pip-compile -o requirements.txt pyproject.toml # Optional dependency dev that includes pytest: requires = build-backend = "hatchling.build" name = "my-cool-django-app" version = "42" dependencies = dev = You declare django as a dependency and create an

You also want to pin your development tools Suppose you have a Django application that is packaged using Hatch, and you In projects that use modern standards-adhering packaging tools like Official standard, you can use pip-compile to pin the dependencies Supports both installing your pendencies as well as your Packages and applications, and is recommended for new projects. Requirements.txt file, or see Updating requirements for alternativeĪpproaches. To compile from scratch, first delete the existing Note: If pip-compile finds an existing requirements.txt file thatįulfils the dependencies then no changes will be made, even if updates areĪvailable. Or other environment markers, resolve relative to your project’s Project so conditional dependencies that require a specific Python version, Pip-compile should be run from the same virtual environment as your Windows and pythonX.Y -m piptools compile on other systems. Multiple Python versions, you can also run py -X.Y -m piptools compile on Run it with pip-compile or python -m piptools compile.


Your dependencies, specified in either pyproject.toml, setup.cfg, The pip-compile command lets you compile a requirements.txt file from Note: all of the remaining example commands assume you’ve activated your Virtual environments: $ source /path/to/venv/bin/activate (venv ) $ python -m pip install pip-tools Similar to pip, pip-tools must be installed in each of your project’s You do pin them, right? (In building your Python application and its dependencies for production, you want to make sure that your builds are predictable and deterministic.) Installation A set of command line tools to help you keep your pip-based packages fresh,Įven when you’ve pinned them.
