From dc460df532e6733b662ab07b836b7d6a4a0e3730 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Fri, 20 Jan 2023 12:08:15 +0100 Subject: [PATCH 1/3] Test huggingface_hub v0.12.0rc0, don't merge! --- skops/_min_dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skops/_min_dependencies.py b/skops/_min_dependencies.py index 35219a12..920bffaf 100644 --- a/skops/_min_dependencies.py +++ b/skops/_min_dependencies.py @@ -11,7 +11,7 @@ # "tomli": ("1.1.0", "install", "python_full_version < '3.11.0a7'"), dependent_packages = { "scikit-learn": ("0.24", "install", None), - "huggingface_hub": ("0.10.1", "install", None), + "huggingface_hub": ("0.12.0rc0", "install", None), "tabulate": ("0.8.8", "install", None), "pytest": (PYTEST_MIN_VERSION, "tests", None), "pytest-cov": ("2.9.0", "tests", None), From 08913c8c616851d596fbe401c0d5277036fbfd82 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Fri, 20 Jan 2023 12:22:33 +0100 Subject: [PATCH 2/3] [CI inference] Adjust error message --- skops/hub_utils/tests/test_hf_hub.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/skops/hub_utils/tests/test_hf_hub.py b/skops/hub_utils/tests/test_hf_hub.py index cc0511f0..3dfe6bf9 100644 --- a/skops/hub_utils/tests/test_hf_hub.py +++ b/skops/hub_utils/tests/test_hf_hub.py @@ -399,10 +399,15 @@ def test_push_download( private=True, ) - with pytest.raises( - RepositoryNotFoundError, - match="If the repo is private, make sure you are authenticated.", - ): + # TODO: remove 1st message when huggingface_hub < v0.12 is dropped + # message changes in huggingface_hub v0.12, test both + match = ( + "If the repo is private, make sure you are authenticated" + "|" + "If you are trying to access a private or gated repo, " + "make sure you are authenticated" + ) + with pytest.raises(RepositoryNotFoundError, match=match): download(repo_id=repo_id, dst="/tmp/test") with pytest.raises(OSError, match="None-empty dst path already exists!"): From ecbbd720b9e61a5f050ec912ba25cd77261938b6 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Fri, 20 Jan 2023 12:37:38 +0100 Subject: [PATCH 3/3] [CI inference] 'token' instead of 'use_auth_token' --- skops/hub_utils/_hf_hub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skops/hub_utils/_hf_hub.py b/skops/hub_utils/_hf_hub.py index f91a6664..dc786918 100644 --- a/skops/hub_utils/_hf_hub.py +++ b/skops/hub_utils/_hf_hub.py @@ -672,7 +672,7 @@ def download( dst.rmdir() cached_folder = snapshot_download( - repo_id=repo_id, revision=revision, use_auth_token=token, **kwargs + repo_id=repo_id, revision=revision, token=token, **kwargs ) shutil.copytree(cached_folder, dst) if not keep_cache: