-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
76 lines (70 loc) · 1.81 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
[tox]
# Having the .tox directory in the project directory slows down the
# `pip install -e .` step required by `usedevelop = true` considerably.
# By moving it out of the way (~500MB), we trim test execution time by > 80%.
toxworkdir = {homedir}/.toxenvs/django-multisite-plus
envlist =
clean,
test-py{36,37,38,39,310}-django{22,32},
test-py{38,39,310}-django{40},
lint,
manifest,
coverage
isolated_build = true
[testenv]
depends = test: clean
docker = test: postgres
deps =
test: pytest
test: pytest-cov
test: pytest-django
django22: django>=2.2,<2.3
django32: django>=3.2,<3.3
django40: django<=4.0,<4.1
# django41: django>=4.1,<4.2
# django42: django>=4.2,<4.3
commands =
test: pytest ./tests {posargs}
setenv =
COVERAGE_FILE = .artifacts/coverage.{env:TOX_ENV_NAME}
DJANGO_SETTINGS_MODULE = testproject.settings
[testenv:manifest]
deps = check-manifest
commands = check-manifest
skip_install = true
[testenv:lint]
deps =
black
isort
flake8
commands =
isort --check-only .
black --check src/django_multisite_plus
flake8 --ignore=E501,E722,E402,W503,E203 .
skip_install = true
[testenv:clean]
deps = coverage[toml]
commands = coverage erase
skip_install = true
[testenv:coverage]
depends = test-py{36,37,38,39,310}-django{22,32,40},clean
deps = coverage[toml]
commands =
coverage combine .artifacts/
coverage html
coverage report
setenv =
COVERAGE_FILE = .artifacts/coverage
skip_install = true
[docker:postgres]
image = postgres:13-alpine
environment =
POSTGRES_HOST_AUTH_METHOD=trust
healthcheck_cmd = psql \
--user=postgres --dbname=postgres \
--host=127.0.0.1 --quiet --no-align --tuples-only \
-1 --command="SELECT 1"
healthcheck_timeout = 1
healthcheck_retries = 30
healthcheck_interval = 1
healthcheck_start_period = 1