-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
107 lines (96 loc) · 2.95 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
[tox]
# Running plain tox will run the default environment (testenv) with the default
# python3 interpreter of the user.
envlist=testenv
[testenv]
passenv=CI
deps=coverage
pytest
commands =
# Create HTML coverage report for humans and xml coverage report for external services.
coverage run --source=sequali -m pytest -v tests
coverage html
coverage xml
[testenv:lint]
deps=flake8
flake8-import-order
types-tqdm
mypy
pytest
clang-format
pre-commit
allowlist_externals = bash
commands =
flake8 src tests setup.py
bash -c 'clang-format -Werror -n -i src/sequali/*.c src/sequali/*.h'
mypy src/sequali tests/
pre-commit run --all-files
[testenv:twine_check]
deps=build
twine
skip_install=True
commands =
python -m build
twine check dist/*
[testenv:pedantic_compile]
deps=
skip_install=True
setenv=
CFLAGS=-Wall -Werror -Wpedantic
allowlist_externals = bash
commands =
bash -c 'CC=gcc python setup.py build_ext -f'
bash -c 'CC=clang python setup.py build_ext -f'
[testenv:strict_compile]
deps=
skip_install=True
setenv=
CFLAGS=-Wall -Werror
allowlist_externals = bash
commands =
bash -c 'CC=gcc python setup.py build_ext -f'
bash -c 'CC=clang python setup.py build_ext -f'
[testenv:format]
deps=clang-format
skip_install=True
allowlist_externals = bash
commands =
bash -c 'clang-format -i src/sequali/*.c src/sequali/*.h'
[flake8]
max-line-length=88
[testenv:asan]
setenv=
PYTHONDEVMODE=1
PYTHONUNBUFFERED=1
PYTHONMALLOC=malloc
CFLAGS=-lasan -fsanitize=address -fno-omit-frame-pointer
ASAN_OPTIONS=log_path=asan_errors
allowlist_externals=bash
commands=
bash -c 'export LD_PRELOAD=$(gcc -print-file-name=libasan.so) && printenv LD_PRELOAD && python -c "from sequali import _qc" && pytest tests -v'
[testenv:docs]
deps=-r docs/requirements-docs.txt
allowlist_externals=mkdir
rm
commands=
python --version
# PLACEHOLDER: create _static folder, since we do not have static files in
# our project yet
mkdir -p docs/_static
# Remove docs/_build so all documentation has to be build again
# This is necessary when using --keep-going on sphinx-build
rm -rf docs/_build
# Test if documentation can be build without errors and warnings
# -a rebuilds everything. -W turns warnings into errors.
# --keep-going makes sure we see al the errors that are there in one go.
sphinx-build -a -W -n --keep-going docs docs/_build
[testenv:html5validator]
deps=html5validator
allowlist_externals=bash
mkdir
commands=
mkdir -p reports
bash -c 'for FILE in tests/data/*.fastq tests/data/*.fastq.gz tests/data/*.bam; do sequali --outdir reports $FILE; done'
sequali --outdir reports tests/data/LTB-A-BC001_S1_L003_R1_001.fastq.gz tests/data/LTB-A-BC001_S1_L003_R2_001.fastq.gz
# || exit 1 needed to force crashes when html5validator fails with 255
bash -c 'html5validator -- reports/*.html || exit 1'