Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document updating requirements with pre-commit hooks #1387

24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,30 @@ You might want to customize ``pip-compile`` args by configuring ``args`` and/or
files: ^requirements/production\.(in|txt)$
args: [--index-url=https://example.com, requirements/production.in]

If you have multiple requirement files make sure you create a hook for each file.

.. code-block:: yaml

repos:
- repo: https://github.com/jazzband/pip-tools
ssbarnea marked this conversation as resolved.
Show resolved Hide resolved
rev: 5.3.1
hooks:
- id: pip-compile
name: pip-compile setup.py
files: ^(setup\.py|requirements\.txt)$
- id: pip-compile
name: pip-compile requirements-dev.in
args: [requirements-dev.in]
files: ^requirements-dev\.(in|txt)$
- id: pip-compile
name: pip-compile requirements-lint.in
args: [requirements-lint.in]
files: ^requirements-lint\.(in|txt)$
- id: pip-compile
name: pip-compile requirements.txt
args: [requirements.txt]
files: ^requirements\.(in|txt)$


Example usage for ``pip-sync``
==============================
Expand Down