edesz
edesz

Reputation: 12406

tox.ini environment with multiple dependencies

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?

Upvotes: 4

Views: 2414

Answers (1)

phd
phd

Reputation: 94512

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

Upvotes: 3

Related Questions