Skip to content
Merged
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
cd9b552
[1.0] Httpx migration (#3328)
Wauplin Sep 10, 2025
dbd164f
Bump minimal version to Python3.9 (#3343)
Wauplin Sep 10, 2025
c76b60e
Remove `HfFolder` and `InferenceAPI` classes (#3344)
Wauplin Sep 11, 2025
dd9d996
[v1.0] Remove more deprecated stuff (#3345)
Wauplin Sep 11, 2025
14565f0
[v1.0] Remove `Repository` class (#3346)
Wauplin Sep 12, 2025
8735e23
bump to 1.0.0.dev0
Wauplin Sep 12, 2025
3a65472
Remove _deprecate_positional_args on login methods (#3349)
Wauplin Sep 12, 2025
ff0a94e
[v1.0] Remove imports kept only for backward compatibility (#3350)
Wauplin Sep 12, 2025
3187fb7
[v1.0] Remove keras2 utilities (#3352)
Wauplin Sep 12, 2025
dfa880d
[v1.0] Remove anything tensorflow-related + deps (#3354)
Wauplin Sep 12, 2025
ebe60e0
Release: v1.0.0.rc0
Wauplin Sep 15, 2025
f542246
[v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357)
Wauplin Sep 17, 2025
ffcf7b0
Refactor CLI implementation using Typer (#3372)
hanouticelina Sep 18, 2025
6e07742
Make HfHubHTTPError inherit from OSError (#3387)
Wauplin Sep 24, 2025
7c5ce71
Release: v1.0.0.rc1
Wauplin Sep 24, 2025
0aac0cd
Add new HF commands (#3384)
hanouticelina Sep 25, 2025
fe626b7
Release: v1.0.0.rc2
Wauplin Sep 25, 2025
b3aff50
Document new HF commands (#3393)
hanouticelina Sep 26, 2025
baf05dd
Add cross-platform CLI Installers (#3378)
hanouticelina Sep 29, 2025
e2a12b5
update installers paths (#3400)
hanouticelina Sep 29, 2025
c4bdd37
[v1.0] feat: add migration guide for v1.0 (#3360)
google-labs-jules[bot] Oct 1, 2025
7b03e1b
prepare rc3
Wauplin Oct 2, 2025
862c22f
Remove contrib test suite (#3403)
Wauplin Oct 7, 2025
0ead923
Strict typed dict validator (#3408)
Wauplin Oct 7, 2025
617016b
Implement dry run mode in download CLI (#3407)
Wauplin Oct 7, 2025
0b5993e
Remove `huggingface-cli` entirely in favor of `hf` (#3404)
Wauplin Oct 7, 2025
ecb1f9f
Fix proxy environment variables not used in v1.0 (#3412)
Wauplin Oct 7, 2025
8a674ac
reset
Wauplin Oct 7, 2025
75adf0d
Release: v1.0.0.rc3
Wauplin Oct 8, 2025
8b7c621
[hf CLI] check for updates and notify user (#3418)
Wauplin Oct 8, 2025
d373153
Fix forward ref validation if total false (#3423)
Wauplin Oct 8, 2025
e7fbf72
Release: v1.0.0.rc4
Wauplin Oct 8, 2025
9976b08
Print version only in CLI
Wauplin Oct 9, 2025
b1550ea
Disable rich in CLI (#3427)
Wauplin Oct 9, 2025
d5fc481
Fix async client hook (#3433)
Wauplin Oct 10, 2025
1e28c24
Release: v1.0.0.rc5
Wauplin Oct 10, 2025
022f887
Expose typer_factory publicly (#3435)
Wauplin Oct 10, 2025
292628d
Release: v1.0.0.rc6
Wauplin Oct 13, 2025
55d06bd
Merge branch 'main' into v1.0-release
Wauplin Oct 15, 2025
207a641
fix docstring parameter type (#3446)
hanouticelina Oct 16, 2025
a55ec96
Fix `hf_raise_for_status` on async stream + tests (#3442)
Wauplin Oct 16, 2025
5b38f5b
[CLI] Revamp `hf cache` (#3439)
hanouticelina Oct 17, 2025
34e3fdf
[CLI] Update cache CLI docs and migration guide (#3450)
hanouticelina Oct 20, 2025
6d3a630
[InferenceClient] Server-side auto-routing for conversational task (#…
Wauplin Oct 20, 2025
36d0949
[CLI] Remove `[cli]` extra (#3451)
hanouticelina Oct 20, 2025
4864575
Remove any hf-transfer related code (#3444)
Wauplin Oct 21, 2025
121abb9
Merge branch 'main' into v1.0-release
Wauplin Oct 21, 2025
710acb1
fix stuff
Wauplin Oct 21, 2025
91e42d8
backward compatible cli tracking (v1.x) (#3459)
Wauplin Oct 21, 2025
5e4dc77
Add auto-generated CLI reference (#3462)
Wauplin Oct 22, 2025
1d6a6c6
hf transfer migration guide
Wauplin Oct 23, 2025
bd88de6
instead
Wauplin Oct 23, 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.

8 changes: 4 additions & 4 deletions .github/workflows/python-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ 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
- run: .venv/bin/python utils/generate_async_inference_client.py
- run: .venv/bin/python utils/generate_cli_reference.py --verbose
- run: .venv/bin/python utils/generate_inference_types.py
- run: .venv/bin/python utils/check_task_parameters.py
- run: uvx ty check src
Expand All @@ -50,4 +50,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
47 changes: 4 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
.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
python utils/generate_cli_reference.py

ty check src

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
python utils/generate_cli_reference.py --update

inference_check:
python utils/generate_inference_types.py
Expand All @@ -38,42 +38,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