tox-dev / tox-pipenv

A pipenv plugin for Tox
MIT License
124 stars 30 forks source link

deps required to activate virtualenv #52

Closed alexcwatt closed 5 years ago

alexcwatt commented 6 years ago

I'm new to pipenv and thought I'd try tox-pipenv as well. However, it looks like tox-pipenv doesn't install the virtualenv managed by pipenv unless there are specified deps. Perhaps this is intentional, but I thought I'd be able to run tox with my dev dependencies (per #2) without needing to specify any additional deps.

Example

File: tox.ini

[tox]
envlist = pylint
skipsdist=True

[testenv:py36]
changedir = app
commands = python manage.py --settings=myapp.settings.test

In my application, this results in ModuleNotFoundError: No module named 'django' even though django is in my Pipfile and Pipfile.lock. However, simply adding deps = requests (an unrelated package) will cause tox-pipenv to work.

I think the culprit may be here ... should the pipenv be installed regardless? ... but I'm not too familiar with this project.

tonybaloney commented 5 years ago

You make a good point, if you don't have any deps in tox, then it won't run python -m pipenv install --dev which will means any Pipfile won't be read, nor will a requirements.txt.

It's unusual not to have any dependencies in tox.ini, but not impossible, so I might change this logic

tonybaloney commented 5 years ago

https://github.com/pypa/pipenv/blob/master/pipenv/cli/command.py#L212

This states that if no packages are provided, then install from Pipfile. Which supports what you're saying

GitHub
pypa/pipenv
Python Development Workflow for Humans. Contribute to pypa/pipenv development by creating an account on GitHub.
tonybaloney commented 5 years ago

Fixed in #56

alexcwatt commented 5 years ago

Awesome, thanks @tonybaloney!