How to combine per-env deps with requirements file with Tox?

I am trying to test certain versions of Python and Django, but also include a common PIP requirements file for additional dependencies for use in all cases.

As the docs explains, you do the first:

deps = django15: Django>=1.5,<1.6 django16: Django>=1.6,<1.7 py33-mysql: PyMySQL ; use if both py33 and mysql are in an env name py26,py27: urllib3 ; use if any of py26 or py27 are in an env name py{26,27}-sqlite: mock ; mocking sqlite in python 2.x 

and you do the second, like:

 deps = -r{toxinidir}/pip-requirements.txt -r{toxinidir}/pip-requirements-test.txt 

but how do you combine them?

If I try to define several depots, Tox gives me the error "duplicate name" deps ", but I see no way to combine the dictionary and the list of notations for deps.

I also tried:

 deps = -r{toxinidir}/pip-requirements.txt -r{toxinidir}/pip-requirements-test.txt django15: Django>=1.5,<1.6 django16: Django>=1.6,<1.7 

and although this does not give me any parsing error, when I go to run the test, I get the error:

ERROR: py27-django15: failed to install deps [-r / usr / local / myproject / pip-requirements.txt, -r / usr / local / myproject / pip-requirements-test.txt, Django> = 1.5, <1 , 6]; v = InvocationError ('/usr/local/myproject/.tox/py27-django15/bin/pip install -r / usr / local / myproject / pip-requirements.txt -r / usr / local / myproject / pip-requirements- test.txt Django> = 1.5, <1.6 (see / usr / local / myproject / .tox / py27-django15 / log / py27-django15-1.log) ', 1)

presumably because it interprets the requirements file as the literal name of the Python package.

+7
python django unit-testing python-unittest tox
source share

No one has answered this question yet.

See similar questions:

fifteen
Is there a way to have a conditional .txt requirements file for my platform Python application?

or similar:

5116
How to check if a file exists without exceptions?
3474
How to list all the catalog files?
2453
How to install pip on windows?
2112
How to copy a file in Python?
2028
How to read a file line by line in a list?
1676
How to install pip on macOS or OS X?
1414
How do you add a file in Python?
939
How to install packages using pip according to the requirements.txt file from the local directory?
one
Pycharm autocomplete not working in conda env
0
(Python Virtual Test Environment) doc openstack

All Articles