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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
[tox]
envlist =
py{37,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 =
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
whitelist_externals =
mkdir
sh
commands =
noextra: {envpython} -m pip install --disable-pip-version-check {toxinidir}
format,perf,perfsuite: {envpython} -m pip install --disable-pip-version-check '{toxinidir}[format]'
formatnongpl: {envpython} -m pip install --disable-pip-version-check '{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)"
build: {envpython} -m build {toxinidir} --outdir {envtmpdir}/dist
tests,coverage,ghcoverage: {envpython} -Werror -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
ghcoverage: sh -c "printf '### Coverage\n\n' >>$GITHUB_STEP_SUMMARY && {envpython} -m coverage report --format=markdown --show-missing >>$GITHUB_STEP_SUMMARY"
perf: {envpython} {toxinidir}/jsonschema/benchmarks/issue232.py --inherit-environ JSON_SCHEMA_TEST_SUITE {posargs:--output {envtmpdir}/bench-issue232.json}
perfsuite: {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,perfsuite: pyperf
tests,coverage,ghcoverage: twisted
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 =
flake8
flake8-broken-line
flake8-bugbear
flake8-commas
flake8-quotes
flake8-tidy-imports
commands =
{envpython} -m flake8 {posargs} {toxinidir}/jsonschema {toxinidir}/docs
[testenv:typing]
skip_install = true
deps =
# FIXME: Why are we repeating dependencies here?
attrs
mypy
pyrsistent
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
|