How to create tox.ini variables
<p>Is there a way to set arbitrary variables within tox.ini?</p>

<p>An example would be a project name that might be used in a variety of ways.  With a rather complex tox.ini, I find myself copy and pasting all over where I should just need to set a variable at the top.</p>

<p>For reference, an example tox.ini:</p>

<pre><code>[tox]
envlist = clean, py{27,35,py}, license, style
skipsdist = True
skip_missing_interpreters = True
sitepackages = False

[testenv:clean]
deps = coverage
skip_install = true
commands =
    hash -r
    find {toxinidir} -name '*.pyc' -delete
    find {toxinidir} -name '__pycache__' -delete
    coverage erase
    rm -Rf {toxinidir}/docs/_build {toxinidir}/docs/coverage {toxinidir}/docs/reports

[testenv]
passenv = *
whitelist_externals = *
install_command = {envpython} -m pip install -q --process-dependency-links {opts} {packages}
envdir = {env:WORKON_HOME}/tox-&lt;project_name&gt;/{envname}
sitepackages = False
recreate = True
commands =
    # hash -r
    py{27,35,py}: {envpython} -m pytest --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    smoke: {envpython} -m pytest -m smoke --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    unit: {envpython} -m pytest -m unit --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    integration: {envpython} -m pytest -m integration --long-running --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    requirements: {envpython} -m pytest --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    license: {envpython} -m pytest -m license --license --cov-append --html=docs/reports/{envname}-report.html {posargs}
    py{27,35,py}-smoke: {envpython} -m pytest -m smoke --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    py{27,35,py}-unit: {envpython} -m pytest -m unit --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    py{27,35,py}-integration: {envpython} -m pytest -m integration --long-running --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    py{27,35,py}-requirements: {envpython} -m pytest --cov-append --cov=&lt;project_name&gt; --html=docs/reports/{envname}-report.html {posargs}
    py{27,35,py}-license: {envpython} -m pytest -m license --cov-append --html=docs/reports/{envname}-report.html {posargs}
deps =
    --editable=file:///{toxinidir}[tests]
    --editable=file:///{toxinidir}
    py{27,35,py}-requirements: -r{toxinidir}/requirements.txt


[testenv:coverage-report]
deps = coverage
skip_install = true
whitelist_externals = *
commands =
    hash -r
    coverage combine
    coverage report -m

[testenv:docs]
sitepackages = False
whitelist_externals = *
recreate = True
deps = --editable=file:///{toxinidir}[docs]
commands =
    hash -r
    coverage html --directory=docs/coverage
    coverage html
    {envpython} setup.py build_sphinx

[testenv:style]
whitelist_externals = *
sitepackages = False
recreate = True
commands =
    py.test -q --flake8 &lt;project_name&gt;/ --html=docs/reports/{envname}-report.html {posargs}

[testenv:vagrant]
passenv = *
whitelist_externals = *
sitepackages = False
recreate = False
skip_install = true
changedir = {toxinidir}/provision/vagrant
commands =
    hash -r
    vagrant destroy --force
    vagrant up
</code></pre>