From caa705e8bf4bedf1a956f48b545283b2ca14170a Mon Sep 17 00:00:00 2001 From: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:10:27 +0100 Subject: [PATCH] Bump hfh to 0.24 to fix ci (#7350) bump hfh O.24 --- .github/conda/meta.yaml | 4 ++-- .github/workflows/ci.yml | 2 +- setup.py | 2 +- tests/test_offline_util.py | 8 ++------ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/conda/meta.yaml b/.github/conda/meta.yaml index 153ceab890a..55e158e3f5c 100644 --- a/.github/conda/meta.yaml +++ b/.github/conda/meta.yaml @@ -24,7 +24,7 @@ requirements: - dataclasses - multiprocess - fsspec - - huggingface_hub >=0.23.0,<1.0.0 + - huggingface_hub >=0.24.0,<1.0.0 - packaging - aiohttp run: @@ -40,7 +40,7 @@ requirements: - dataclasses - multiprocess - fsspec - - huggingface_hub >=0.23.0,<1.0.0 + - huggingface_hub >=0.24.0,<1.0.0 - packaging - aiohttp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5049514706..7cf288de146 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: run: uv pip install --system --upgrade pyarrow huggingface-hub "dill<0.3.9" - name: Install dependencies (minimum versions) if: ${{ matrix.deps_versions != 'deps-latest' }} - run: uv pip install --system pyarrow==15.0.0 huggingface-hub==0.23.5 transformers dill==0.3.1.1 + run: uv pip install --system pyarrow==15.0.0 huggingface-hub==0.24.7 transformers dill==0.3.1.1 - name: Test with pytest run: | python -m pytest -rfExX -m ${{ matrix.test }} -n 2 --dist loadfile -sv ./tests/ diff --git a/setup.py b/setup.py index 68456bbaeb2..f7f94e560cd 100644 --- a/setup.py +++ b/setup.py @@ -133,7 +133,7 @@ # for data streaming via http "aiohttp", # To get datasets from the Datasets Hub on huggingface.co - "huggingface-hub>=0.23.0", + "huggingface-hub>=0.24.0", # Utilities from PyPA to e.g., compare versions "packaging", # To parse YAML metadata from dataset cards diff --git a/tests/test_offline_util.py b/tests/test_offline_util.py index 22a372205ad..ed8ff49b815 100644 --- a/tests/test_offline_util.py +++ b/tests/test_offline_util.py @@ -1,9 +1,7 @@ from tempfile import NamedTemporaryFile -import huggingface_hub import pytest import requests -from packaging import version from datasets.utils.file_utils import fsspec_get, fsspec_head @@ -18,10 +16,8 @@ def test_offline_with_timeout(): requests.request("GET", "https://huggingface.co") with pytest.raises(requests.exceptions.Timeout): requests.request("GET", "https://huggingface.co", timeout=1.0) - # old versions of `huggingface_hub` don't have timeouts by default and don't allow to set timeouts in HfFileSystem - if version.parse(huggingface_hub.__version__) >= version.parse("0.23.0"): - with pytest.raises(requests.exceptions.Timeout), NamedTemporaryFile() as temp_file: - fsspec_get("hf://dummy", temp_file=temp_file) + with pytest.raises(requests.exceptions.Timeout), NamedTemporaryFile() as temp_file: + fsspec_get("hf://dummy", temp_file=temp_file) @pytest.mark.integration