Skip to content

Commit

Permalink
Add pip-tools related-files to the project
Browse files Browse the repository at this point in the history
We have to use a `requirements.in` just to proxy `setup.cfg`, since an
error occurs when we rely on the implicit dependency (ref:
jazzband/pip-tools#572).

This way abstracted requirements are expressed via `setup.cfg` while
concrete dependencies are expressed via `requirements.txt`.

Basic workflow:
- Add abstract dependencies to `setup.cfg`
- Proxy `setup.cfg` using `requirements.in`
- Write dev dependencies to `dev-requirements.in`
- Use `pip-compile --output-file (dev-)requirements.txt (dev-)requirements.in`
  to compile the concrete dependencies
- Add the `requirements.{in,txt}` files to source control for repeatable
  installations: https://caremad.io/posts/2013/07/setup-vs-requirement/
- Use `pip-sync dev-requirements.txt requirements.txt` to install the
  packages into the current virtualenv
- Run commands normally inside the current virtualenv (e.g. `tox`)
- Don't expose test requirements directly to pip-tools. Instead, just
  rely on tox/pytest-runner to install them inside the test venv.
  • Loading branch information
abravalheri committed Jun 18, 2018
1 parent 86cf5eb commit 5f0df63
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 2 additions & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tox
ptpython
18 changes: 18 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file dev-requirements.txt dev-requirements.in
#
docopt==0.6.2 # via ptpython
jedi==0.12.0 # via ptpython
parso==0.2.1 # via jedi
pluggy==0.6.0 # via tox
prompt-toolkit==1.0.15 # via ptpython
ptpython==0.41
py==1.5.3 # via tox
pygments==2.2.0 # via ptpython
six==1.11.0 # via prompt-toolkit, tox
tox==3.0.0
virtualenv==16.0.0 # via tox
wcwidth==0.1.7 # via prompt-toolkit
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e .
15 changes: 8 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Add your pinned requirements so that they can be easily installed with:
# pip install -r requirements.txt
# Remember to also add them in setup.cfg but unpinned.
# Example:
# numpy==1.13.3
# scipy==1.0

#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements.txt requirements.in
#
-e file:///home/ab17624-l/workspace/dummy-pipenv-example-for-pyscaffold
appdirs==1.4.3

0 comments on commit 5f0df63

Please sign in to comment.