Skip to content

Commit 631e5b3

Browse files
build: adding py file generation for unit testing
1 parent eefc842 commit 631e5b3

3 files changed

Lines changed: 17 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
- run: |
2020
pip install tox
2121
- name: Run linters
22-
run: tox -e build || true
22+
run: |
23+
tox -e genproto
24+
tox -e build || true
2325
2426
test:
2527
runs-on: ubuntu-latest
@@ -38,7 +40,9 @@ jobs:
3840
- run: |
3941
pip install tox
4042
- name: Run unittests
41-
run: tox -e unittests
43+
run: |
44+
tox -e genproto
45+
tox -e unittests
4246
4347
lint:
4448
runs-on: ubuntu-latest
@@ -51,7 +55,9 @@ jobs:
5155
- run: |
5256
pip install tox
5357
- name: Run linters
54-
run: tox -e lint || true
58+
run: |
59+
tox -e genproto
60+
tox -e lint || true
5561
5662
doc:
5763
runs-on: ubuntu-latest
@@ -64,4 +70,6 @@ jobs:
6470
- run: |
6571
pip install tox
6672
- name: Run linters
67-
run: tox -e doc
73+
run: |
74+
tox -e genproto
75+
tox -e doc

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
python-version: '3.10'
2020
- run: |
2121
pip install tox
22+
tox -e genproto
2223
tox -e build
2324
# initiate jfrog login and install jf
2425
- name: Login to JFrog Ledger

tox.ini

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,23 @@ description = generate proto and build pacakge
1515
deps =
1616
build
1717
twine
18+
depends = genproto
1819
extras = protoc
19-
allowlist_externals =
20-
{toxinidir}/genproto.sh
2120
commands =
22-
{toxinidir}/genproto.sh
2321
python -m build
2422
twine check dist/*
2523

2624
[testenv:unittests]
2725
description = generate proto and run package unit tests
26+
depends = genproto
2827
extras = tests
2928
#passenv = ETCD_ENDPOINT,TEST_ETCD_VERSION
3029
allowlist_externals =
3130
wget
3231
tar
3332
gzip
3433
cp
35-
{toxinidir}/genproto.sh
3634
commands_pre =
37-
{toxinidir}/genproto.sh
3835
wget https://github.com/etcd-io/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz -O {env_tmp_dir}/etcd.tar.gz
3936
tar xzvf {env_tmp_dir}/etcd.tar.gz -C {env_tmp_dir}
4037
cp {env_tmp_dir}/etcd-v3.3.10-linux-amd64/etcd {envdir}/bin
@@ -46,6 +43,7 @@ commands =
4643

4744
[testenv:lint]
4845
extras = tests
46+
depends = genproto
4947
commands =
5048
flake8 --docstring-convention=numpy
5149
black --line-length 90 --check --diff .
@@ -56,10 +54,8 @@ description = generate sphinx documentation
5654
extras =
5755
doc
5856
protoc
59-
allowlist_externals =
60-
{toxinidir}/genproto.sh
57+
depends = genproto
6158
commands =
62-
{toxinidir}/genproto.sh
6359
sphinx-build -b html -d docs/_build/doctress docs docs/_build
6460

6561
[testenv:flake8]

0 commit comments

Comments
 (0)