-
Notifications
You must be signed in to change notification settings - Fork 34
/
tox.ini
86 lines (78 loc) · 2.61 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
[tox]
envlist =
py3{11,12}{,-partial},
docs,
linters,
packaging,
extra,
migrations,
mypy
# Use the Tox at least 4.16. If not available it will be auto-provisioned.
minversion = 4.16
# Use python 3.12 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.12
[testenv]
# By default, install test extras. Override for specific environments below.
extras = test
passenv =
# Pass environment variables controlling project's tests.
py3{11,12}{,-partial},migrations:
RESOLWE_*
RESOLWEBIO_*
DOCKER_*
DJANGO_TEST_PROCESSES
[testenv:py3{11,12}{,-partial}]
commands =
# General tests commands:
# Run tests.
python tests/manage.py test {env:TEST_SUITE:resolwe_bio} --noinput \
# Only test changes against a given Git commit reference for *-partial
# testing environments (default to "master" branch).
partial: --only-changes-to \
partial: {env:RESOLWE_TEST_ONLY_CHANGES_TO:master} \
partial: --changes-file-types .resolwebio-filetypes.yml \
--verbosity 2 --parallel
# Check types.
[testenv:mypy]
commands = python -m mypy resolwe_bio
[testenv:linters]
# Always run all linters.
ignore_errors = True
# Enable pylint to find modules in the tools package even if it is not
# installed.
setenv = PYTHONPATH = {toxinidir}/resolwe_bio/tools
commands =
black --check resolwe_bio .scripts
isort --check-only --diff resolwe_bio .scripts
flake8 resolwe_bio .scripts
pydocstyle resolwe_bio .scripts --match='(?!test[_s]).*\.py'
[testenv:packaging]
extras = package
commands =
# Packaging commands:
# Confirm that items checked into git are in sdist.
check-manifest
# Verify package's metadata.
python setup.py check --metadata --strict
# Verify that long description will render correctly on PyPI.
python setup.py bdist_wheel sdist --quiet \
--dist-dir {toxworkdir}/packaging-test-dist
twine check {toxworkdir}/packaging-test-dist/*
[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'
# Build documentation.
[testenv:docs]
extras = docs
commands = sphinx-build ./docs/ build/sphinx/html --fail-on-warning --fresh-env
# Check that there are no large test files in resolwe_bio/tests/files.
[testenv:extra]
skip_install = True
commands = python .scripts/check_large_files.py resolwe_bio/tests/files