-
Notifications
You must be signed in to change notification settings - Fork 42
/
tox.ini
106 lines (101 loc) · 5.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# 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.10
deps = pip
allowlist_externals = bash
setenv =
CUDA_VISIBLE_DEVICES =
description =
format: Check formatting
reformat: Update formatting
types: Check types
tests: Run tests (use "--runslow yes" to run all tests)
tests_1: Run tests part 1
tests_2: Run tests part 2
tests_3: Run tests part 3
tests_4: Run tests part 4
coverage: Generate code coverage
docs: Generate documentation
quickdocs: Generate dummy documentation
commands =
# check 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 --extend-exclude 'notebooks/.+/' --check notebooks
# do formatting
reformat: pip install -r common_build/format/requirements.txt -c common_build/format/constraints.txt
reformat: black .
reformat: flake8 .
reformat: isort .
reformat: black -l 80 --extend-exclude 'notebooks/.+/' notebooks
# check types
types: pip install -r common_build/types/requirements.txt -c common_build/types/constraints.txt
types: pip install . -r tests/latest/requirements.txt -c tests/latest/constraints.txt
types: mypy {posargs}
# run tests (run with "-- --runslow yes" to run all tests)
# note that we currently split this into three separate runs due to memory leak issues
tests,tests_1,tests_2,tests_3,tests_4: pip install .[qhsri] -r tests/latest/requirements.txt -c tests/latest/constraints.txt
tests,tests_1: pytest --ignore trieste/experimental --qhsri yes {posargs} trieste tests/unit/models/gpflux
tests,tests_2: pytest --ignore tests/unit/models/gpflux --qhsri yes {posargs} tests/unit
tests,tests_3: pytest --qhsri yes {posargs} tests/util tests/integration/test_ask_tell_optimization.py tests/integration/test_bayesian_optimization.py
tests,tests_4: pytest --qhsri yes --ignore tests/integration/test_ask_tell_optimization.py --ignore tests/integration/test_bayesian_optimization.py {posargs} tests/integration
# code coverage
coverage: pip install .[qhsri] -r tests/latest/requirements.txt -c tests/latest/constraints.txt
coverage: pip install -r common_build/taskipy/requirements.txt -c common_build/taskipy/constraints.txt
coverage: - pytest --ignore trieste/experimental --eager --qhsri yes --cov trieste --cov-report=xml {posargs} trieste tests/unit/models/gpflux
coverage: - pytest --ignore tests/unit/models/gpflux --eager --qhsri yes --cov trieste --cov-report=xml --cov-append {posargs} tests/unit
coverage: - pytest --ignore trieste/experimental --eager --qhsri yes --cov trieste --cov-report=xml --cov-append {posargs} tests/util tests/integration
# docs build (note: box2d-kengz overwrites box2d.py and must be installed last)
# note also that the documentation github deploy scripts don't currently use this tox job
docs: pip install .[qhsri] -r notebooks/requirements.txt -c notebooks/constraints.txt
docs: pip install -I box2d-kengz -c notebooks/constraints.txt
docs: pip install -r docs/requirements.txt -c docs/constraints.txt
docs: bash -c "cd docs; make html"
# quickdocs build (note: box2d-kengz overwrites box2d.py and must be installed last)
quickdocs: pip install .[qhsri] -r notebooks/requirements.txt -c notebooks/constraints.txt
quickdocs: pip install -I box2d-kengz -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"
# additional tests using python 3.9 and older versions of tensorflow
[testenv:{types_old,tests_old,tests_old_1,tests_old_2,tests_old_3,tests_old_4}]
basepython = python3.9
description =
types_old: Check types [Python 3.9]
tests_old: Run tests [Python 3.9, no qhsri]
tests_old_1: Run old tests part 1
tests_old_2: Run old tests part 2
tests_old_3: Run old tests part 3
tests_old_4: Run old tests part 4
commands =
types_old: pip install -r common_build/types/requirements.txt -c common_build/types/constraints.txt
types_old: pip install . -r tests/old/requirements.txt -c tests/old/constraints.txt
types_old: mypy {posargs}
# unlike tests this doesn't include the optional qhsri support
# note that we currently split this into three separate runs due to memory leak issues
tests_old,tests_old_1,tests_old_2,tests_old_3,tests_old_4: pip install . -r tests/old/requirements.txt -c tests/old/constraints.txt
tests_old,tests_old_1: pytest --ignore trieste/experimental {posargs} trieste tests/unit/models/gpflux
tests_old,tests_old_2: pytest --ignore tests/unit/models/gpflux {posargs} tests/unit
tests_old,tests_old_3: pytest {posargs} tests/util tests/integration/test_ask_tell_optimization.py tests/integration/test_bayesian_optimization.py
tests_old,tests_old_4: pytest --ignore tests/integration/test_ask_tell_optimization.py --ignore tests/integration/test_bayesian_optimization.py {posargs} tests/integration