-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtox.ini
More file actions
executable file
·99 lines (88 loc) · 2.12 KB
/
tox.ini
File metadata and controls
executable file
·99 lines (88 loc) · 2.12 KB
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
[tox]
envlist = lint, type, apidoc-check
skipsdist = true
sources = src/morphoclass tests/unit dvc
; Enable PEP-517/518, https://tox.wiki/en/latest/config.html#conf-isolated_build
isolated_build = true
;testenv for pyXX environments is missing because it's currently impossible to
;test using tox:
;* pytorch-geometric needs to be installed manually (see install.sh)
;* running install.sh in "commands" doesn't seem like a good idea
[testenv:lint]
description = Check code style and quality
skip_install = true
deps =
; bandit
black
flake8
flake8-bugbear
flake8-comprehensions
flake8-docstrings
isort
commands =
flake8 {posargs:{[tox]sources}}
isort --check {posargs:{[tox]sources}}
black --check {posargs:{[tox]sources}}
; bandit -qr {posargs:{[tox]sources}}
[testenv:type]
description = Static type checking
skip_install = true
deps =
mypy
types-PyYAML
types-setuptools
commands =
mypy {posargs:{[tox]sources}}
[testenv:format]
description = Apply black and isort
skip_install = true
deps =
black
isort
commands =
isort {posargs:{[tox]sources}}
black {posargs:{[tox]sources}}
[testenv:apidoc]
skip_install = true
allowlist_externals = rm
deps =
sphinx
commands =
rm -r docs/source/api
sphinx-apidoc -Tefo docs/source/api src/morphoclass src/morphoclass/version.py
[testenv:apidoc-check]
skip_install = true
allowlist_externals = diff
deps =
sphinx
commands =
sphinx-apidoc -Tefo {envtmpdir} src/morphoclass src/morphoclass/version.py
diff {envtmpdir} docs/source/api
[pytest]
addopts =
-k "not slow"
--cov-report=html
--cov-report=term
--cov-branch
--no-cov-on-fail
filterwarnings =
error
ignore:distutils Version classes are deprecated:DeprecationWarning
markers = slow: slow tests
testpaths = tests
[coverage:run]
source = morphoclass
branch = true
[coverage:report]
fail_under = 40
skip_covered = false
show_missing = false
[flake8]
max-line-length = 88
docstring-convention = numpy
extend-ignore = E203
per-file-ignores = tests/*:D
[isort]
add_imports = from __future__ import annotations
force_single_line = true
profile = black