[Pytest-commit] Issue #168: Tox fails installing sdist in python3.3 (hpk42/tox)
dwt
issues-reply at bitbucket.org
Fri Apr 25 12:39:54 CEST 2014
New issue 168: Tox fails installing sdist in python3.3
https://bitbucket.org/hpk42/tox/issue/168/tox-fails-installing-sdist-in-python33
dwt:
I'm hosting tox on python 2.7and am getting errors like this:
```
#!shell
tox
GLOB sdist-make: /Users/dwt/Code/Projekte/pyexpect/setup.py
py26 inst-nodeps: /Users/dwt/Code/Projekte/pyexpect/.tox/dist/pyexpect-1.0.5.zip
py26 runtests: PYTHONHASHSEED='3320894281'
py26 runtests: commands[0] | /Users/dwt/Code/Projekte/pyexpect/.tox/py26/bin/python pyexpect.py
..................................
----------------------------------------------------------------------
Ran 34 tests in 0.245s
OK
py27 inst-nodeps: /Users/dwt/Code/Projekte/pyexpect/.tox/dist/pyexpect-1.0.5.zip
py27 runtests: PYTHONHASHSEED='3320894281'
py27 runtests: commands[0] | /Users/dwt/Code/Projekte/pyexpect/.tox/py27/bin/python pyexpect.py
..................................
----------------------------------------------------------------------
Ran 34 tests in 0.182s
OK
Traceback (most recent call last):
File "/Users/dwt/Library/Python/2.7/bin/tox", line 9, in <module>
load_entry_point('tox==1.7.1', 'console_scripts', 'tox')()
File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/_cmdline.py", line 26, in main
retcode = Session(config).runcommand()
File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/_cmdline.py", line 303, in runcommand
return self.subcommand_test()
File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/_cmdline.py", line 440, in subcommand_test
if self.setupenv(venv):
File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/_cmdline.py", line 370, in setupenv
envlog.set_python_info(commandpath)
File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/result.py", line 47, in set_python_info
"import sys; "
File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/py-1.4.20-py2.7.egg/py/_path/local.py", line 673, in sysexec
stdout, stderr,)
py.process.cmdexec.Error: ExecutionFailed: 1 /Users/dwt/Code/Projekte/pyexpect/.tox/py33/bin/python
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
PYTHONPATH is currently: "/sw/lib/python2.6/site-packages:/Users/dwt/Library/Homebrew/lib/python2.7/site-packages"
You should `unset PYTHONPATH` to fix this.
```
This is what my .tox-file looks
```
[tox]
envlist = py26, py27, py33
#, pypy
[testenv]
commands = {envpython} pyexpect.py
[testenv:py33]
setenv =
PYTHONPATH =
```
As far as I can tell, what is missing is that at https://bitbucket.org/hpk42/tox/src/0c390972b576b50dc0e78bd5cbb8e6a164f15f8b/tox/result.py?at=default#cl-46 the call to pythonexecutable.sysexec() is missing the environment variable ```PYTHONPATH=''``` that is set in the setenv line in the tox file. I don't however understand how to do that. :/ So no patch from me for now.
Just quickly splicing in a ```env=dict(PYTHONPATH='')``` into that call seems to work around the issue.
Do you need any more information to fix this?
More information about the pytest-commit
mailing list