-
Notifications
You must be signed in to change notification settings - Fork 6
/
tox.ini
71 lines (64 loc) · 2.42 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
# tox (https://tox.readthedocs.io/) 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, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py310,py39,py38,py37,py36
requires =
setuptools >= 40.1.0
[testenv]
deps =
py310: black
py310: docutils
py310: flake8
py310: flake8-docstrings
py310: flake8-import-order
mypy
pytest
npTDMS
pytest-timeout
psutil
changedir = src
commands =
py310: black --target-version py36 --exclude "flexlogger\/automation\/proto\/" --check flexlogger ../examples ../tests
py310: flake8 flexlogger ../examples/Basic ../examples/Interactive ../tests
py310: mypy --config-file ../mypy.ini -p flexlogger.automation
# We don't annotate types in our examples (to make them easier to read),
# but do check that we're using types correctly
py310: mypy --config-file ../mypy.ini --allow-untyped-defs --allow-incomplete-defs ../examples/Basic ../examples/Interactive
py310: mypy --config-file ../mypy.ini ../tests
pytest --doctest-modules flexlogger
pytest ../tests --strict-markers {posargs:-m "(not slow)"}
# WINDIR environment variable needs to be set or FlexLogger
# crashes on launch with a UriFormatException from
# MS.Internal.FontCache.Util..cctor()
passenv =
WINDIR
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
# Note that pytest args can be passed on the commandline after "--", e.g.
# tox -- -m integration
# to run all integration tests. (The list of available markers is below.)
#
# The default pytest args used above say to *not* run tests marked as slow.
# If you specifically want to run *all* tests, then you must pass *some*
# argument after "--". An easy way to do this is just repeat the --strict flag:
# tox -- --strict
[pytest]
markers =
unit: mark a test as a unit test
integration: mark a test as an integration test
slow: mark a test as a slow test
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3
deps =
-rdocs/requirements.txt
commands =
sphinx-build -a -E -c ../docs -d "{toxworkdir}/docs_doctree" ../docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'