diff options
Diffstat (limited to 'tox.ini')
-rw-r--r-- | tox.ini | 119 |
1 files changed, 113 insertions, 6 deletions
@@ -1,9 +1,116 @@ [tox] -minversion = 1.6 -envlist = sanity +envlist = + py{36,37,38,py3}-{noextra,format,format_nongpl}-{build,tests}, + readme + safety + secrets + style + docs-{html,doctest,linkcheck,spelling,style} skipsdist = True -[testenv:sanity] -# used just for validating the structure of the test case files themselves -deps = jsonschema>=3.2.0 -commands = {envpython} bin/jsonschema_suite check +[testenv] +changedir = {envtmpdir} +passenv = CODECOV* CI +setenv = + JSON_SCHEMA_TEST_SUITE = {toxinidir}/json + + coverage,codecov: MAYBE_COVERAGE = coverage run -m + coverage,codecov: COVERAGE_RCFILE={toxinidir}/.coveragerc + coverage,codecov: COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug + coverage,codecov: COVERAGE_FILE={envtmpdir}/coverage-data +whitelist_externals = + mkdir +commands = + noextra: {envpython} -m pip install {toxinidir} + format: {envpython} -m pip install '{toxinidir}[format]' + format_nongpl: {envpython} -m pip install '{toxinidir}[format_nongpl]' + + tests,coverage,codecov: {envpython} -m {env:MAYBE_COVERAGE:} twisted.trial {posargs:jsonschema} + tests: {envpython} -m doctest {toxinidir}/README.rst + + coverage: {envpython} -m coverage report --show-missing + coverage: {envpython} -m coverage html --directory={envtmpdir}/htmlcov + codecov: {envpython} -m coverage xml -o {envtmpdir}/coverage.xml + codecov: codecov --required --disable gcov --file {envtmpdir}/coverage.xml + + perf: mkdir {envtmpdir}/benchmarks/ + perf: {envpython} {toxinidir}/jsonschema/benchmarks/issue232.py --inherit-environ JSON_SCHEMA_TEST_SUITE --output {envtmpdir}/benchmarks/issue232.json + perf: {envpython} {toxinidir}/jsonschema/benchmarks/json_schema_test_suite.py --inherit-environ JSON_SCHEMA_TEST_SUITE --output {envtmpdir}/benchmarks/json_schema_test_suite.json + + build: {envpython} -m pep517.check {toxinidir} +deps = + build: pep517 + + perf: pyperf + + tests,coverage,codecov: twisted + + coverage,codecov: coverage + codecov: codecov + +[testenv:bandit] +deps = bandit +commands = {envbindir}/bandit --recursive {toxinidir}/jsonschema + +[testenv:readme] +deps = + docutils + pep517 + twine +commands = + {envpython} -m pep517.build --out-dir {envtmpdir}/dist {toxinidir} + {envpython} -m twine check {envtmpdir}/dist/* + {envbindir}/rst2html5.py --halt=warning {toxinidir}/CHANGELOG.rst /dev/null + +[testenv:safety] +deps = safety +commands = + {envpython} -m pip install '{toxinidir}[format]' + {envpython} -m safety check + +[testenv:secrets] +deps = detect-secrets +commands = {envbindir}/detect-secrets scan {toxinidir} + +[testenv:style] +basepython = pypy3 +deps = + ebb-lint>=0.19.1.0 +commands = + {envpython} -m flake8 {posargs} {toxinidir}/jsonschema {toxinidir}/docs + +[testenv:docs-html] +basepython = pypy3 +commands = {envpython} -m sphinx -b html {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} +deps = + -r{toxinidir}/docs/requirements.txt + {toxinidir} + +[testenv:docs-doctest] +basepython = pypy3 +commands = {envpython} -m sphinx -b doctest {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} +deps = + -r{toxinidir}/docs/requirements.txt + {toxinidir} + +[testenv:docs-linkcheck] +basepython = pypy3 +commands = {envpython} -m sphinx -b linkcheck {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} +deps = + -r{toxinidir}/docs/requirements.txt + {toxinidir} + +[testenv:docs-spelling] +basepython = pypy3 +commands = {envpython} -m sphinx -b spelling {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -T -W} +deps = + -r{toxinidir}/docs/requirements.txt + {toxinidir} + +[testenv:docs-style] +basepython = pypy3 +commands = doc8 {posargs} {toxinidir}/docs +deps = + doc8 + pygments + pygments-github-lexers |