-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
71 lines (63 loc) · 2.07 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
# Run tests in isolation using virtualenv, https://tox.wiki/
[tox]
envlist =
black
ruff
py3{7,8,9,10,11}
pypy3{8,9,10}
minify
package
clean
[testenv]
description = Tests
deps =
behave[toml]@git+http://github.com/behave/[email protected]
PyHamcrest
commands =
behave {posargs}
[testenv:black]
description = Ensure consistent code style
skip_install = true
deps = black
commands = black {posargs:--check --diff behave_html_pretty_formatter tests}
[testenv:clean]
description = Clean up bytecode and build artifacts
skip_install = true
deps = pyclean
commands = pyclean {posargs:. --debris package ruff --erase tests/TESTS-*.xml tests/acceptance/steps/__WORKDIR__/**/* tests/acceptance/steps/__WORKDIR__/ --yes}
[testenv:ensure_version_matches]
description = Verify package version is same as Git tag
deps =
commands = python -c 'import os; from importlib.metadata import version; pkg, tag = os.environ["PKG_NAME"], os.environ["GIT_TAG"]; ver = version(pkg); error = f"`{ver}` != `{tag}`"; abort = f"Package version does not match the Git tag ({error}). ABORTING."; raise SystemExit(0 if ver and tag and ver == tag else abort)'
setenv =
PKG_NAME=behave-html-pretty-formatter
GIT_TAG={posargs}
[testenv:minify]
description = Minify CSS and JavaScript code
deps = css-html-js-minify
commands =
css-html-js-minify behave_html_pretty_formatter/behave.css
css-html-js-minify behave_html_pretty_formatter/behave.js
sed -i 's/};\+else/}else/g' behave_html_pretty_formatter/behave.min.js
git diff --color --exit-code behave_html_pretty_formatter/behave.min.css behave_html_pretty_formatter/behave.min.js
allowlist_externals =
git
sed
[testenv:package]
description = Build package and check metadata (or upload package)
skip_install = true
deps =
build
twine
commands =
python -m build
twine {posargs:check --strict} dist/*
passenv =
TWINE_USERNAME
TWINE_PASSWORD
TWINE_REPOSITORY_URL
[testenv:ruff]
description = Lightening-fast linting for Python
skip_install = true
deps = ruff
commands = ruff {posargs:. --show-source}