From 25ddbcad9642cf38b7a9668e348f80fb9b1c892e Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Fri, 14 Feb 2025 10:44:35 +0100 Subject: [PATCH] tests: Generate some of the AI tox entries by toxgen (#3977) - remove hardcoded entries for `huggingface_hub` 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. This group in particular needs special treatment because of the `notiktoken` versions of some of the integrations. --------- Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> --- .github/workflows/test-integrations-ai.yml | 4 ++-- scripts/populate_tox/config.py | 3 +++ scripts/populate_tox/populate_tox.py | 1 - scripts/populate_tox/tox.jinja | 8 -------- tox.ini | 22 ++++++++++++++-------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-integrations-ai.yml b/.github/workflows/test-integrations-ai.yml index b9ade22f08..c3a2de036b 100644 --- a/.github/workflows/test-integrations-ai.yml +++ b/.github/workflows/test-integrations-ai.yml @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7","3.9","3.11","3.12","3.13"] + python-version: ["3.7","3.9","3.11","3.12"] # 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 @@ -101,7 +101,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8","3.9","3.11","3.12","3.13"] + python-version: ["3.8","3.9","3.10","3.11","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 8982a8c53a..0bfe1b618c 100644 --- a/scripts/populate_tox/config.py +++ b/scripts/populate_tox/config.py @@ -33,6 +33,9 @@ "py3.6": ["aiocontextvars"], }, }, + "huggingface_hub": { + "package": "huggingface_hub", + }, "launchdarkly": { "package": "launchdarkly-server-sdk", }, diff --git a/scripts/populate_tox/populate_tox.py b/scripts/populate_tox/populate_tox.py index 01e5a7c463..ff19ec3a5f 100644 --- a/scripts/populate_tox/populate_tox.py +++ b/scripts/populate_tox/populate_tox.py @@ -72,7 +72,6 @@ "grpc", "httpx", "huey", - "huggingface_hub", "langchain", "langchain_notiktoken", "litestar", diff --git a/scripts/populate_tox/tox.jinja b/scripts/populate_tox/tox.jinja index 70c570ba25..812bdf052a 100644 --- a/scripts/populate_tox/tox.jinja +++ b/scripts/populate_tox/tox.jinja @@ -143,10 +143,6 @@ envlist = {py3.6,py3.11,py3.12}-huey-v{2.0} {py3.6,py3.12,py3.13}-huey-latest - # Huggingface Hub - {py3.9,py3.12,py3.13}-huggingface_hub-{v0.22} - {py3.9,py3.12,py3.13}-huggingface_hub-latest - # Langchain {py3.9,py3.11,py3.12}-langchain-v0.1 {py3.9,py3.11,py3.12}-langchain-v0.3 @@ -433,10 +429,6 @@ deps = huey-v2.0: huey~=2.0.0 huey-latest: huey - # Huggingface Hub - huggingface_hub-v0.22: huggingface_hub~=0.22.2 - huggingface_hub-latest: huggingface_hub - # Langchain langchain-v0.1: openai~=1.0.0 langchain-v0.1: langchain~=0.1.11 diff --git a/tox.ini b/tox.ini index 73085eb243..deea74b328 100644 --- a/tox.ini +++ b/tox.ini @@ -143,10 +143,6 @@ envlist = {py3.6,py3.11,py3.12}-huey-v{2.0} {py3.6,py3.12,py3.13}-huey-latest - # Huggingface Hub - {py3.9,py3.12,py3.13}-huggingface_hub-{v0.22} - {py3.9,py3.12,py3.13}-huggingface_hub-latest - # Langchain {py3.9,py3.11,py3.12}-langchain-v0.1 {py3.9,py3.11,py3.12}-langchain-v0.3 @@ -229,6 +225,13 @@ envlist = # These come from the populate_tox.py script. Eventually we should move all # integration tests there. + # ~~~ AI ~~~ + {py3.8,py3.10,py3.11}-huggingface_hub-v0.22.2 + {py3.8,py3.10,py3.11}-huggingface_hub-v0.24.7 + {py3.8,py3.11,py3.12}-huggingface_hub-v0.26.5 + {py3.8,py3.12,py3.13}-huggingface_hub-v0.28.1 + + # ~~~ DBs ~~~ {py3.7,py3.11,py3.12}-clickhouse_driver-v0.2.9 @@ -498,10 +501,6 @@ deps = huey-v2.0: huey~=2.0.0 huey-latest: huey - # Huggingface Hub - huggingface_hub-v0.22: huggingface_hub~=0.22.2 - huggingface_hub-latest: huggingface_hub - # Langchain langchain-v0.1: openai~=1.0.0 langchain-v0.1: langchain~=0.1.11 @@ -646,6 +645,13 @@ deps = # These come from the populate_tox.py script. Eventually we should move all # integration tests there. + # ~~~ AI ~~~ + huggingface_hub-v0.22.2: huggingface_hub==0.22.2 + huggingface_hub-v0.24.7: huggingface_hub==0.24.7 + huggingface_hub-v0.26.5: huggingface_hub==0.26.5 + huggingface_hub-v0.28.1: huggingface_hub==0.28.1 + + # ~~~ DBs ~~~ clickhouse_driver-v0.2.9: clickhouse-driver==0.2.9