Skip to content

Commit

Permalink
Add pipenv to project
Browse files Browse the repository at this point in the history
Use the `pipenv install -e .` strategy to include setuptools
`install_requires` dependencies in Pipenv.

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

Since extra requirements are not installed for editable dependencies
(until this moment), `testing` dependencies are handled exclusively
inside tox/pytest-runner venvs, and `dev` dependencies should be
specified directly in the Pipenv file (not included in `setup.cfg`).

ref: pypa/pipenv#1094 (comment)
     pypa/pipenv#1263 (comment)

Basic workflow:
- Add abstract dependencies to `setup.cfg`
- Proxy `setup.cfg` by doing `pipenv install -e .`
- Add dev dependencies by doing `pipenv install -d XXXX`
- Use `pipenv update -d` to compile concrete dependencies (and install
  them in a virtualenv)
- Add `Pipfile.lock` to source control for repeatable installations:
  https://caremad.io/posts/2013/07/setup-vs-requirement/
- Use `pipenv run` to run commands inside the venv (e.g. `pipenv run
  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 a0cbe60
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
"e1839a8" = {path = ".", editable = true}

[dev-packages]
ptpython = "*"
tox = "*"

[requires]
python_version = "3.6"
121 changes: 121 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a0cbe60

Please sign in to comment.