I have a tox.ini file and want to test on different django versions:
[tox]
envlist =
py27-django16-{[base]deps]
py32-django16-{[base]deps]
py27-django17-{[base]deps]
py32-django17-{[base]deps]
[base]
deps =
nose
[testenv]
commands =
{envpython} setup.py nosetests
basepython =
py27: python2.7
py32: python3.2
deps =
django16: Django>=1.6,<1.7
django17: Django>=1.7,<1.8
But it does not work and raise exception that invalid command 'nosetests'
, i think that because nose is not installed.
Your
tox.ini
has two problems:First: the generated environment names in envlist
As you see, nothing is done with your entries as the curly brackets are not closed. But even if they were closed the substitution would not be happening as the referral to the deps does not belong there. What you want to say to generate the right environments for your needs looks like this (if I guess your intentions correctly - otherwise please clarify in a comment):
This generates these environment names:
You can then use the factors (e.g.
py27
ordjango16
) to specify what has to happen when as you are doing it correctly already. It's hard to get your head around this concept, but this might get you started. Also have a look at the docs about this feature - IMO they explain it quite well.The main problem is that you need to refer to the deps where you need them - in the deps entry of your
testenv
section as outlined in the tox configuration specification.A minimal working example would be:
The adpated
tox.ini
from your question would now look like:In your case though - when you just want to install it in all environments you don't even need the detour through a
[base]
section. So the recommendedtox.ini
in your case would be: