How can tox install the modules via the requirements file?

waitingkuo picture waitingkuo · Sep 4, 2012 · Viewed 20.4k times · Source

Our python project has a requirements.txt file which lists some dependent module. We used to use

pip install -r requirements.txt

to install these dependencies. We are now using tox to build up the test environment. My question is that how can we install the modules via requirements.txt directly.

Followings are our tox.ini and requirements.txt:

tox.ini:

[tox]
envlist=py27
[testenv]
deps=pytest
     boto
commands=py.test

rquirements.txt:

boto

Is any way to remove the "boto" from tox.ini and add something like

deps_files=requirements.txt

Answer

Denis picture Denis · Sep 4, 2012
 deps = -r{toxinidir}/tools/pip-requires
        -r{toxinidir}/tools/test-requires