Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tox.ini environment with multiple dependencies

Tags:

python-3.x

tox

I am trying to specify multiple dependencies in my tox.ini file based on this example in the docs. Here is my tox.ini file

[tox]
envlist = {py27,py36}-dj{a,b}

[testenv]
deps =
    pytest
    dja: Django
    djb: numpy, pandas
commands = ...

As you can see the environment djb has multiple dependencies listed on the same line.

When I run tox using

tox -e py36-djb

I get this error message

djb installdeps: numpy,pandas
ERROR: invocation failed (exit code 1), logfile: /.../.tox/djb/log/djb-1.log

I think the problem is that (for djb) multiple dependencies are listed on the same line, but I'm not sure if there is an alternative method to install multiple python packages into only that environment.

How can I specify multiple dependencies for one environment (djb) in tox.ini?

like image 607
edesz Avatar asked Oct 15 '25 18:10

edesz


1 Answers

Try space instead of comma:

[testenv]
deps =
    djb: numpy pandas

Or newline:

[testenv]
deps =
    djb:
        numpy
        pandas

Or list the dependencies separately:

[testenv]
deps =
    djb: numpy
    djb: pandas

Or put the dependencies into a file req.txt:

echo "\
numpy
pandas" > req-djb.txt

and install them:

[testenv]
deps = -rreq-djb.txt
like image 157
phd Avatar answered Oct 18 '25 02:10

phd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!