Skip to content

Commit

Permalink
Bump hfh to 0.24 to fix ci (#7350)
Browse files Browse the repository at this point in the history
bump hfh O.24
  • Loading branch information
lhoestq authored Jan 3, 2025
1 parent ccccf10 commit caa705e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions tests/test_offline_util.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down

0 comments on commit caa705e

Please sign in to comment.