forked from OpenMined/PySyft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
156 lines (141 loc) · 4.04 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[tox]
envlist =
lint
syft.jupyter
syft.test.fast
syft.test.security
syft.test.libs
; syft.test.duet
stack.test.integration
grid.test.backend
requires =
tox-pyenv
tox-run-command
pip >= 21.2.1
skipsdist = True
[testenv]
basepython = python3
deps = pip
commands =
python --version
[testenv:lint]
; setupdir = {toxinidir}
; changedir = {toxinidir}
description = Linting
allowlist_externals =
bash
deps =
black[python2]
isort
protoc-wheel-0
pre-commit
commands =
bash -c "cd {toxinidir}/packages/syft; ./scripts/build_proto.sh"
black .
isort .
pre-commit run --all-files
# Syft
[testenv:syft]
deps =
-e{toxinidir}/packages/syft[all]
-r{toxinidir}/packages/syft/requirements.unstable.txt
changedir = {toxinidir}/packages/syft
description = Syft
commands =
pip list
[testenv:syft.jupyter]
description = Jupyter Notebook with Editable Syft
deps =
{[testenv:syft]deps}
jupyter
commands =
pip install prompt-toolkit jupyter jupyterlab --upgrade # overrides grid deps in setup.cfg which break jupyter
jupyter lab --ip 0.0.0.0
[testenv:syft.test.fast]
description = Syft Unit Tests Fast
deps =
{[testenv:syft]deps}
changedir = {toxinidir}/packages/syft
commands =
pip list
pytest -m fast -n auto
[testenv:syft.test.security]
description = Security Checks for Syft
changedir = {toxinidir}/packages/syft
deps =
{[testenv:syft]deps}
commands =
pip install --upgrade pip
bandit -r src
safety check
[testenv:syft.test.libs]
description = Supported Library Tests for Syft
deps =
{[testenv:syft]deps}
changedir = {toxinidir}/packages/syft
commands =
pytest -m libs -n auto -k "not tenseal" --suppress-no-test-exit-code
pytest -m libs -n 1 -k "tenseal" --suppress-no-test-exit-code
; [testenv:syft.test.duet]
; description = Duet Integration Tests for Syft
; deps =
; {[testenv:syft]deps}
; changedir = {toxinidir}/packages/syft
; commands =
; python ./scripts/mnist.py
; python ./scripts/nb_duet_test.py
; pytest -m duet -n 1 --suppress-no-test-exit-code
[testenv:stack.test.integration]
description = Integration Tests for Core Stack
deps =
pytest
requests
changedir = {toxinidir}
allowlist_externals =
docker
grep
sleep
bash
commands =
pip install -e packages/syft
pip install -e packages/hagrid
docker --version
docker compose version
bash -c 'HAGRID_ART=false hagrid launch test_domain_1 domain to docker:9081 --tail=false'
bash -c 'HAGRID_ART=false hagrid launch test_domain_2 domain to docker:9082 --tail=false'
bash -c 'HAGRID_ART=false hagrid launch test_network_1 network to docker:9083 --tail=false'
docker ps
bash -c '(docker logs test_domain_1_frontend_1 -f &) | grep -q "event - compiled successfully" || true'
bash -c '(docker logs test_network_1_frontend_1 -f &) | grep -q "event - compiled successfully" || true'
bash -c '(docker logs test_domain_1_backend_stream_1 -f &) | grep -q "Application startup complete" || true'
bash -c '(docker logs test_domain_2_backend_stream_1 -f &) | grep -q "Application startup complete" || true'
bash -c '(docker logs test_network_1_backend_stream_1 -f &) | grep -q "Application startup complete" || true'
sleep 5
pytest tests/integration -vvvv
bash -c 'HAGRID_ART=false hagrid land test_domain_1'
bash -c 'HAGRID_ART=false hagrid land test_domain_2'
bash -c 'HAGRID_ART=false hagrid land test_network_1'
[testenv:grid.test.backend]
description = Tests for Grid Backend
deps =
{[testenv:syft]deps}
pytest
pytest-xdist[psutil]
poetry
importlib-metadata
changedir = {toxinidir}/packages/grid/backend
allowlist_externals =
bash
commands =
python --version
pip install -r requirements.txt
pip install importlib-metadata colorama # poetry is messing this up?
bash -c 'SQLALCHEMY_DATABASE_URI="sqlite:///file:test_db?mode=memory&cache=shared&uri=true" LOGURU_SINK="./grid.log" pytest grid/tests'
[flake8]
ignore =
W503
max-line-length = 120
exclude =
.tox
[mypy]
python_version = 3.9