forked from hynek/structlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
112 lines (85 loc) · 2.58 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
108
109
110
111
112
[flake8]
ignore = E203,W503,W504
# Keep docs in sync with docs env and .readthedocs.yml.
# We don't run pre-commit in CI, because we use pre-commit.ci.
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
[tox]
envlist = pre-commit,mypy,py37,py38,py39,py310,py39-colorama,py310-be,py310-rich,py311,docs,pypi-description,coverage-report
isolated_build = True
[testenv:docs]
# Keep basepython in sync with ci.yml/docs and .readthedocs.yml.
basepython = python3.10
extras = docs
passenv = TERM
commands =
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
[testenv:pre-commit]
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
[testenv:mypy]
description = Check types
extras = typing
commands = mypy src typing_examples.py
[testenv]
extras = tests
setenv = PYTHONHASHSEED = 0
commands = python -m pytest {posargs}
# For missing types we get from typing-extensions
[testenv:py37]
deps = twisted
commands = python -m coverage run -m pytest {posargs}
[testenv:py310]
deps = twisted
commands = {[testenv:py37]commands}
[testenv:py39-colorama]
deps = colorama
commands = python -m coverage run -m pytest tests/test_dev.py {posargs}
[testenv:py310-be]
deps = better-exceptions
commands = {[testenv:py39-colorama]commands}
[testenv:py310-rich]
deps = rich
commands = {[testenv:py39-colorama]commands}
[testenv:coverage-report]
basepython = python3.10
deps = coverage[toml]
skip_install = true
parallel_show_output = true
depends = py37,py310,py39-colorama,py310-be,py310-rich
commands =
python -m coverage combine
python -m coverage report
[testenv:pypi-description]
basepython = python3.10
skip_install = true
deps =
twine
pip >= 18.0.0
# Needs to run last, otherwise we have a race condition about coverage files
# lying around.
depends = coverage-report
commands =
pip install --upgrade pip
pip wheel -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*
[testenv:docset]
deps = doc2dash
extras = docs
allowlist_externals =
rm
cp
tar
commands =
rm -rf structlog.docset structlog.tgz docs/_build
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
doc2dash --index-page index.html --icon docs/_static/docset-icon.png --online-redirect-url https://www.structlog.org/en/latest/ docs/_build/html
cp docs/_static/[email protected] structlog.docset/[email protected]
tar --exclude='.DS_Store' -cvzf structlog.tgz structlog.docset