The main concepts to understand here are:
- Generating environments, conditional settings
if the environment that is run contains one of the factors listed before the colon then this is valid.
- Environment variable substitutions with default values
The elements in the curly braces get replaced depending on the state of environment variables set in the shell tox is run in.
Putting it together the meaning of your snippet is:
py27: {env:TOXPYTHON:python2.7}
If the factor py27
is part of the tox environment name (e.g "py27-unittests") use as basepython either the value if the environment variable TOXPYTHON or the literal "python2.7" if the environment variable is not set.
Same principle is valid for environments containing the factor py33
.
The advantage is that you as a developer working on this can set the TOXPYTHON environment variable according to your needs in case python2.7 or python3.3 are not in your path. This is (I guess) a result of tox having some weak spots regarding interpreter discovery on the different Osses and distributions. See: https://github.com/tox-dev/tox/projects/3