forked from lektor/lektor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
103 lines (96 loc) · 2.67 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
[tox]
minversion = 4.1
envlist =
lint
{py37,py38,py39,py310,py311}{,-mistune0}
py311-noutils
py311-pytz
py311-tzdata
py38-pillow6
py38-pillow7
cover-{clean,report}
isolated_build = true
[gh-actions]
python =
3.7: py37, cover
3.8: py38, cover
3.9: py39, cover
3.10: py310, cover
3.11: py311, cover
[testenv]
commands =
coverage run -m pytest {posargs:tests -ra --durations=20}
passenv = USERNAME
setenv =
# skip building frontend js/css
HATCH_BUILD_NO_HOOKS=true
# do not run marked slow tests in every variant testenv
{mistune0,noutils,pytz,tzdata}: PYTEST_ADDOPTS=-m "not slowtest"
deps =
pytest>=6
pytest-click
pytest-mock
coverage[toml]
importlib_metadata; python_version<"3.10"
iniconfig
hatchling
mistune0: mistune<2
pytz: pytz
tzdata: tzdata
pillow6: pillow<6.1.0
pillow7: pillow<7.1.0
depends =
py{37,38,39,310,311}: cover-clean
cover-report: py{37,38,39,310,311}{,-mistune0,-noutils,-pytz,-tzdata,-pillow6,-pillow7}
# XXX: I've been experiencing sporadic failures when running tox in parallel mode.
# The crux of the error messages when this happens appears to be something like:
#
# WARNING: Skipping page https://pypi.org/simple/coverage/ because the GET request
# got Content-Type: Unknown. The only supported Content-Types are
# application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and
# text/html
#
# ERROR: Could not find a version that satisfies the requirement
# coverage[toml] (from versions: none)
#
# It may be this issue: https://github.com/pypa/pip/issues/11340
#
# Setting download=true — which tells tox to upgrade pip to the latest version —
# seems to fix the issue for me.
#
# Hopefully, at some point this can be removed.
download = true
[testenv:py{37,38,39,310,311}-noutils]
# To test in environment without external utitilities like ffmpeg and git installed,
# break PATH in noutils environment(s).
allowlist_externals = env
commands =
env PATH="{env_bin_dir}" coverage run -m pytest {posargs:tests -ra --durations=20}
[testenv:lint]
use_develop = true
deps =
pylint==2.15.8
pytest>=6
pytest-mock
importlib_metadata; python_version<"3.10"
iniconfig
commands =
pylint {posargs:lektor tests}
[testenv:cover-clean]
deps = coverage[toml]
skip_install = true
commands = coverage erase
[testenv:cover-report]
deps = coverage[toml]
skip_install = true
commands =
-coverage combine --append
coverage xml
coverage report
[flake8]
max-line-length = 91
extend-ignore =
# E203: Whitespace before ':'
E203,
# E402: Module level import not at top of file
E402