From aca92e6a0493e53cd3f4ac3107b2d700df4329f1 Mon Sep 17 00:00:00 2001 From: Eric Redon Date: Wed, 6 May 2020 12:30:20 +0200 Subject: [PATCH] Initial development requirements: pip-tools --- CONTRIBUTING.md | 21 +++++++++++++++++++++ setup.py | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..200d544 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,21 @@ +## Development Environment FAQ + +### How to maintain `requirements.txt`? + +The canonical list of installation requirements (including development requirements) is maintained in the [`setup.py`](setup.py) file. + +The Requirements File ([`requirements.txt`](requirements.txt)) file must be kept in sync with that list. + +To to automatically generate or update `requirements.txt` based on `setup.py`, run [`pip-tools`](https://github.com/jazzband/pip-tools)’s `pip-compile`: + +```sh +python -m piptools compile --output-file=requirements.txt +``` + +**Warning:** Due to [limitations](https://github.com/jazzband/pip-tools/issues/908) in `pip-tools`, the same workflow can not be used for generating a `dev-requirements.txt` file, and requirements can not be declared in a `setup.cfg` file. + +### How to install modules required for development? + +```sh +python -m pip install -e ".[dev]" +``` diff --git a/setup.py b/setup.py index 4b74b3a..ad8e5f3 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,10 @@ requirements = [ "django", ] +dev_requirements = [ + "pip-tools", +] + setup( name="ungleich_screening_task", version="0.1.0", @@ -12,4 +16,5 @@ setup( author_email="eric.redon@coox.org", python_requires=">=3.6", install_requires=requirements, + extras_require={"dev": dev_requirements}, )