-
Notifications
You must be signed in to change notification settings - Fork 183
/
tox.ini
47 lines (42 loc) · 1.67 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
[tox]
envlist = py39, flake8
skipsdist=True
[testenv:flake8]
commands=flake8 {posargs}
[testenv]
passenv = ETCD_ENDPOINT TEST_ETCD_VERSION
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/etcd3
deps=
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/test.txt
commands =
pip install -U pip
pifpaf -e PYTHON run etcd --cluster -- py.test --cov=etcd3 --cov-report= --basetemp={envtmpdir} {posargs}
[testenv:coverage]
deps=
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/test.txt
commands = py.test --cov=etcd3 tests/
[testenv:genproto]
whitelist_externals = sed
deps = grpcio-tools
commands =
sed -i -e '/gogoproto/d' etcd3/proto/rpc.proto
sed -i -e 's/etcd\/mvcc\/mvccpb\/kv.proto/kv.proto/g' etcd3/proto/rpc.proto
sed -i -e 's/etcd\/auth\/authpb\/auth.proto/auth.proto/g' etcd3/proto/rpc.proto
sed -i -e '/google\/api\/annotations.proto/d' etcd3/proto/rpc.proto
sed -i -e '/option (google.api.http)/,+3d' etcd3/proto/rpc.proto
python -m grpc.tools.protoc -Ietcd3/proto \
--python_out=etcd3/etcdrpc/ \
--grpc_python_out=etcd3/etcdrpc/ \
etcd3/proto/rpc.proto etcd3/proto/auth.proto etcd3/proto/kv.proto
sed -i -e 's/import auth_pb2/from etcd3.etcdrpc import auth_pb2/g' etcd3/etcdrpc/rpc_pb2.py
sed -i -e 's/import kv_pb2/from etcd3.etcdrpc import kv_pb2/g' etcd3/etcdrpc/rpc_pb2.py
sed -i -e 's/import rpc_pb2/from etcd3.etcdrpc import rpc_pb2/g' etcd3/etcdrpc/rpc_pb2_grpc.py
[flake8]
exclude = .venv,.git,.tox,dist,docs,*lib/python*,*egg,build,etcd3/etcdrpc/
application-import-names = etcd3
max-complexity = 10
# TODO add docstrings for public methods, modules, etc
ignore = D1, W503