Skip to content

Commit 7b5904a

Browse files
tests: Generate tox entries for grpc via script (#3979)
- remove hardcoded entries for `grpc` from the tox template - remove them from the ignore list in `populate_tox.py` - run `populate_tox.py` to fill in entries for them - run `split_gh_tox_actions.py` to generate the CI yaml files so that they correspond to the new tox.ini The remaining integrations in this group are not trivial to port to the script, I'll do this step by step in follow-up PRs. --------- Co-authored-by: Daniel Szoke <[email protected]>
1 parent 24afdb3 commit 7b5904a

File tree

5 files changed

+29
-34
lines changed

5 files changed

+29
-34
lines changed

.github/workflows/test-integrations-network.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.8","3.9","3.11","3.12","3.13"]
32+
python-version: ["3.9","3.12","3.13"]
3333
# python3.6 reached EOL and is no longer being supported on
3434
# new versions of hosted runners on Github Actions
3535
# ubuntu-20.04 is the last version that supported python3.6

scripts/populate_tox/config.py

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@
5353
"py3.6": ["aiocontextvars"],
5454
},
5555
},
56+
"grpc": {
57+
"package": "grpcio",
58+
"deps": {
59+
"*": ["protobuf", "mypy-protobuf", "types-protobuf", "pytest-asyncio"],
60+
},
61+
"python": ">=3.7",
62+
},
5663
"huey": {
5764
"package": "huey",
5865
},
@@ -83,6 +90,9 @@
8390
"redis_py_cluster_legacy": {
8491
"package": "redis-py-cluster",
8592
},
93+
"requests": {
94+
"package": "requests",
95+
},
8696
"spark": {
8797
"package": "pyspark",
8898
"python": ">=3.8",

scripts/populate_tox/populate_tox.py

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"django",
6666
"fastapi",
6767
"gcp",
68-
"grpc",
6968
"httpx",
7069
"huey",
7170
"huggingface_hub",

scripts/populate_tox/tox.jinja

-16
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ envlist =
103103
# GCP
104104
{py3.7}-gcp
105105

106-
# gRPC
107-
{py3.7,py3.9}-grpc-v{1.39}
108-
{py3.7,py3.10}-grpc-v{1.49}
109-
{py3.7,py3.11}-grpc-v{1.59}
110-
{py3.8,py3.11,py3.12}-grpc-latest
111-
112106
# HTTPX
113107
{py3.6,py3.9}-httpx-v{0.16,0.18}
114108
{py3.6,py3.10}-httpx-v{0.20,0.22}
@@ -314,16 +308,6 @@ deps =
314308
fastapi-v{0.79}: fastapi~=0.79.0
315309
fastapi-latest: fastapi
316310
317-
# gRPC
318-
grpc: protobuf
319-
grpc: mypy-protobuf
320-
grpc: types-protobuf
321-
grpc: pytest-asyncio
322-
grpc-v1.39: grpcio~=1.39.0
323-
grpc-v1.49: grpcio~=1.49.1
324-
grpc-v1.59: grpcio~=1.59.0
325-
grpc-latest: grpcio
326-
327311
# HTTPX
328312
httpx-v0.16: pytest-httpx==0.10.0
329313
httpx-v0.18: pytest-httpx==0.12.0

tox.ini

+18-16
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ envlist =
103103
# GCP
104104
{py3.7}-gcp
105105

106-
# gRPC
107-
{py3.7,py3.9}-grpc-v{1.39}
108-
{py3.7,py3.10}-grpc-v{1.49}
109-
{py3.7,py3.11}-grpc-v{1.59}
110-
{py3.8,py3.11,py3.12}-grpc-latest
111-
112106
# HTTPX
113107
{py3.6,py3.9}-httpx-v{0.16,0.18}
114108
{py3.6,py3.10}-httpx-v{0.20,0.22}
@@ -229,6 +223,13 @@ envlist =
229223
{py3.9,py3.12,py3.13}-strawberry-v0.260.2
230224

231225

226+
# ~~~ Network ~~~
227+
{py3.7,py3.8}-grpc-v1.32.0
228+
{py3.7,py3.9,py3.10}-grpc-v1.44.0
229+
{py3.7,py3.10,py3.11}-grpc-v1.58.3
230+
{py3.8,py3.12,py3.13}-grpc-v1.70.0
231+
232+
232233
# ~~~ Tasks ~~~
233234
{py3.6,py3.7,py3.8}-celery-v4.4.7
234235
{py3.6,py3.7,py3.8}-celery-v5.0.5
@@ -419,16 +420,6 @@ deps =
419420
fastapi-v{0.79}: fastapi~=0.79.0
420421
fastapi-latest: fastapi
421422

422-
# gRPC
423-
grpc: protobuf
424-
grpc: mypy-protobuf
425-
grpc: types-protobuf
426-
grpc: pytest-asyncio
427-
grpc-v1.39: grpcio~=1.39.0
428-
grpc-v1.49: grpcio~=1.49.1
429-
grpc-v1.59: grpcio~=1.59.0
430-
grpc-latest: grpcio
431-
432423
# HTTPX
433424
httpx-v0.16: pytest-httpx==0.10.0
434425
httpx-v0.18: pytest-httpx==0.12.0
@@ -622,6 +613,17 @@ deps =
622613
strawberry: httpx
623614

624615

616+
# ~~~ Network ~~~
617+
grpc-v1.32.0: grpcio==1.32.0
618+
grpc-v1.44.0: grpcio==1.44.0
619+
grpc-v1.58.3: grpcio==1.58.3
620+
grpc-v1.70.0: grpcio==1.70.0
621+
grpc: protobuf
622+
grpc: mypy-protobuf
623+
grpc: types-protobuf
624+
grpc: pytest-asyncio
625+
626+
625627
# ~~~ Tasks ~~~
626628
celery-v4.4.7: celery==4.4.7
627629
celery-v5.0.5: celery==5.0.5

0 commit comments

Comments
 (0)