Use --dev flag in install
edubxb opened this issue · 4 comments
First of all, thanks for this plugin, very handy, simplifies pipenv usage in tox a lot.
Due the existence of the dev packages in Pipfiles, I think that this plugin should use it, so the call to pipenv would be:
pipenv install --dev
In my case I use pytest for testing, is a develompent dependency, no a distribution one, so, when I run tox, the test environment fails because pytest isn't installed. Of course, I can add pytest as dependency in tox config, but using pipenv for this is more elegant solution IMHO.
What do you think?
Thanks!
Ah, yeah that makes sense. I put my dev dependencies in the tox file, but in other projects they are in a seperate dev dependency.
I'll add this change 👍
Released in https://github.com/tonybaloney/tox-pipenv/tree/1.1.0 1.1.0 on PyPi.
I still had to "pipenv install --dev" in my tox.ini commands.
Otherwise, Travis is not installing the [dev-packages]
What am I doing wrong?
[tox]
envlist = py{27,
34,
35,
36,
#37,
}
[testenv]
commands =
pipenv install --dev
pytest
pylint my_code
I have mixed feelings about the --dev
option, aka the [dev-packages]
section in Pipfile
. My typical use of --dev
is to install Tox (and Tox plugins, if needed), nothing else. This is because I encapsulate all requirements for running the tests in the tox.ini
file, via deps =
in the separate sections.
# -- FILE: tox.ini -- Illustrative Example
[tox]
envlist =
flake8
pylint
py36
behave
[testenv]
deps = pytest
commands = pytest
[testenv:behave]
deps = behave
commands = behave
[testenv:flake8]
deps = flake8
commands = flake8
[testenv:pylint]
deps = pylint
commands = pylint --rcfile tox.ini {posargs:application}
--dev
would be for anything I want to install before running Tox. If this plugin installs everything --dev
installs for each section in Tox I get a lot of unneeded packages installed for linting and tests. This is a different use case than installing packages for local development (e.g. for IDE support).