-
Notifications
You must be signed in to change notification settings - Fork 140
/
tox.ini
87 lines (71 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Automated testing.
# https://tox.wiki/en/latest/config.html
# NOTE: Since we don't use clean and --cov-append, the tests coverage is from the
# last python env that is run. Shouldn't be a problem though since we expect similar
# coverage from all python env (we don't branch much on python version).
# NOTE: The coverage report doesn't include the files in the scons/ directory
# which are run in a subprocess. This includes python files such as
# scons_util.py and the SConstruct files.
# Useful commands
#
# Run everything:
# tox
#
# Lint only:
# tox -e lint
#
# Test only (in decreasing scope size)
# tox --skip-env lint
# tox -e py313
# tox -e py313 -- test/commands
# tox -e py313 -- test/commands/test_examples.py
# tox -e py313 -- test/commands/test_examples.py::test_examples
#
# Installing python interpreters
# Mac: brew install python@3.10
# Win: ???
# Linux: ???
# ----------------------------------------------------
[tox]
isolated_build = True
# Runs testenv:x for each env x here.
envlist =
lint
py313
py312
py311
py310
py39
# ----------------------------------------------------
# Lints the apio code and tests.
[testenv:lint]
deps =
black==24.8.0
flake8==7.1.1
pylint==3.3.0
pytest==8.3.3
setenv=
# TODO: Can we avoid specifying explicitly each SConstruct?
LINT_ITEMS = \
apio \
test \
test-boards \
apio/scons/ice40/SConstruct \
apio/scons/ecp5/SConstruct \
apio/scons/gowin/SConstruct
commands =
black {env:LINT_ITEMS}
flake8 {env:LINT_ITEMS}
pylint {env:LINT_ITEMS}
# ----------------------------------------------------
# Runs the test that don't require connected boards.
# This is a template for the pyxx envs listed above..
[testenv]
deps =
pytest==8.3.3
pytest-cov==5.0.0
# Testing while treating warnings as errors. Also, generating coverage report.
# -vv provides more details error messages.
commands =
python -m pytest -W error -vv --cov --cov-report=html apio test {posargs}
# ----------------------------------------------------