-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
91 lines (81 loc) · 1.99 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]
requires =
tox>=4
env_list = format, lint, mypy, extract_data, py{39,310,311,312}, docs
depends = testenv
[testenv]
description = run unit tests
deps =
pytest>=7
pytest-cov>=4
pytest-sugar
commands =
pytest --cov-report=lcov --cov-report=html --cov=geosub --durations=10 --durations-min=0.01 {posargs:tests}
[testenv:py{39,310,311,312}]
depends = extract_data
[testenv:extract_data]
description = pre-extract data
changedir = geosub/data
skip_install = true
allowlist_externals = bash
commands =
bash -c "[ -f geonames_all_countries_sorted.tsv ] || gzip --decompress --keep geonames_all_countries_sorted.tsv.gz"
[testenv:mypy]
description = run mypy checks
deps =
pytest>=7
mypy>=1.2.0
commands =
mypy --check-untyped-defs {posargs:geosub tests}
[testenv:format]
description = code formatting
skip_install = true
deps =
black==23.3.0
commands = black {posargs:.}
[testenv:lint]
depends = format
deps =
{[testenv:pylint]deps}
{[testenv:flake8]deps}
commands =
{[testenv:pylint]commands}
{[testenv:flake8]commands}
[testenv:pylint]
description = code linting
deps =
pylint>=2.17.0
commands = pylint {posargs:geosub tests}
[testenv:flake8]
deps =
flake8
flake8-rst-docstrings
flake8-sphinx-links
flake8-bugbear
flake8-annotations
flake8-bandit
flake8-simplify
flake8-warnings
flake8-datetimez
flake8-commas
flake8-eradicate
pep8-naming
commands =
flake8 {posargs:geosub tests}
[flake8]
max-line-length = 99
ignore = SIM105, ANN101, ANN204, ANN401, RST304, W503
per-file-ignores =
# Ignore F401 'imported but unused' in __init__.py files
*/__init__.py: F401
tests/**.py: S101, ANN201, DTZ001, DTZ003, DTZ005, DTZ006
[testenv:docs]
description = build sphinx docs
changedir = docs
depends = extract_data
deps =
sphinx>=6.0,<6.1
.[docs]
commands =
sphinx-build -W -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/html
sphinx-build -v -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html