I'm trying to learn more about the details of configuring tox.ini files. In one of the files for the Jupyter project and in this demo project, rather than using the default python environments, they define new environments in the command:
The main concepts to understand here are:
if the environment that is run contains one of the factors listed before the colon than this is valid.
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:
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 contataining the factor
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