-
Notifications
You must be signed in to change notification settings - Fork 9
/
tox.ini
60 lines (49 loc) · 1.86 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
[tox]
env_list =
clean
py37-grpcio-tools-v{1.40.0,1.51.1}-gen
py37-grpcio-tools-v{1.40.0,1.51.1}-pydantic-v{1,2}-example
py{310,39,38}-grpcio-tools-v{1.40.0,1.51.1}-pydantic-v{1,2}
py311-grpcio-tools-v1.51.1-pydantic-v{1,2}
report
[testenv]
deps =
-r requirements-no-grpc-dev.txt
pytest-cov
grpcio-tools-v1.40.0: grpcio-tools==v1.40.0
grpcio-tools-v1.40.0: mypy-protobuf==3.2.0
grpcio-tools-v1.51.1: grpcio-tools==v1.51.0
pydantic-v1: pydantic==v1.10.7
pydantic-v2: pydantic
depends =
py{310,39,38}-grpcio-tools-v{1.40.0,1.51.1}-pydantic-v{1,2}: clean
py311-grpcio-tools-v1.51.1-pydantic-v{1,2}: clean
report: py{310,39,38}-grpcio-tools-v{1.40.0,1.51.1}-pydantic-v{1,2}
report: py311-grpcio-tools-v1.51.1-pydantic-v{1,2}
# In order for the script to work properly,
# you need to set the value of 'PYTHONPATH' to the current project path (
# tox.ini which is located at the root path of the project
# )
setenv =
PYTHONPATH = {toxinidir}
allowlist_externals = bash
commands =
# gen protobuf code file
py37-grpcio-tools-v1.40.0-gen: bash scripts/gen_proto.sh ./protobuf_to_pydantic/protos/old
# py37-grpcio-tools-v1.51.1-gen: python -c "import sys; print(sys.path)"
py37-grpcio-tools-v1.51.1-gen: bash scripts/gen_proto.sh ./protobuf_to_pydantic/protos
# gen example code file
py37-grpcio-tools-v{1.40.0,1.51.1}-pydantic-v{1,2}-example: bash scripts/run_example_gen_code.sh
# run unittest
py{310,39,38}-grpcio-tools-v{1.40.0,1.51.1}: pytest --cov --cov-append --cov-report=term tests/ --capture=no
py311-grpcio-tools-v1.51.1: pytest --cov --cov-append --cov-report=term tests/ --capture=no
[testenv:report]
deps = coverage[toml]
skip_install = true
commands =
coverage report
coverage html
[testenv:clean]
deps = coverage[toml]
skip_install = true
commands = coverage erase