[tox]
envlist =
# Jython support pending 2.7 support, due 2012-07-15 or so.  See:
# http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html
#   py26,py27,pypy,jython,py32,py33,coverage,docs
    py26,py27,py27-pure,pypy,py32,py33,py33-pure,py34,coverage,docs

[testenv]
deps =
    zope.interface
    zope.testing
    zope.configuration
    zope.component
    zope.location
    zope.proxy
    zope.testrunner
commands =
    python setup.py test -q

[testenv:py27-pure]
basepython =
    python2.7
setenv =
    PURE_PYTHON = 1

[testenv:py33-pure]
basepython =
    python3.3
setenv =
    PURE_PYTHON = 1

[testenv:coverage]
basepython =
    python2.6
commands =
#   The installed version messes up nose's test discovery / coverage reporting
#   So, we uninstall that from the environment, and then install the editable
#   version, before running nosetests.
    pip uninstall -y zope.security
    python -c "import shutil; shutil.copyfile('src/zope/__init__.py', '{envdir}/lib/python2.6/site-packages/zope/__init__.py')"
    pip install -e .
    nosetests --with-xunit --with-xcoverage
deps =
    zope.interface
    zope.testing
    zope.configuration
    zope.component
    zope.location
    zope.proxy
    nose
    coverage
    nosexcover

[testenv:docs]
basepython =
    python3.3
commands =
    sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
    sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
deps =
    zope.interface
    zope.testing
    zope.configuration
    zope.component
    zope.location
    zope.proxy
    Sphinx
    repoze.sphinx.autointerface
