-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtox.ini
130 lines (112 loc) · 2.68 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[tox]
envlist = py38, py39, py310
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
[testenv:test_api]
deps =
# standard testing
pytest
coverage
# text generation
faker
# pseudo-random str-to-float
shaffle
# common NLP and vectorizers
spacy
# dimensionality reduction
ivis[cpu]>=1.7
tensorflow>=2.9
# distant supervision
snorkel>=0.9.8
# utility wrappers
wrappy>=0.2.6
# exporting excel files
openpyxl
commands =
# get extra dependencies that deps do not cover
python -m spacy download en_core_web_md
# run tests and get coverage report
coverage run --source=./hover -m pytest -m "not benchmark" {posargs}
coverage xml -o cobertura.xml
install_command =
python -m pip install --upgrade {opts} {packages}
[testenv:test_api_lite]
# low-dependency fast test suite for compatibility
deps =
pytest
faker
shaffle
spacy
snorkel>=0.9.8
wrappy>=0.2.6
openpyxl
commands =
python -m spacy download en_core_web_md
# run tests with "lite" mark
pytest -m lite {posargs}
install_command =
python -m pip install --upgrade {opts} {packages}
[testenv:test_api_benchmark]
deps =
pytest
faker
shaffle
wrappy>=0.2.6
commands =
# specify threads limit for numpy and polars
export OMP_NUM_THREADS=1 POLARS_MAX_THREADS=1
# run tests with "benchmark" mark
pytest -m benchmark {posargs}
install_command =
python -m pip install --upgrade {opts} {packages}
[testenv:test_doc_scripts]
allowlist_externals =
git
cp
rm
deps = -rdocs/pipelines/requirements-doc-scripts.txt
commands =
python -m spacy download en_core_web_md
git clone https://github.com/phurwicz/hover-binder
cp -r hover-binder/local_lib ./local_lib
cp -r hover-binder/custom_cache ./custom_cache
rm -rf hover-binder
python docs/pipelines/check_scripts.py
rm -rf local_lib
rm -rf custom_cache
[testenv:test_notebook_generation]
allowlist_externals =
mkdir
deps = -rdocs/pipelines/requirements-doc-scripts.txt
commands =
python -m spacy download en_core_web_md
mkdir custom_cache
python docs/pipelines/generate_notebooks.py
[testenv:install]
commands =
python setup.py install {posargs}
[testenv:publish]
allowlist_externals =
rm
deps =
twine
commands =
python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*
rm -rf build dist hover.egg-info
[flake8]
ignore =
# black breaks these
E203,
E501,
W503,
per-file-ignores =
# "imported but unused": intended in __init__ files
__init__.py: F401
conftest.py: E402
exclude = .git,__pycache__,docs,build,dist
max-complexity = 10