summaryrefslogtreecommitdiff
path: root/tox.ini
blob: e360c259456ed042001db34cdacd54c8fa07960d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
[tox]
envlist = py{27,33,34,35,36,py}, docs, style


[testenv]
setenv =
    JSON_SCHEMA_TEST_SUITE = {toxinidir}/json
whitelist_externals =
    python2.7
    sh
    virtualenv
commands =
    py{27,35,py,py3}: {envbindir}/trial [] jsonschema

    {envpython} -m doctest {toxinidir}/README.rst
    py{27,35}: {envbindir}/sphinx-build -b doctest {toxinidir}/docs {envtmpdir}/html

    # Check to make sure that releases build and install properly
    virtualenv --quiet --python=python2.7 {envtmpdir}/venv
    {envtmpdir}/venv/bin/pip install --quiet wheel

    {envtmpdir}/venv/bin/python {toxinidir}/setup.py --quiet bdist_wheel --dist-dir={envtmpdir}/wheel
    sh -c '{envbindir}/pip install --quiet --upgrade --force-reinstall {envtmpdir}/wheel/jsonschema*.whl'

    python2.7 {toxinidir}/setup.py --quiet sdist --dist-dir={envtmpdir}/sdist --format=gztar,zip
    sh -c '{envbindir}/pip install --quiet --upgrade --force-reinstall {envtmpdir}/sdist/jsonschema*.tar.gz'
    sh -c '{envbindir}/pip install --quiet --upgrade --force-reinstall {envtmpdir}/sdist/jsonschema*.zip'
deps =
    -e{toxinidir}[format]

    py{27,35,py,py3},coverage: twisted
    coverage: coverage

    py{27,py,py3},coverage: mock

    py{27,35}: lxml
    py{27,35,py}: sphinx


[testenv:coverage]
commands =
    coverage run --branch --source {toxinidir}/jsonschema [] {envbindir}/trial jsonschema
    coverage report --show-missing
    coverage html


[testenv:docs]
basepython = python
changedir = docs
deps =
    -r{toxinidir}/docs/doc-requirements.txt
commands =
    sphinx-build [] -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html


[testenv:perf]
basepython = pypy
deps =
    -e{toxinidir}[format]
    perf
commands =
    {envpython} {toxinidir}/benchmarks/test_suite.py


[testenv:style]
basepython = pypy
deps = ebb-lint
commands = flake8 {posargs} {toxinidir}/jsonschema benchmarks/


[flake8]
exclude = jsonschema/_reflect.py