- Create a new virtual environment and activate it:
python -m venv .venv source .venv/bin/activate
- Install development packages (linters, etc.):
pip install -r requirements-dev.txt
- Install pre-commit hooks:
pre-commit install
pip-tools is used to keep requirements pinned properly.
Define requirements as usual in the requirements-*.in
files and
pip-compile
will generate the corresponding txt file. E.g.,
pip-compile requirements-dev.in
will generate requirements-dev.txt.
Both .in
and .txt
files will be tracked by git, and
they are synced with a pre-commit hook (i.e., pip-compile
is run
automatically during each commit).
To install the dependencies, use pip-sync
, e.g.,
pip-sync requirements-dev.txt`