-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathtox.ini
91 lines (85 loc) · 2.55 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
[tox]
envlist =
py311{,-storage-credentials},
py312{,-storage-credentials},
py313{,-storage-credentials},
docs,
linters,
packaging,
migrations
# Use the Tox at least 4.16. If not available it will be auto-provisioned.
minversion = 4.16
# Make it possible to override the base python with the environment name.
ignore_base_python_conflict = true
[testenv]
# Use python 3.13 if it cannot be infered from the environment.
# See https://tox.wiki/en/latest/user_guide.html#test-environments for rules
# how basepython is selected from the environment name.
basepython = python3.13
extras =
# Always include storage extras or connectors related tests will fail.
py3{11,12,13}{,-storage-credentials}:
storage_s3
storage_gcs
test
docs:
docs
storage_s3
storage_gcs
linters, packaging, migrations:
test
passenv =
# Pass environment variables controlling project's tests.
py{11,12,13}{,-storage-credentials},migrations:
RESOLWE_*
DOCKER_*
DJANGO_TEST_PROCESSES
LC_*
GITHUB_*
whitelist_externals =
migrations:
bash
psql
ignore_errors =
!linters: false
# Run all linters to see their output even if one of them fails.
linters: true
[testenv:py3{11,12,13}{,-storage-credentials}]
commands =
# General tests commands:
# Print the environment and run tests.
coverage run tests/manage.py test {env:TEST_SUITE:resolwe} \
storage-credentials: --pattern storage_credentials_test_*.py \
--noinput --verbosity=2 --parallel
coverage combine
[testenv:migrations]
allowlist_externals =
bash
psql
commands =
python tests/manage.py migrate
bash -c '[[ $(./tests/manage.py makemigrations --dry-run) = '\
'"No changes detected" ]] || exit 1'
[testenv:packaging]
commands =
# Confirm that items checked into git are in sdist.
check-manifest
# Verify package metadata and confirm the long_description will render
# correctly on PyPI.
python -m build
python -m twine check --strict dist/*
[testenv:linters]
commands =
# Linter commands:
# Check code formating with black.
black --check resolwe
# Check order of imports.
isort --check-only --diff resolwe
# Run PyFlakes and Ned Batchelder's McCabe script.
flake8 resolwe
# Check documentation formatting (PEP 257).
pydocstyle resolwe --match='(?!test[_s]).*\.py'
[testenv:docs]
commands =
# Build documentation.
sphinx-build ./docs/ build/sphinx/html --fail-on-warning --fresh-env