-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
68 lines (63 loc) · 2.87 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
# Copyright 2020 The Trieste Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[tox]
isolated_build = true
skipsdist = true
[flake8]
max-line-length = 100
extend-ignore = E203, W503
per-file-ignores = __init__.py: F401
extend-exclude = docs/notebooks/,.venv,build/
[testenv]
basepython = python3.7
deps = pip
allowlist_externals = bash
setenv =
CUDA_VISIBLE_DEVICES =
commands =
# type checking
types: pip install -r common_build/types/requirements.txt -c common_build/types/constraints.txt
types: pip install . -r tests/requirements.txt -c tests/constraints.txt
types: mypy {posargs}
# formatting
format: pip install -r common_build/format/requirements.txt -c common_build/format/constraints.txt
format: black --check .
format: flake8 --count .
format: isort --check .
format: black -l 80 --include \.pct\.py$ --check notebooks
# tests (run with "-- --runslow yes" to run all tests)
tests: pip install . -r tests/requirements.txt -c tests/constraints.txt
tests: pytest --ignore trieste/experimental {posargs}
# docs build
docs: pip install .[qhsri] -r notebooks/requirements.txt -c notebooks/constraints.txt
docs: pip install -r docs/requirements.txt -c docs/constraints.txt
docs: bash -c "cd docs; make html"
# quickdocs build
quickdocs: pip install .[qhsri] -r notebooks/requirements.txt -c notebooks/constraints.txt
quickdocs: pip install -r docs/requirements.txt -c docs/constraints.txt
quickdocs: bash -c "cd docs; if (python notebooks/quickrun/quickrun.py && make html); then python notebooks/quickrun/quickrun.py --revert; else python notebooks/quickrun/quickrun.py --revert; exit 1; fi"
[testenv:tests_latest]
basepython = python3.9
commands =
# test but with python 3.9 and latest supported library versions
# unlike tests this includes the optional qhsri support
tests_latest: pip install .[qhsri] -r tests/latest/requirements.txt -c tests/latest/constraints.txt
tests_latest: pytest --ignore trieste/experimental --qhsri yes {posargs}
[testenv:types_latest]
basepython = python3.9
commands =
# test but with python 3.9 and latest supported tensorflow and numpy versions
types_latest: pip install -r common_build/types/requirements.txt -c common_build/types/constraints.txt
types_latest: pip install . -r tests/latest/requirements.txt -c tests/latest/constraints.txt
types_latest: mypy {posargs}