[tox] min_version = 4.0.9 envlist = py{38,39,310,311,py3}-{noextra,format,formatnongpl}-{build,tests} {noextra,format,formatnongpl}-audit readme secrets style typing docs-{dirhtml,doctest,linkcheck,spelling,style} skipsdist = True [testenv] changedir = {envtmpdir} passenv = CI, GITHUB_STEP_SUMMARY, PYTHONUTF8 setenv = PIP_DISABLE_PIP_VERSION_CHECK = 1 JSON_SCHEMA_TEST_SUITE = {toxinidir}/json coverage,ghcoverage: MAYBE_COVERAGE=coverage run -m coverage,ghcoverage: COVERAGE_RCFILE={toxinidir}/.coveragerc coverage,ghcoverage: COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug coverage,ghcoverage: COVERAGE_FILE={envtmpdir}/coverage-data allowlist_externals = mkdir sh commands = noextra: {envpython} -m pip install --quiet {toxinidir} format,perf: {envpython} -m pip install --quiet '{toxinidir}[format]' formatnongpl: {envpython} -m pip install --quiet '{toxinidir}[format-nongpl]' audit: {envpython} -m pip_audit audit-formatnongpl: {envpython} -m piplicenses {posargs} --ignore-packages pip-requirements-parser pip_audit pip-api --allow-only="Apache Software License;ISC License (ISCL);MIT License;BSD License;Mozilla Public License 2.0 (MPL 2.0);Python Software Foundation License" build: {envpython} -m build {toxinidir} --outdir {envtmpdir}/dist tests,coverage,ghcoverage: {envpython} -Werror -m {env:MAYBE_COVERAGE:} virtue {posargs:jsonschema} tests: {envpython} -m doctest {toxinidir}/README.rst coverage: {envpython} -m coverage report --show-missing coverage: {envpython} -m coverage html --directory={envtmpdir}/htmlcov ghcoverage: sh {toxinidir}/.github/coverage.sh "{envpython}" perf-create: {envpython} {toxinidir}/jsonschema/benchmarks/validator_creation.py {posargs:--output {envtmpdir}/bench-create.json} perf-232: {envpython} {toxinidir}/jsonschema/benchmarks/issue232.py {posargs:--output {envtmpdir}/bench-issue232.json} perf-suite: {envpython} {toxinidir}/jsonschema/benchmarks/json_schema_test_suite.py --inherit-environ JSON_SCHEMA_TEST_SUITE {posargs:--output {envtmpdir}/bench-json_schema_test_suite.json} deps = audit: pip-audit audit-formatnongpl: pip-licenses build: build perf: pyperf tests,coverage,ghcoverage: virtue coverage,ghcoverage: coverage>=7.0.0b1 [testenv:bandit] deps = bandit commands = {envbindir}/bandit --recursive {toxinidir}/jsonschema [testenv:readme] deps = build docutils twine commands = {envpython} -m build --outdir {envtmpdir}/dist {toxinidir} {envpython} -m twine check {envtmpdir}/dist/* {envbindir}/rst2html5.py --halt=warning {toxinidir}/CHANGELOG.rst /dev/null [testenv:secrets] deps = detect-secrets commands = {envbindir}/detect-secrets scan {toxinidir} [testenv:style] deps = ruff commands = {envpython} -m ruff check {toxinidir} [testenv:typing] skip_install = true deps = # FIXME: Why are we repeating dependencies here? attrs mypy types-requests commands = {envpython} -m mypy --config {toxinidir}/pyproject.toml {posargs} {toxinidir}/jsonschema [testenv:docs-dirhtml] commands = {envpython} -m sphinx -b dirhtml {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} deps = -r{toxinidir}/docs/requirements.txt [testenv:docs-doctest] commands = {envpython} -m sphinx -b doctest {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} deps = {[testenv:docs-dirhtml]deps} [testenv:docs-linkcheck] commands = {envpython} -m sphinx -b linkcheck {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -q -T -W} deps = {[testenv:docs-dirhtml]deps} [testenv:docs-spelling] commands = {envpython} -m sphinx -b spelling {toxinidir}/docs/ {envtmpdir}/build {posargs:-a -n -T -W} deps = {[testenv:docs-dirhtml]deps} [testenv:docs-style] commands = doc8 --max-line-length 1000 {posargs} {toxinidir}/docs deps = doc8 pygments pygments-github-lexers