-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
54 lines (48 loc) · 1.54 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
[tox]
envlist = py39-{lint, test}
isolated_build = True
[testenv:py39-lint]
description = Run static checkers.
setenv =
D4RL_SUPPRESS_IMPORT_ERROR=1
extras = lint
commands =
# Check import ordering
isort . --check
# Check formatting
black . --check
# Lint source code
pylint . {posargs}
# Check typing
mypy .
# Check docstrings
; pydocstyle .
; pylint --load-plugins pylint.extensions.docparams src {posargs}
[testenv:py39-test]
description = Run tests.
setenv =
D4RL_SUPPRESS_IMPORT_ERROR=1
extras = test
commands =
coverage erase
pytest -m "not slow" {posargs}
[testenv:docs]
description = Test and build the docs.
setenv =
DOCSDIR = {toxinidir}/docs
BUILDDIR = {toxinidir}/docs/build
BUILD = html
D4RL_SUPPRESS_IMPORT_ERROR=1
extras = doc
commands =
# Delete all files generated by sphinx-apidoc
python -c 'import glob, os; [os.remove(f) for f in glob.glob("docs/offline_mbrl*")];'
python -c 'import os; os.remove("docs/modules.rst") if os.path.exists("docs/modules.rst") else None;'
# Run doctests
sphinx-build -b doctest -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}
# Autogenerate docs from code
sphinx-apidoc -f -o docs/ src/offline_mbrl
# Prevent warning that modules.rst is unused
python -c 'import os; os.remove("docs/modules.rst") if os.path.exists("docs/modules.rst") else None;'
# Build the docs
sphinx-build -b html -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}