Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
264e36a
[1.0] Httpx migration (#3328)
Wauplin Sep 10, 2025
0f6d2f4
Bump minimal version to Python3.9 (#3343)
Wauplin Sep 10, 2025
398492c
Remove `HfFolder` and `InferenceAPI` classes (#3344)
Wauplin Sep 11, 2025
e1cf5b6
[v1.0] Remove more deprecated stuff (#3345)
Wauplin Sep 11, 2025
6bd2eb0
[v1.0] Remove `Repository` class (#3346)
Wauplin Sep 12, 2025
1dd1bc5
bump to 1.0.0.dev0
Wauplin Sep 12, 2025
7b2b982
Remove _deprecate_positional_args on login methods (#3349)
Wauplin Sep 12, 2025
c36962a
[v1.0] Remove imports kept only for backward compatibility (#3350)
Wauplin Sep 12, 2025
0844d9c
[v1.0] Remove keras2 utilities (#3352)
Wauplin Sep 12, 2025
9b3258e
[v1.0] Remove anything tensorflow-related + deps (#3354)
Wauplin Sep 12, 2025
1044d37
Release: v1.0.0.rc0
Wauplin Sep 15, 2025
5062377
[v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357)
Wauplin Sep 17, 2025
0e021d4
Refactor CLI implementation using Typer (#3372)
hanouticelina Sep 18, 2025
0008034
Make HfHubHTTPError inherit from OSError (#3387)
Wauplin Sep 24, 2025
5fa1931
Release: v1.0.0.rc1
Wauplin Sep 24, 2025
b8d6092
Add new HF commands (#3384)
hanouticelina Sep 25, 2025
f3334dd
Release: v1.0.0.rc2
Wauplin Sep 25, 2025
ee6c65a
Document new HF commands (#3393)
hanouticelina Sep 26, 2025
21edca8
Add cross-platform CLI Installers (#3378)
hanouticelina Sep 29, 2025
a1c1474
update installers paths (#3400)
hanouticelina Sep 29, 2025
5d81092
Merge branch 'main' into v1.0-release
Wauplin Oct 1, 2025
470a7ee
[v1.0] feat: add migration guide for v1.0 (#3360)
google-labs-jules[bot] Oct 1, 2025
836dff1
Merge branch 'main' into v1.0-release
Wauplin Oct 2, 2025
e9fa836
prepare rc3
Wauplin Oct 2, 2025
942fe42
Remove contrib test suite (#3403)
Wauplin Oct 7, 2025
379c06a
Strict typed dict validator (#3408)
Wauplin Oct 7, 2025
c5c1c5f
Implement dry run mode in download CLI (#3407)
Wauplin Oct 7, 2025
7505554
Remove `huggingface-cli` entirely in favor of `hf` (#3404)
Wauplin Oct 7, 2025
6af2baa
Fix proxy environment variables not used in v1.0 (#3412)
Wauplin Oct 7, 2025
f305cce
reset
Wauplin Oct 7, 2025
2a6feff
Merge branch 'main' into v1.0-release
Wauplin Oct 8, 2025
c154d28
Release: v1.0.0.rc3
Wauplin Oct 8, 2025
1ddb16f
[hf CLI] check for updates and notify user (#3418)
Wauplin Oct 8, 2025
1c39425
Fix forward ref validation if total false (#3423)
Wauplin Oct 8, 2025
59b160c
Release: v1.0.0.rc4
Wauplin Oct 8, 2025
888dbda
Disable rich in CLI (#3427)
Wauplin Oct 9, 2025
9005007
Print version only in CLI
Wauplin Oct 9, 2025
069ee68
Merge branch 'v1.0-release' of github.com:huggingface/huggingface_hub…
Wauplin Oct 9, 2025
4faf7e5
add inference endpoints cli
hanouticelina Oct 9, 2025
30c13d6
fix naming
hanouticelina Oct 9, 2025
e670188
update docs
hanouticelina Oct 9, 2025
f387a11
Merge branch 'v1.0-release' of github.com:huggingface/huggingface_hub…
hanouticelina Oct 9, 2025
b49a70a
wording
hanouticelina Oct 9, 2025
7b7b122
remove logging
hanouticelina Oct 9, 2025
0862c4a
don't instantiate logger when not needed
hanouticelina Oct 9, 2025
d81a59c
refactor
hanouticelina Oct 9, 2025
6a50b0b
remove unused import
hanouticelina Oct 9, 2025
c5b0638
nit
hanouticelina Oct 9, 2025
5b4111d
nit
hanouticelina Oct 9, 2025
7f30eb3
Apply suggestions from code review
hanouticelina Oct 13, 2025
52809ad
use docstring
hanouticelina Oct 13, 2025
5f570c2
rework CLI UX
hanouticelina Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirements:
- pip
- fsspec
- filelock
- requests
- httpx
- tqdm
- typing-extensions
- packaging
Expand All @@ -26,7 +26,7 @@ requirements:
- python
- pip
- filelock
- requests
- httpx
- tqdm
- typing-extensions
- packaging
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/check-installers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Check CLI installers

on:
push:
branches:
- main
paths:
- "utils/installers/**"
- ".github/workflows/check-installers.yml"
pull_request:
paths:
- "utils/installers/**"
- ".github/workflows/check-installers.yml"
workflow_dispatch: {}

permissions:
contents: read

jobs:
linux-installer:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run installer
shell: bash
run: |
set -euo pipefail

HF_TEST_ROOT=$(mktemp -d)
INSTALL_DIR="$HF_TEST_ROOT/install"
BIN_DIR="$HF_TEST_ROOT/bin"

HF_HOME="$INSTALL_DIR" HF_CLI_BIN_DIR="$BIN_DIR" utils/installers/install.sh --no-modify-path

export PATH="$BIN_DIR:$PATH"

HF_VERSION_PATH="$HF_TEST_ROOT/hf-version.txt"
hf version | tee "$HF_VERSION_PATH"
if ! grep -Eq 'huggingface_hub version: [0-9]+(\.[0-9]+){1,2}' "$HF_VERSION_PATH"; then
echo "hf version output missing huggingface_hub version" >&2
cat "$HF_VERSION_PATH" >&2
exit 1
fi

NO_COLOR=1 hf --help

rm -rf "$HF_TEST_ROOT"

windows-installer:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run installer
shell: pwsh
run: |
$hfTestRoot = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString())
$installDir = Join-Path $hfTestRoot 'install'
$binDir = Join-Path $hfTestRoot 'bin'
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
New-Item -ItemType Directory -Path $binDir -Force | Out-Null

$env:HF_HOME = $installDir
$env:HF_CLI_BIN_DIR = $binDir
& "$PWD/utils/installers/install.ps1" -NoModifyPath

$env:PATH = "$binDir;$env:PATH"

$hfVersionPath = Join-Path $hfTestRoot 'hf-version.txt'
& hf.exe version | Tee-Object -FilePath $hfVersionPath
if ($LASTEXITCODE -ne 0) {
throw 'hf version failed'
}
if (-not (Select-String -Path $hfVersionPath -Pattern 'huggingface_hub version: [0-9]+(\.[0-9]+){1,2}')) {
throw 'hf version output missing huggingface_hub version'
}

$env:NO_COLOR = '1'
& hf.exe --help
if ($LASTEXITCODE -ne 0) {
throw 'hf --help failed'
}
Remove-Item Env:NO_COLOR

Remove-Item -Path $hfTestRoot -Recurse -Force
50 changes: 0 additions & 50 deletions .github/workflows/contrib-tests.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/python-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:

- name: Install dependencies
run: uv pip install "huggingface_hub[dev] @ ."
- run: .venv/bin/ruff check tests src contrib # linter
- run: .venv/bin/ruff format --check tests src contrib # formatter
- run: .venv/bin/python utils/check_contrib_list.py
- run: .venv/bin/ruff check tests src # linter
- run: .venv/bin/ruff format --check tests src # formatter
- run: .venv/bin/python utils/check_inference_input_params.py
- run: .venv/bin/python utils/check_static_imports.py
- run: .venv/bin/python utils/check_all_variable.py
Expand All @@ -50,4 +49,4 @@ jobs:
- run: .venv/bin/mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback

# Run mypy on full package
- run: .venv/bin/mypy src
- run: .venv/bin/mypy src
50 changes: 10 additions & 40 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.13"]
test_name:
[
"Repository only",
"Everything else",
"Inference only",
"Xet only"
]
python-version: ["3.9", "3.13"]
test_name: ["Everything else", "Inference only", "Xet only"]
include:
- python-version: "3.13" # LFS not ran on 3.8
- python-version: "3.13" # LFS not ran on 3.9
test_name: "lfs"
- python-version: "3.8"
- python-version: "3.9"
test_name: "fastai"
- python-version: "3.10" # fastai not supported on 3.12 and 3.11 -> test it on 3.10
test_name: "fastai"
- python-version: "3.8"
test_name: "tensorflow"
- python-version: "3.10" # tensorflow not supported on 3.12 -> test it on 3.10
test_name: "tensorflow"
- python-version: "3.8" # test torch~=1.11 on python 3.8 only.
test_name: "Python 3.8, torch_1.11"
- python-version: "3.9" # test torch~=1.11 on python 3.9 only.
test_name: "Python 3.9, torch_1.11"
- python-version: "3.12" # test torch latest on python 3.12 only.
test_name: "torch_latest"
steps:
Expand All @@ -65,7 +55,7 @@ jobs:

case "${{ matrix.test_name }}" in

"Repository only" | "Everything else" | "Inference only")
"Everything else" | "Inference only")
sudo apt update
sudo apt install -y libsndfile1-dev
;;
Expand All @@ -84,17 +74,11 @@ jobs:
uv pip install --upgrade torch
;;

"Python 3.8, torch_1.11")
"Python 3.9, torch_1.11")
uv pip install "huggingface_hub[torch] @ ."
uv pip install torch~=1.11
;;

tensorflow)
sudo apt update
sudo apt install -y graphviz
uv pip install "huggingface_hub[tensorflow-testing] @ ."
;;

esac

# If not "Xet only", we want to test upload/download with regular LFS workflow
Expand All @@ -112,13 +96,6 @@ jobs:

case "${{ matrix.test_name }}" in

"Repository only")
# Run repo tests concurrently
PYTEST="$PYTEST ../tests -k 'TestRepository' -n 4"
echo $PYTEST
eval $PYTEST
;;

"Inference only")
# Run inference tests concurrently
PYTEST="$PYTEST ../tests -k 'test_inference' -n 4"
Expand All @@ -140,14 +117,7 @@ jobs:
eval "$PYTEST ../tests/test_fastai*"
;;

tensorflow)
# Cannot be on same line since '_tf*' checks if tensorflow is NOT imported by default
eval "$PYTEST ../tests/test_tf*"
eval "$PYTEST ../tests/test_keras*"
eval "$PYTEST ../tests/test_serialization.py"
;;

"Python 3.8, torch_1.11" | torch_latest)
"Python 3.9, torch_1.11" | torch_latest)
eval "$PYTEST ../tests/test_hub_mixin*"
eval "$PYTEST ../tests/test_serialization.py"
;;
Expand Down Expand Up @@ -178,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.9", "3.11"]
test_name: ["Everything else", "Xet only"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
auto-update-conda: true
auto-activate-base: false
python-version: 3.8
python-version: 3.9
activate-environment: "build-hub"

- name: Setup conda env
Expand Down
45 changes: 2 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
.PHONY: contrib quality style test
.PHONY: quality style test


check_dirs := contrib src tests utils setup.py
check_dirs := src tests utils setup.py


quality:
ruff check $(check_dirs) # linter
ruff format --check $(check_dirs) # formatter
python utils/check_inference_input_params.py
python utils/check_contrib_list.py
python utils/check_static_imports.py
python utils/check_all_variable.py
python utils/generate_async_inference_client.py
Expand All @@ -18,7 +17,6 @@ quality:
style:
ruff format $(check_dirs) # formatter
ruff check --fix $(check_dirs) # linter
python utils/check_contrib_list.py --update
python utils/check_static_imports.py --update
python utils/check_all_variable.py --update
python utils/generate_async_inference_client.py --update
Expand All @@ -38,42 +36,3 @@ repocard:

test:
pytest ./tests/

# Taken from https://stackoverflow.com/a/12110773
# Commands:
# make contrib_setup_timm : setup tests for timm
# make contrib_test_timm : run tests for timm
# make contrib_timm : setup and run tests for timm
# make contrib_clear_timm : delete timm virtual env
#
# make contrib_setup : setup ALL tests
# make contrib_test : run ALL tests
# make contrib : setup and run ALL tests
# make contrib_clear : delete all virtual envs
# Use -j4 flag to run jobs in parallel.
CONTRIB_LIBS := sentence_transformers spacy timm
CONTRIB_JOBS := $(addprefix contrib_,${CONTRIB_LIBS})
CONTRIB_CLEAR_JOBS := $(addprefix contrib_clear_,${CONTRIB_LIBS})
CONTRIB_SETUP_JOBS := $(addprefix contrib_setup_,${CONTRIB_LIBS})
CONTRIB_TEST_JOBS := $(addprefix contrib_test_,${CONTRIB_LIBS})

contrib_clear_%:
rm -rf contrib/$*/.venv

contrib_setup_%:
python3 -m venv contrib/$*/.venv
./contrib/$*/.venv/bin/pip install -r contrib/$*/requirements.txt
./contrib/$*/.venv/bin/pip uninstall -y huggingface_hub
./contrib/$*/.venv/bin/pip install -e .[testing]

contrib_test_%:
./contrib/$*/.venv/bin/python -m pytest contrib/$*

contrib_%:
make contrib_setup_$*
make contrib_test_$*

contrib: ${CONTRIB_JOBS};
contrib_clear: ${CONTRIB_CLEAR_JOBS}; echo "Successful contrib tests."
contrib_setup: ${CONTRIB_SETUP_JOBS}; echo "Successful contrib setup."
contrib_test: ${CONTRIB_TEST_JOBS}; echo "Successful contrib tests."
Loading
Loading