-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
56 lines (45 loc) · 1.45 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
[tox]
# NOTE: Should match the [gh-actions] configs below
envlist = ruff-format, mypy, ruff-check, test
ruff_version = 0.4.4
pytest_version = 8.2.2
src_dir = find_bad_motion_tracks
[testenv]
basepython = python3
skip_install = true
allowlist_externals = /bin/bash
[gh-actions]
# NOTE: Should match the python-versions list in main.yml
#
# NOTE: This section is needed by tox-gh-actions:
# https://github.com/ymyzk/tox-gh-actions?tab=readme-ov-file#usage
python =
3.10: ruff-format, mypy, ruff-check, test # NOTE: Should match [tox] envlist above
3.11: ruff-format, mypy, ruff-check, test # NOTE: Should match [tox] envlist above
[testenv:ruff-format]
deps =
ruff=={[tox]ruff_version}
# Format locally, check in CI and fail on not-formatted code
commands = /bin/bash -c 'if [ "{env:CI:}" ] ; then CHECK="--check --diff" ; fi ; ruff format $CHECK {[tox]src_dir}'
[testenv:mypy]
deps =
mypy == 1.10.0
-r requirements.txt
commands = mypy {[tox]src_dir}
[testenv:ruff-check]
# Depend on ruff-format to not complain about formatting errors
depends = ruff-format
deps =
ruff=={[tox]ruff_version}
pytest==8.2.1
-r requirements.txt
# Auto-fix locally but not in CI
commands =
/bin/bash -c 'FIX="--fix" ; if [ "{env:CI:}" ] ; then FIX="--no-fix" ; fi ; ruff check $FIX {[tox]src_dir}'
[testenv:test]
depends = ruff-format
deps =
pytest == {[tox]pytest_version}
-r requirements.txt
commands =
pytest --durations=10 --color=yes tests