-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtox.ini
More file actions
53 lines (45 loc) · 1.48 KB
/
tox.ini
File metadata and controls
53 lines (45 loc) · 1.48 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
# Tox (https://tox.wiki/) is a tool for running tests in multiple
# virtualenvs. This configuration file will run the test suite on all
# supported python versions. To use it, run "tox" from this directory.
#
# For a specific environment, run:
# "tox -e <env>" (i.e.: "tox -e py314" or "tox -e lint")
#
# This tox configuration will skip any Python interpreters that can't be found.
# To manage multiple Python interpreters for covering all versions, you can use
# pyenv: https://github.com/pyenv/pyenv
[tox]
envlist =
validate
lint
py312
py314
skip_missing_interpreters = true
[testenv:validate]
description = validate project configuration
dependency_groups =
validate
commands =
validate-pyproject pyproject.toml
python -c "import githubtakeout"
githubtakeout -h
[testenv:lint]
description = run linter and formatter
dependency_groups =
lint
skip_install = true
commands =
# crazy workaround so black doesn't print red messages to console on success
{envpython} -c "import subprocess as s; import sys; "\
"r = s.run(['black', 'src', 'tests'], capture_output=True, text=True, encoding='utf-8'); "\
"sys.stdout.write(r.stderr) if not r.returncode else sys.stderr.write(r.stderr)"
ruff check --fix --show-fixes --exit-non-zero-on-fix src tests
ruff format --exit-non-zero-on-format src tests
refurb src tests
[testenv]
description = run tests
passenv = *
dependency_groups =
test
commands =
pytest {tty:--color=yes} {posargs:.}