Skip to content

Commit

Permalink
tests: Generate tox entries for grpc via script (#3979)
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
sentrivana and szokeasaurusrex authored Feb 14, 2025
1 parent 24afdb3 commit 7b5904a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9","3.11","3.12","3.13"]
python-version: ["3.9","3.12","3.13"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
10 changes: 10 additions & 0 deletions scripts/populate_tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
"py3.6": ["aiocontextvars"],
},
},
"grpc": {
"package": "grpcio",
"deps": {
"*": ["protobuf", "mypy-protobuf", "types-protobuf", "pytest-asyncio"],
},
"python": ">=3.7",
},
"huey": {
"package": "huey",
},
Expand Down Expand Up @@ -83,6 +90,9 @@
"redis_py_cluster_legacy": {
"package": "redis-py-cluster",
},
"requests": {
"package": "requests",
},
"spark": {
"package": "pyspark",
"python": ">=3.8",
Expand Down
1 change: 0 additions & 1 deletion scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"django",
"fastapi",
"gcp",
"grpc",
"httpx",
"huey",
"huggingface_hub",
Expand Down
16 changes: 0 additions & 16 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ envlist =
# GCP
{py3.7}-gcp

# gRPC
{py3.7,py3.9}-grpc-v{1.39}
{py3.7,py3.10}-grpc-v{1.49}
{py3.7,py3.11}-grpc-v{1.59}
{py3.8,py3.11,py3.12}-grpc-latest

# HTTPX
{py3.6,py3.9}-httpx-v{0.16,0.18}
{py3.6,py3.10}-httpx-v{0.20,0.22}
Expand Down Expand Up @@ -314,16 +308,6 @@ deps =
fastapi-v{0.79}: fastapi~=0.79.0
fastapi-latest: fastapi
# gRPC
grpc: protobuf
grpc: mypy-protobuf
grpc: types-protobuf
grpc: pytest-asyncio
grpc-v1.39: grpcio~=1.39.0
grpc-v1.49: grpcio~=1.49.1
grpc-v1.59: grpcio~=1.59.0
grpc-latest: grpcio
# HTTPX
httpx-v0.16: pytest-httpx==0.10.0
httpx-v0.18: pytest-httpx==0.12.0
Expand Down
34 changes: 18 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ envlist =
# GCP
{py3.7}-gcp

# gRPC
{py3.7,py3.9}-grpc-v{1.39}
{py3.7,py3.10}-grpc-v{1.49}
{py3.7,py3.11}-grpc-v{1.59}
{py3.8,py3.11,py3.12}-grpc-latest

# HTTPX
{py3.6,py3.9}-httpx-v{0.16,0.18}
{py3.6,py3.10}-httpx-v{0.20,0.22}
Expand Down Expand Up @@ -229,6 +223,13 @@ envlist =
{py3.9,py3.12,py3.13}-strawberry-v0.260.2


# ~~~ Network ~~~
{py3.7,py3.8}-grpc-v1.32.0
{py3.7,py3.9,py3.10}-grpc-v1.44.0
{py3.7,py3.10,py3.11}-grpc-v1.58.3
{py3.8,py3.12,py3.13}-grpc-v1.70.0


# ~~~ Tasks ~~~
{py3.6,py3.7,py3.8}-celery-v4.4.7
{py3.6,py3.7,py3.8}-celery-v5.0.5
Expand Down Expand Up @@ -419,16 +420,6 @@ deps =
fastapi-v{0.79}: fastapi~=0.79.0
fastapi-latest: fastapi

# gRPC
grpc: protobuf
grpc: mypy-protobuf
grpc: types-protobuf
grpc: pytest-asyncio
grpc-v1.39: grpcio~=1.39.0
grpc-v1.49: grpcio~=1.49.1
grpc-v1.59: grpcio~=1.59.0
grpc-latest: grpcio

# HTTPX
httpx-v0.16: pytest-httpx==0.10.0
httpx-v0.18: pytest-httpx==0.12.0
Expand Down Expand Up @@ -622,6 +613,17 @@ deps =
strawberry: httpx


# ~~~ Network ~~~
grpc-v1.32.0: grpcio==1.32.0
grpc-v1.44.0: grpcio==1.44.0
grpc-v1.58.3: grpcio==1.58.3
grpc-v1.70.0: grpcio==1.70.0
grpc: protobuf
grpc: mypy-protobuf
grpc: types-protobuf
grpc: pytest-asyncio


# ~~~ Tasks ~~~
celery-v4.4.7: celery==4.4.7
celery-v5.0.5: celery==5.0.5
Expand Down

0 comments on commit 7b5904a

Please sign in to comment.