New issue 131: With pip: project's sdist package is only installed in testenv
during second test run
https://bitbucket.org/hpk42/tox/issue/131/with-pip-projects-sdist-package-is-only
jenisys:
VERSION INFO: tox 1.6.1, pip 1.4.1, virtualenv 0.10.1 (python 2.7)
When pip is used, the actual sdist package seems not to be installed when the
test environment is created. When you run tox again on the same test
environment it is installed and available (for example together with its
console scripts).
NOTE:
The required packages, that project depends on, are installed during the
"sdist" installation step (during the first step).
EXAMPLE:
Create a new test environment in TOX's "tox.ini" file:
# -- TOX tox.ini (extended with xxx environment)
[testenv:xxx]
changedir = {envdir}
commands=
tox --version
deps=
Then run this test environment:
shell> tox -e xxx -r
GLOB sdist-make: .../tox/setup.py
xxx recreate: .../tox/.tox/xxx
xxx inst: .../tox/.tox/dist/tox-1.6.2.dev2.zip
xxx runtests: commands[0] | tox --version
WARNING:test command found but not installed in testenv
cmd: /Library/Frameworks/Python.framework/Versions/2.7/bin/tox
env: .../tox/.tox/xxx
Maybe forgot to specify a dependency?
1.6.1 imported from
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox-1.6.1-py2.7.egg/tox/__init__.pyc
==> OOPS: Initial tox is used, not the one under test.
shell> tox -e xxx
GLOB sdist-make: .../tox/setup.py
xxx inst-nodeps: .../tox/.tox/dist/tox-1.6.2.dev2.zip
xxx runtests: commands[0] | tox --version
1.6.2.dev2 imported from
.../tox/.tox/xxx/lib/python2.7/site-packages/tox/__init__.pyc
IMPACT:
This behavior is the killer if the console scripts of the python package should
be used during the test run. Check also that after the first round (with
recreate):
* the tox sdist package is not under virtualenv site-package directory
* "pip list" also states that package is not installed
* the tox script is not in the .tox/xxx/bin directory
I am not sure if this is a pip problem or tox problem or a combination of both
but it currently kills my use case.
WORKAROUND:
Add a "python setup.py -q install" as first command to ensure that project
package is installed. But then you install it twice :-(
_______________________________________________
pytest-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-commit