-
Notifications
You must be signed in to change notification settings - Fork 21
/
tox.ini
93 lines (61 loc) · 1.88 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
88
89
# 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.
# Expects both python 3.5 and 3.6 to be installed (Use pyenv)
# Obscure error messages with 'tox -e py35-numpy' but not
# 'tox -e py36-numpy' (or vice versa) may be due to python versions not
# being avaliable.
# FIXME: Make sure CPU/GPU gets tested (When GPU avalibale)
[tox]
envlist =
# NOTE: NO SPACES!!!
# Tensorflow currently removed because tests taking too long.
# Should be two versions of python
{py36}-{numpy,eager,torch,tensorflow2}
lint
typecheck
coverage
docs
doctest
# == Defaults for all enviroments ==
[testenv]
setenv =
numpy: QUANTUMFLOW_BACKEND=numpy
tensorflow: QUANTUMFLOW_BACKEND=tensorflow
tensorflow2: QUANTUMFLOW_BACKEND=tensorflow2
eager: QUANTUMFLOW_BACKEND=eager
torch: QUANTUMFLOW_BACKEND=torch
deps =
-rrequirements.txt
commands =
tensorflow2: pip install tensorflow -U --pre
python -m quantumflow.meta
pytest tests/
# ==== Test Coverage ====
# Note: Skips backends because inactive backends can't get 100% coverage
[testenv:coverage]
setenv =
QUANTUMFLOW_BACKEND=numpy
commands =
pytest --cov=quantumflow --cov-config .toxcoveragerc --cov-fail-under 100 --cov-report term-missing tests/
# ==== Linting ====
[testenv:lint]
commands =
flake8 quantumflow examples tests tools setup.py
# == Typecheck ==
[testenv:typecheck]
commands =
mypy -p quantumflow --ignore-missing-imports
# == Docs ==
[testenv:docs]
commands =
pip install guzzle_sphinx_theme
sphinx-build -M html docs/source docs/build
[testenv:doctest]
setenv =
QUANTUMFLOW_BACKEND=numpy
commands =
python -m quantumflow.meta
pip install guzzle_sphinx_theme
sphinx-build -M doctest docs/source docs/build