From 7b5904a17bd51521c5c5ee58ba60b3460ec1806d Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Fri, 14 Feb 2025 14:09:40 +0100 Subject: [PATCH] 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 <7881302+szokeasaurusrex@users.noreply.github.com> --- .../workflows/test-integrations-network.yml | 2 +- scripts/populate_tox/config.py | 10 ++++++ scripts/populate_tox/populate_tox.py | 1 - scripts/populate_tox/tox.jinja | 16 --------- tox.ini | 34 ++++++++++--------- 5 files changed, 29 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test-integrations-network.yml b/.github/workflows/test-integrations-network.yml index 56f4bcfd57..aae29ab7f9 100644 --- a/.github/workflows/test-integrations-network.yml +++ b/.github/workflows/test-integrations-network.yml @@ -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 diff --git a/scripts/populate_tox/config.py b/scripts/populate_tox/config.py index 0f0e150a4f..2c2920e7ac 100644 --- a/scripts/populate_tox/config.py +++ b/scripts/populate_tox/config.py @@ -53,6 +53,13 @@ "py3.6": ["aiocontextvars"], }, }, + "grpc": { + "package": "grpcio", + "deps": { + "*": ["protobuf", "mypy-protobuf", "types-protobuf", "pytest-asyncio"], + }, + "python": ">=3.7", + }, "huey": { "package": "huey", }, @@ -83,6 +90,9 @@ "redis_py_cluster_legacy": { "package": "redis-py-cluster", }, + "requests": { + "package": "requests", + }, "spark": { "package": "pyspark", "python": ">=3.8", diff --git a/scripts/populate_tox/populate_tox.py b/scripts/populate_tox/populate_tox.py index e6cb0e4de1..4bfce80ce7 100644 --- a/scripts/populate_tox/populate_tox.py +++ b/scripts/populate_tox/populate_tox.py @@ -65,7 +65,6 @@ "django", "fastapi", "gcp", - "grpc", "httpx", "huey", "huggingface_hub", diff --git a/scripts/populate_tox/tox.jinja b/scripts/populate_tox/tox.jinja index a6fc55c7e4..15119b4768 100644 --- a/scripts/populate_tox/tox.jinja +++ b/scripts/populate_tox/tox.jinja @@ -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} @@ -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 diff --git a/tox.ini b/tox.ini index cb3538e1aa..9ce3d40a21 100644 --- a/tox.ini +++ b/tox.ini @@ -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} @@ -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 @@ -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 @@ -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