forked from snorkel-team/snorkel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
85 lines (76 loc) · 2.33 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
[tox]
skip_missing_interpreters = true
envlist =
py36,
py37,
type,
check,
doctest,
isolated_build = true
[testenv]
description = run the test driver with {basepython}
# Note: in order to allow dependency library install reuse
# on CI, we allow overriding the default envdir
# (specified as `{toxworkdir}/{envname}`) by setting the
# environment variable `TOX_INSTALL_DIR`. We avoid
# collision with the already-used `TOX_ENV_DIR`.
envdir = {env:TOX_INSTALL_DIR:{toxworkdir}/{envname}}
# Note: we try to keep the deps the same for all tests
# running on CI so that we skip reinstalling dependency
# libraries for all testenvs
deps =
-rrequirements.txt
-rrequirements-pyspark.txt
commands_pre = python -m spacy download en_core_web_sm
commands = python -m pytest {posargs:-m 'not spark and not complex'}
[testenv:spark]
description = run the test driver for spark tests with {basepython}
passenv = JAVA_HOME
commands = python -m pytest -m spark {posargs}
[testenv:complex]
description = run the test driver for integration tests with {basepython}
commands = python -m pytest -m 'complex and not spark' {posargs}
[testenv:doctest]
description = run doctest
skipsdist = true
commands = python -m pytest --doctest-plus snorkel
[testenv:check]
description = check the code and doc style
basepython = python3
commands_pre =
commands =
isort -rc -c .
black --check .
flake8 .
pydocstyle snorkel
{toxinidir}/scripts/check_requirements.py
{toxinidir}/scripts/sync_api_docs.py --check
[testenv:type]
description = run static type checking
basepython = python3
commands_pre =
commands = mypy -p snorkel --disallow-untyped-defs --disallow-incomplete-defs --no-implicit-optional
[testenv:coverage]
description = run coverage checks
basepython = python3
# Note: make sure this matches testenv since this is used
# on CI as the default unit test runner
commands = python -m pytest -m 'not spark and not complex' --cov=snorkel
[testenv:fix]
description = run code stylers
basepython = python3
usedevelop = True
commands_pre =
commands =
isort -rc .
black .
[testenv:doc]
description = build docs
basepython = python3
skipsdist = True
commands_pre = python -m pip install -U -r docs/requirements-doc.txt
commands =
rm -rf docs/_build
rm -rf docs/packages/_autosummary
make -C docs/ html
{toxinidir}/scripts/sync_api_docs.py