-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
112 lines (102 loc) · 4.71 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[tox]
envlist = quality,py38-palm,py{38,311}-redwood
[doc8]
; D001 = Line too long
ignore = D001
[pycodestyle]
exclude = .git,.tox,migrations
max-line-length = 120
[pydocstyle]
; D101 = Missing docstring in public class
; D200 = One-line docstring should fit on one line with quotes
; D203 = 1 blank line required before class docstring
; D212 = Multi-line docstring summary should start at the first line
; D215 = Section underline is over-indented (numpy style)
; D404 = First word of the docstring should not be This (numpy style)
; D405 = Section name should be properly capitalized (numpy style)
; D406 = Section name should end with a newline (numpy style)
; D407 = Missing dashed underline after section (numpy style)
; D408 = Section underline should be in the line following the section's name (numpy style)
; D409 = Section underline should match the length of its name (numpy style)
; D410 = Missing blank line after section (numpy style)
; D411 = Missing blank line before section (numpy style)
; D412 = No blank lines allowed between a section header and its content (numpy style)
; D413 = Missing blank line after last section (numpy style)
; D414 = Section has no content (numpy style)
ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414
match-dir = (?!migrations)
[pytest]
addopts = --cov futurex_openedx_extensions --cov tests --cov-report term-missing --cov-report xml --cov-fail-under=100
norecursedirs = .* docs requirements site-packages
[testenv]
skip_install = true
allowlist_externals =
rm
setenv =
palm: DJANGO_SETTINGS_MODULE = test_settings_palm
palm: PYTEST_COV_CONFIG = {toxinidir}/.coveragerc-palm
redwood: DJANGO_SETTINGS_MODULE = test_settings_redwood
redwood: PYTEST_COV_CONFIG = {toxinidir}/.coveragerc-redwood
deps =
palm: -c{toxinidir}/requirements/test-constraints-palm.txt
redwood: -c{toxinidir}/requirements/test-constraints-redwood.txt
-r{toxinidir}/requirements/test.in
-e{toxinidir}/test_utils/edx_platform_mocks_shared
palm: -e{toxinidir}/test_utils/edx_platform_mocks_palm
redwood: -e{toxinidir}/test_utils/edx_platform_mocks_redwood
commands =
rm -Rf {toxinidir}/test_utils/edx_platform_mocks_shared/fake_models/migrations
rm -Rf {toxinidir}/test_utils/edx_platform_mocks_palm/fake_models/migrations
rm -Rf {toxinidir}/test_utils/edx_platform_mocks_redwood/fake_models/migrations
python manage.py makemigrations fake_models
python manage.py check
pytest {posargs} --cov-config={env:PYTEST_COV_CONFIG}
[testenv:docs]
setenv =
palm: DJANGO_SETTINGS_MODULE = test_settings_palm
redwood: DJANGO_SETTINGS_MODULE = test_settings_redwood
PYTHONPATH = {toxinidir}
# Adding the option here instead of as a default in the docs Makefile because that Makefile is generated by shpinx.
SPHINXOPTS = -W
allowlist_externals =
make
rm
deps =
-r{toxinidir}/requirements/doc.in
commands =
doc8 --ignore-path docs/_build README.rst docs
rm -f docs/futurex_openedx_extensions.rst
rm -f docs/modules.rst
make -e -C docs clean
make -e -C docs html
python -m build --wheel
twine check dist/*
[testenv:quality]
basepython = python3.8
deps =
-c{toxinidir}/requirements/test-constraints-palm.txt
-r{toxinidir}/requirements/quality.in
-e{toxinidir}/test_utils/edx_platform_mocks_shared
commands =
flake8 futurex_openedx_extensions tests test_utils manage.py
mypy futurex_openedx_extensions manage.py
pycodestyle futurex_openedx_extensions tests test_utils manage.py
pydocstyle futurex_openedx_extensions tests test_utils manage.py
; quality check for everything expect upgrade module. using palm mocks
;(note: anything outside upgrade module is shared between all releases)
pip install -e {toxinidir}/test_utils/edx_platform_mocks_palm
pylint futurex_openedx_extensions tests test_utils manage.py --ignore-paths="^futurex_openedx_extensions/upgrade/"
; quality check for upgrade module - palm only
pylint futurex_openedx_extensions/upgrade --ignore-paths="^futurex_openedx_extensions/upgrade/releases/(?!palm/).*"
; quality check for upgrade module - redwood only
pip uninstall -y edx_platform_mocks_palm
pip install -e {toxinidir}/test_utils/edx_platform_mocks_redwood
pylint futurex_openedx_extensions/upgrade --ignore-paths="^futurex_openedx_extensions/upgrade/releases/(?!redwood/).*"
isort --check-only --diff tests test_utils manage.py futurex_openedx_extensions test_settings_palm.py test_settings_redwood.py
[testenv:pii_check]
setenv =
DJANGO_SETTINGS_MODULE = test_settings_palm
deps =
-r{toxinidir}/requirements/test.in
commands =
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage