-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
tox.ini
95 lines (85 loc) · 2.92 KB
/
tox.ini
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
[tox]
minversion=2.9.0
envlist = py310,lint,docs
skipsdist = True
[testenv]
description = run test suite for the application with {basepython}
setenv =
PYTHONPATH={toxinidir}/readthedocs:{toxinidir}
DJANGO_SETTINGS_MODULE=readthedocs.settings.test
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
DJANGO_SETTINGS_SKIP_LOCAL=True
passenv = CI,TRAVIS,TRAVIS_*,HOME
deps =
-r requirements/testing.txt
basepython =
python3.10
# https://pytest-cov.readthedocs.io/en/latest/debuggers.html
# https://github.com/microsoft/vscode-python/issues/693
commands =
sh -c '\
export DJANGO_SETTINGS_MODULE=readthedocs.settings.test; \
pytest {env:PYTEST_COVERAGE} --pyargs readthedocs --suppress-no-test-exit-code -m "not proxito and not embed_api" {posargs:{env:TOX_POSARGS:-m "not search and not proxito and not embed_api"}}'
sh -c '\
export DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito.test; \
pytest {env:PYTEST_COVERAGE} --pyargs readthedocs -m proxito --suppress-no-test-exit-code {posargs}'
allowlist_externals =
sh
git
[testenv:ext-theme]
setenv =
PYTHONPATH={toxinidir}/readthedocs:{toxinidir}:{envdir}/
DJANGO_SETTINGS_MODULE=readthedocs.settings.test
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
DJANGO_SETTINGS_SKIP_LOCAL=True
RTD_EXT_THEME_ENABLED=True
deps =
-r requirements/testing.txt
readthedocsext-theme@git+https://github.com/readthedocs/ext-theme.git@main
# This is NOT run in CI builds, it can be used locally for convenience
[testenv:docs]
description = Build readthedocs user documentation
changedir = {toxinidir}/docs
deps =
-r{toxinidir}/requirements/docs.txt
setenv =
PROJECT=user
commands =
sphinx-build -W --keep-going -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
# This is NOT run in CI builds, it can be used locally for convenience
[testenv:docs-dev]
description = Build readthedocs developer documentation
changedir = {toxinidir}/docs
deps =
-r{toxinidir}/requirements/docs.txt
setenv =
PROJECT=dev
commands =
sphinx-build -W --keep-going -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:migrations]
description = check for missing migrations
commands =
{base_python} manage.py makemigrations --check --dry-run
[testenv:pre-commit]
description = run pre-commit to ensure the changes are valid against our lintings
deps =
pre-commit
commands =
# FIXME: use `github.event.pull_request.base.sha` in `--from-ref` because if
# the base branch is different, this won't work as expected
pre-commit run --from-ref main --to-ref HEAD --show-diff-on-failure
[testenv:eslint]
allowlist_externals = npm
description = run the JavaScript linter (requires `npm install`)
commands =
npm run lint
[testenv:coverage]
description = shows the coverage report
deps = coverage
allowlist_externals = echo
commands =
coverage report --show-missing
coverage html
echo Annotated HTML coverage report is in {toxinidir}/htmlcov/index.html