Integration with ` test` should not require `virtualenv` to be installed

Issue #330 on hold
Peter Bittner created an issue

In my Python projects I want to separate the requirements only needed for testing cleanly from the actual project.

The beautiful thing of tox is I can specify all those additional requirements in the tox configuration (tox.ini), and with the integration in it's possible to not even have tox installed to execute tests.

Actually, this is the theory, because unfortunately, running tests with python test still requires one dependency to be installed beforehand: virtualenv

Current Behavior

$ python test
running test
Searching for tox
Best match: tox 2.3.1
Processing tox-2.3.1.tar.gz
Writing /tmp/easy_install-2zqkvsk9/tox-2.3.1/setup.cfg
Running tox-2.3.1/ -q bdist_egg --dist-dir /tmp/easy_install-2zqkvsk9/tox-2.3.1/egg-dist-tmp-f202aq90
Installed /home/user/repos/my-project/.eggs/tox-2.3.1-py3.4.egg
Searching for pluggy<0.4.0,>=0.3.0
Best match: pluggy 0.3.1
Processing pluggy-0.3.1.tar.gz
Writing /tmp/easy_install-p0d1rfyw/pluggy-0.3.1/setup.cfg
Running pluggy-0.3.1/ -q bdist_egg --dist-dir /tmp/easy_install-p0d1rfyw/pluggy-0.3.1/egg-dist-tmp-gsv46avp
Installed /home/user/repos/my-project/.eggs/pluggy-0.3.1-py3.4.egg
Searching for py>=1.4.17
Best match: py 1.4.31
Processing py-1.4.31.tar.gz
Writing /tmp/easy_install-ax6qj5s2/py-1.4.31/setup.cfg
Installed /home/user/repos/my-project/.eggs/py-1.4.31-py3.4.egg
Searching for virtualenv>=1.11.2
Best match: virtualenv 15.0.1
Processing virtualenv-15.0.1.tar.gz
Writing /tmp/easy_install-qkl88xj8/virtualenv-15.0.1/setup.cfg
Installed /home/user/repos/my-project/.eggs/virtualenv-15.0.1-py3.4.egg
running egg_info
creating my_project.egg-info
writing my_project.egg-info/PKG-INFO
writing manifest file 'my_project.egg-info/SOURCES.txt'
running build_ext
GLOB sdist-make: /home/user/repos/my-project/
flake8 create: /home/user/repos/my-project/.tox/flake8
ERROR: invocation failed (exit code 1), logfile: /home/user/repos/my-project/.tox/flake8/log/flake8-0.log
ERROR: actionid: flake8
msg: getenv
cmdargs: ['/home/user/.virtualenvs/my-project/bin/python', '-m', 'virtualenv', '--python', '/home/user/.virtualenvs/my-project/bin/python3.4', 'flake8']
env: {...}

/home/user/.virtualenvs/my-project/bin/python: No module named virtualenv

ERROR: InvocationError: /home/user/.virtualenvs/my-project/bin/python -m virtualenv --python /home/user/.virtualenvs/my-project/bin/python3.4 flake8 (see /home/user/repos/my-project/.tox/flake8/log/flake8-0.log)
_____________________________________________________________________________________ summary ______________________________________________________________________________________
ERROR:   flake8: InvocationError: /home/user/.virtualenvs/my-project/bin/python -m virtualenv --python /home/user/.virtualenvs/my-project/bin/python3.4 flake8 (see /home/user/repos/my-project/.tox/flake8/log/flake8-0.log)

When I run pip install virtualenv the same testrun runs like a charm.

Is this a problem of tox, or an issue of setuptools?

Expected Behavior

After having set up tox with setuptools integration it should be possible to run python test to execute tests driven by tox without having had to install any requirements (such as virtualenv or tox) manually beforehand.


This problem is also documented in issue #245.

Comments (5)

  1. Peter Bittner reporter

    @hpk42 Is this problem known to the tox project?

    I've been contacted privately by people that also face this issue. (Not sure why they don't post here.) - Is there anything I can contribute to have this fixed?

  2. Peter Bittner reporter

    Looks like for some reason the virtualenv module is not found in the PYTHONPATH directly after being installed by setuptools.

  3. Log in to comment