[Pytest-commit] Issue #160: Python 3.3 envs not properly installing requirements (hpk42/tox)

Chris Hasenpflug issues-reply at bitbucket.org
Tue Mar 18 02:28:50 CET 2014


New issue 160: Python 3.3 envs not properly installing requirements
https://bitbucket.org/hpk42/tox/issue/160/python-33-envs-not-properly-installing

Chris Hasenpflug:

I have a private repo exhibiting this behavior, but I have been able to recreate it using several open source projects. For purposes of illustration I'm going to use https://github.com/django-extensions/django-extensions/.

To show the issue I have modified the tox.ini per this gist: https://gist.github.com/chrishas35/9611820.  I changed the commands to be as follows:

```
commands =
    {envpython} -V
    which django-admin.py
    django-admin.py version
    {envpython} setup.py test
```

Running `tox -r -e py27_django16` generates the following output for my additional commands:
```
#!

py27_django16 runtests: commands[0] | /Volumes/Data/Users/chris/Developer/django-extensions/.tox/py27_django16/bin/python -V
Python 2.7.6
py27_django16 runtests: commands[1] | which django-admin.py
WARNING:test command found but not installed in testenv
  cmd: /usr/bin/which
  env: /Volumes/Data/Users/chris/Developer/django-extensions/.tox/py27_django16
Maybe forgot to specify a dependency?
/Volumes/Data/Users/chris/Developer/django-extensions/.tox/py27_django16/bin/django-admin.py
py27_django16 runtests: commands[2] | django-admin.py version
1.6.1
```

Running `tox -r -e py33_django16` generates the following output for my additional commands:


```
#!

py33_django16 runtests: commands[0] | /Volumes/Data/Users/chris/Developer/django-extensions/.tox/py33_django16/bin/python -V
Python 3.3.5
py33_django16 runtests: commands[1] | which django-admin.py
WARNING:test command found but not installed in testenv
  cmd: /usr/bin/which
  env: /Volumes/Data/Users/chris/Developer/django-extensions/.tox/py33_django16
Maybe forgot to specify a dependency?
/usr/local/bin/django-admin.py
py33_django16 runtests: commands[2] | django-admin.py version
WARNING:test command found but not installed in testenv
  cmd: /usr/local/bin/django-admin.py
  env: /Volumes/Data/Users/chris/Developer/django-extensions/.tox/py33_django16
Maybe forgot to specify a dependency?
1.6.1
```

What started me down this path was the dependency warning for django-admin.py when I know it should be installed in the env.  The addition of `which django-admin.py` shows that Django has been not been installed into the env, but rather into my global python.

Verbose output shows that the installation is attempted with appropriate env pip:

```
#!
py33_django16 installdeps: Django==1.6.1   /Volumes/Data/Users/chris/Developer/django-extensions$ /Volumes/Data/Users/chris/Developer/django-extensions/.tox/py33_django16/bin/pip install --pre Django==1.6.1 >/Volumes/Data/Users/chris/Developer/django-extensions/.tox/py33_django16/log/py33_django16-1.log
```

Alas, it's not being installed to the env as `.tox/py33_django16/bin/pip freeze` returns an empty list.





More information about the pytest-commit mailing list