Skip to content

Commit 52c718a

Browse files
WauplinhanouticelinaCopilotgoogle-labs-jules[bot]
authored
V1.0 release (#3464)
* [1.0] Httpx migration (#3328) * first httpx integration * more migration * some fixes * download workflow should work * Fix repocard and error utils tests * fix hf-file-system * gix http utils tests * more fixes * fix some inference tests * fix test_file_download tests * async inference client * async code should be good * Define RemoteEntryFileNotFound explicitly (+some fixes) * fix async code quality * torch ok * fix hf_file_system * fix errors tests * mock * fix test_cli mock * fix commit scheduler * add fileno test * no more requests anywhere * fix test_file_download * tmp requests * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/hf_file_system.py Co-authored-by: célina <[email protected]> * not async * fix tests --------- Co-authored-by: célina <[email protected]> * Bump minimal version to Python3.9 (#3343) * Bump minimal version to Python3.9 * use built-in generics * code quality * new batch * yet another btach * fix dataclass_with_extra * fix * keep Type for strict dataclasses * fix test * Remove `HfFolder` and `InferenceAPI` classes (#3344) * Remove HfFolder * Remove InferenceAPI * more recent gradio * bump pytest * fix python 3.9? * install gradio only on python 3.10+ * fix tests * fix tests * fix * [v1.0] Remove more deprecated stuff (#3345) * remove constants.-hf_cache_home * remove smoothly_deprecate_use_auth_token * remove get_token_permission * remove update_repo_visibility * remove is_write_action arg * remove write_permission arg from login methods * new parameter skip_if_logged_in in login methods * Remove resume_download / force_filename parameters * Remove deprecated local_dir_use_symlinks parameter * Remove deprecated language, library, task, tags from list_models * Return commit URL in upload_file/upload_folder (previously url to file/folder on the Hub) * fix upload_file/upload_folder tests * smoothly_deprecate_legacy_arguments everywhere * code quality * fix tests * fix xet tests * [v1.0] Remove `Repository` class (#3346) * Remove Repository class + adapt docs * remove fr git_vs_http * bump to 1.0.0.dev0 * Remove _deprecate_positional_args on login methods (#3349) * [v1.0] Remove imports kept only for backward compatibility (#3350) * Remove imports kept only for backward compatibility * fix tests * [v1.0] Remove keras2 utilities (#3352) * Remove keras2 utilities * remove keras from init * [v1.0] Remove anything tensorflow-related + deps (#3354) * Remove anything tensorflow-related + deps * init * fix tests * fix conflicts in tests * Release: v1.0.0.rc0 * [v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357) * HTTP configuration docs * http configuration docs * refactored git_vs_http * fix import * fix docs? * Update docs/source/en/package_reference/utilities.md Co-authored-by: célina <[email protected]> --------- Co-authored-by: célina <[email protected]> * Refactor CLI implementation using Typer (#3372) * Refactor CLI implementation using Typer (#3365) * migrate CLI to typer * (#3364) disable rich in all cases * update tests * make typer-slim a required dep * use Annotated * fix linting issues * fix tests * refactoring * update docs * use built in types * fix mypy * call whoami directly * lint * Apply suggestions from code review Co-authored-by: Lucain <[email protected]> * import Annotated from typing * Use Enums * set verbosity globally * refactor scan cache and update version docstring * centralize where Typer is defined * no need for ... * rename enum * no need for extra param name * docstring * revert * centralize arguments and options definition * add library version when initializing HfApi * add auto-completion * sort commands alphabetically * suggestions * centralize jobs params and HfApi initialization * fix --------- Co-authored-by: Lucain <[email protected]> * update docs --------- Co-authored-by: Lucain <[email protected]> * Make HfHubHTTPError inherit from OSError (#3387) * Release: v1.0.0.rc1 * Add new HF commands (#3384) * [1.0] Httpx migration (#3328) * first httpx integration * more migration * some fixes * download workflow should work * Fix repocard and error utils tests * fix hf-file-system * gix http utils tests * more fixes * fix some inference tests * fix test_file_download tests * async inference client * async code should be good * Define RemoteEntryFileNotFound explicitly (+some fixes) * fix async code quality * torch ok * fix hf_file_system * fix errors tests * mock * fix test_cli mock * fix commit scheduler * add fileno test * no more requests anywhere * fix test_file_download * tmp requests * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/hf_file_system.py Co-authored-by: célina <[email protected]> * not async * fix tests --------- Co-authored-by: célina <[email protected]> * Bump minimal version to Python3.9 (#3343) * Bump minimal version to Python3.9 * use built-in generics * code quality * new batch * yet another btach * fix dataclass_with_extra * fix * keep Type for strict dataclasses * fix test * Remove `HfFolder` and `InferenceAPI` classes (#3344) * Remove HfFolder * Remove InferenceAPI * more recent gradio * bump pytest * fix python 3.9? * install gradio only on python 3.10+ * fix tests * fix tests * fix * [v1.0] Remove more deprecated stuff (#3345) * remove constants.-hf_cache_home * remove smoothly_deprecate_use_auth_token * remove get_token_permission * remove update_repo_visibility * remove is_write_action arg * remove write_permission arg from login methods * new parameter skip_if_logged_in in login methods * Remove resume_download / force_filename parameters * Remove deprecated local_dir_use_symlinks parameter * Remove deprecated language, library, task, tags from list_models * Return commit URL in upload_file/upload_folder (previously url to file/folder on the Hub) * fix upload_file/upload_folder tests * smoothly_deprecate_legacy_arguments everywhere * code quality * fix tests * fix xet tests * [v1.0] Remove `Repository` class (#3346) * Remove Repository class + adapt docs * remove fr git_vs_http * bump to 1.0.0.dev0 * Remove _deprecate_positional_args on login methods (#3349) * [v1.0] Remove imports kept only for backward compatibility (#3350) * Remove imports kept only for backward compatibility * fix tests * [v1.0] Remove keras2 utilities (#3352) * Remove keras2 utilities * remove keras from init * [v1.0] Remove anything tensorflow-related + deps (#3354) * Remove anything tensorflow-related + deps * init * fix tests * fix conflicts in tests * Release: v1.0.0.rc0 * [v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357) * HTTP configuration docs * http configuration docs * refactored git_vs_http * fix import * fix docs? * Update docs/source/en/package_reference/utilities.md Co-authored-by: célina <[email protected]> --------- Co-authored-by: célina <[email protected]> * Refactor CLI implementation using Typer (#3372) * Refactor CLI implementation using Typer (#3365) * migrate CLI to typer * (#3364) disable rich in all cases * update tests * make typer-slim a required dep * use Annotated * fix linting issues * fix tests * refactoring * update docs * use built in types * fix mypy * call whoami directly * lint * Apply suggestions from code review Co-authored-by: Lucain <[email protected]> * import Annotated from typing * Use Enums * set verbosity globally * refactor scan cache and update version docstring * centralize where Typer is defined * no need for ... * rename enum * no need for extra param name * docstring * revert * centralize arguments and options definition * add library version when initializing HfApi * add auto-completion * sort commands alphabetically * suggestions * centralize jobs params and HfApi initialization * fix --------- Co-authored-by: Lucain <[email protected]> * update docs --------- Co-authored-by: Lucain <[email protected]> * add hf repo delete command * add repo settings, repo move, repo branch commands * fix test * Apply suggestions from code review Co-authored-by: Lucain <[email protected]> --------- Co-authored-by: Lucain <[email protected]> Co-authored-by: Lucain Pouget <[email protected]> * Release: v1.0.0.rc2 * Document new HF commands (#3393) * add docs for new hf commands * typo * add cli examples in repository * Add cross-platform CLI Installers (#3378) * [1.0] Httpx migration (#3328) * first httpx integration * more migration * some fixes * download workflow should work * Fix repocard and error utils tests * fix hf-file-system * gix http utils tests * more fixes * fix some inference tests * fix test_file_download tests * async inference client * async code should be good * Define RemoteEntryFileNotFound explicitly (+some fixes) * fix async code quality * torch ok * fix hf_file_system * fix errors tests * mock * fix test_cli mock * fix commit scheduler * add fileno test * no more requests anywhere * fix test_file_download * tmp requests * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/hf_file_system.py Co-authored-by: célina <[email protected]> * not async * fix tests --------- Co-authored-by: célina <[email protected]> * Bump minimal version to Python3.9 (#3343) * Bump minimal version to Python3.9 * use built-in generics * code quality * new batch * yet another btach * fix dataclass_with_extra * fix * keep Type for strict dataclasses * fix test * Remove `HfFolder` and `InferenceAPI` classes (#3344) * Remove HfFolder * Remove InferenceAPI * more recent gradio * bump pytest * fix python 3.9? * install gradio only on python 3.10+ * fix tests * fix tests * fix * [v1.0] Remove more deprecated stuff (#3345) * remove constants.-hf_cache_home * remove smoothly_deprecate_use_auth_token * remove get_token_permission * remove update_repo_visibility * remove is_write_action arg * remove write_permission arg from login methods * new parameter skip_if_logged_in in login methods * Remove resume_download / force_filename parameters * Remove deprecated local_dir_use_symlinks parameter * Remove deprecated language, library, task, tags from list_models * Return commit URL in upload_file/upload_folder (previously url to file/folder on the Hub) * fix upload_file/upload_folder tests * smoothly_deprecate_legacy_arguments everywhere * code quality * fix tests * fix xet tests * [v1.0] Remove `Repository` class (#3346) * Remove Repository class + adapt docs * remove fr git_vs_http * bump to 1.0.0.dev0 * Remove _deprecate_positional_args on login methods (#3349) * [v1.0] Remove imports kept only for backward compatibility (#3350) * Remove imports kept only for backward compatibility * fix tests * [v1.0] Remove keras2 utilities (#3352) * Remove keras2 utilities * remove keras from init * [v1.0] Remove anything tensorflow-related + deps (#3354) * Remove anything tensorflow-related + deps * init * fix tests * fix conflicts in tests * Release: v1.0.0.rc0 * [v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357) * HTTP configuration docs * http configuration docs * refactored git_vs_http * fix import * fix docs? * Update docs/source/en/package_reference/utilities.md Co-authored-by: célina <[email protected]> --------- Co-authored-by: célina <[email protected]> * Refactor CLI implementation using Typer (#3372) * Refactor CLI implementation using Typer (#3365) * migrate CLI to typer * (#3364) disable rich in all cases * update tests * make typer-slim a required dep * use Annotated * fix linting issues * fix tests * refactoring * update docs * use built in types * fix mypy * call whoami directly * lint * Apply suggestions from code review Co-authored-by: Lucain <[email protected]> * import Annotated from typing * Use Enums * set verbosity globally * refactor scan cache and update version docstring * centralize where Typer is defined * no need for ... * rename enum * no need for extra param name * docstring * revert * centralize arguments and options definition * add library version when initializing HfApi * add auto-completion * sort commands alphabetically * suggestions * centralize jobs params and HfApi initialization * fix --------- Co-authored-by: Lucain <[email protected]> * update docs --------- Co-authored-by: Lucain <[email protected]> * add installers * fix windows * fix log * fix workflow? * fix workflow again * add debugging steps * fix * remove bin dir and install dir params * update workflow * remove version param * document usage * [1.0] Httpx migration (#3328) * first httpx integration * more migration * some fixes * download workflow should work * Fix repocard and error utils tests * fix hf-file-system * gix http utils tests * more fixes * fix some inference tests * fix test_file_download tests * async inference client * async code should be good * Define RemoteEntryFileNotFound explicitly (+some fixes) * fix async code quality * torch ok * fix hf_file_system * fix errors tests * mock * fix test_cli mock * fix commit scheduler * add fileno test * no more requests anywhere * fix test_file_download * tmp requests * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/hf_file_system.py Co-authored-by: célina <[email protected]> * not async * fix tests --------- Co-authored-by: célina <[email protected]> * Bump minimal version to Python3.9 (#3343) * Bump minimal version to Python3.9 * use built-in generics * code quality * new batch * yet another btach * fix dataclass_with_extra * fix * keep Type for strict dataclasses * fix test * Remove `HfFolder` and `InferenceAPI` classes (#3344) * Remove HfFolder * Remove InferenceAPI * more recent gradio * bump pytest * fix python 3.9? * install gradio only on python 3.10+ * fix tests * fix tests * fix * [v1.0] Remove more deprecated stuff (#3345) * remove constants.-hf_cache_home * remove smoothly_deprecate_use_auth_token * remove get_token_permission * remove update_repo_visibility * remove is_write_action arg * remove write_permission arg from login methods * new parameter skip_if_logged_in in login methods * Remove resume_download / force_filename parameters * Remove deprecated local_dir_use_symlinks parameter * Remove deprecated language, library, task, tags from list_models * Return commit URL in upload_file/upload_folder (previously url to file/folder on the Hub) * fix upload_file/upload_folder tests * smoothly_deprecate_legacy_arguments everywhere * code quality * fix tests * fix xet tests * [v1.0] Remove `Repository` class (#3346) * Remove Repository class + adapt docs * remove fr git_vs_http * bump to 1.0.0.dev0 * Remove _deprecate_positional_args on login methods (#3349) * [v1.0] Remove imports kept only for backward compatibility (#3350) * Remove imports kept only for backward compatibility * fix tests * [v1.0] Remove keras2 utilities (#3352) * Remove keras2 utilities * remove keras from init * [v1.0] Remove anything tensorflow-related + deps (#3354) * Remove anything tensorflow-related + deps * init * fix tests * fix conflicts in tests * Release: v1.0.0.rc0 * [v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357) * HTTP configuration docs * http configuration docs * refactored git_vs_http * fix import * fix docs? * Update docs/source/en/package_reference/utilities.md Co-authored-by: célina <[email protected]> --------- Co-authored-by: célina <[email protected]> * Refactor CLI implementation using Typer (#3372) * Refactor CLI implementation using Typer (#3365) * migrate CLI to typer * (#3364) disable rich in all cases * update tests * make typer-slim a required dep * use Annotated * fix linting issues * fix tests * refactoring * update docs * use built in types * fix mypy * call whoami directly * lint * Apply suggestions from code review Co-authored-by: Lucain <[email protected]> * import Annotated from typing * Use Enums * set verbosity globally * refactor scan cache and update version docstring * centralize where Typer is defined * no need for ... * rename enum * no need for extra param name * docstring * revert * centralize arguments and options definition * add library version when initializing HfApi * add auto-completion * sort commands alphabetically * suggestions * centralize jobs params and HfApi initialization * fix --------- Co-authored-by: Lucain <[email protected]> * update docs --------- Co-authored-by: Lucain <[email protected]> * Make HfHubHTTPError inherit from OSError (#3387) * Release: v1.0.0.rc1 * print relevant message based on the linux distro * better warning message * log info instead of warning * copilot suggestions * Update utils/installers/install.sh Co-authored-by: Copilot <[email protected]> * update docs --------- Co-authored-by: Lucain <[email protected]> Co-authored-by: Lucain Pouget <[email protected]> Co-authored-by: Copilot <[email protected]> * update installers paths (#3400) * [v1.0] feat: add migration guide for v1.0 (#3360) * [1.0] Httpx migration (#3328) * first httpx integration * more migration * some fixes * download workflow should work * Fix repocard and error utils tests * fix hf-file-system * gix http utils tests * more fixes * fix some inference tests * fix test_file_download tests * async inference client * async code should be good * Define RemoteEntryFileNotFound explicitly (+some fixes) * fix async code quality * torch ok * fix hf_file_system * fix errors tests * mock * fix test_cli mock * fix commit scheduler * add fileno test * no more requests anywhere * fix test_file_download * tmp requests * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/utils/_http.py Co-authored-by: célina <[email protected]> * Update src/huggingface_hub/hf_file_system.py Co-authored-by: célina <[email protected]> * not async * fix tests --------- Co-authored-by: célina <[email protected]> * Bump minimal version to Python3.9 (#3343) * Bump minimal version to Python3.9 * use built-in generics * code quality * new batch * yet another btach * fix dataclass_with_extra * fix * keep Type for strict dataclasses * fix test * Remove `HfFolder` and `InferenceAPI` classes (#3344) * Remove HfFolder * Remove InferenceAPI * more recent gradio * bump pytest * fix python 3.9? * install gradio only on python 3.10+ * fix tests * fix tests * fix * [v1.0] Remove more deprecated stuff (#3345) * remove constants.-hf_cache_home * remove smoothly_deprecate_use_auth_token * remove get_token_permission * remove update_repo_visibility * remove is_write_action arg * remove write_permission arg from login methods * new parameter skip_if_logged_in in login methods * Remove resume_download / force_filename parameters * Remove deprecated local_dir_use_symlinks parameter * Remove deprecated language, library, task, tags from list_models * Return commit URL in upload_file/upload_folder (previously url to file/folder on the Hub) * fix upload_file/upload_folder tests * smoothly_deprecate_legacy_arguments everywhere * code quality * fix tests * fix xet tests * [v1.0] Remove `Repository` class (#3346) * Remove Repository class + adapt docs * remove fr git_vs_http * bump to 1.0.0.dev0 * Remove _deprecate_positional_args on login methods (#3349) * [v1.0] Remove imports kept only for backward compatibility (#3350) * Remove imports kept only for backward compatibility * fix tests * [v1.0] Remove keras2 utilities (#3352) * Remove keras2 utilities * remove keras from init * [v1.0] Remove anything tensorflow-related + deps (#3354) * Remove anything tensorflow-related + deps * init * fix tests * fix conflicts in tests * HTTP configuration docs * http configuration docs * refactored git_vs_http * feat: add migration guide for v1.0 This commit adds a comprehensive migration guide for the v1.0 release of the `huggingface_hub` library. The guide is located at `docs/source/en/concepts/migration.md` and provides a detailed list of main changes and breaking changes, along with instructions on how to adapt to them. The migration guide covers the following topics: - HTTPX migration - Python 3.9+ requirement - Removal of deprecated features - Removal of the `Repository`, `HfFolder`, and `InferenceApi` classes - Removal of TensorFlow and Keras 2 integrations This guide is intended to help users migrate their existing code to the new version of the library smoothly. Fixes #3358 [Auto-generated by https://jules.google.com/] * rewrite migration guide * fix import * fix docs? * add why httpx section * Update docs/source/en/concepts/migration.md --------- Co-authored-by: Lucain <[email protected]> Co-authored-by: célina <[email protected]> Co-authored-by: Lucain Pouget <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * prepare rc3 * Remove contrib test suite (#3403) * Strict typed dict validator (#3408) * Strict typed dict validator * better type hint * work with Required / NotREquired * Make it work with Python 3.11 * correctly handle total=False * fix python 3.9+ * fix python 3.9 * Implement dry run mode in download CLI (#3407) * Implement dry run mode * docs * more docs * quality * quality * fix cli test * Apply suggestions from code review Co-authored-by: célina <[email protected]> * fix test on widnwso --------- Co-authored-by: célina <[email protected]> * Remove `huggingface-cli` entirely in favor of `hf` (#3404) * Remove huggingface-cli entirely in favor of hf * dup * Fix proxy environment variables not used in v1.0 (#3412) * Use EventHooks instead of custom Transport * add test * Update tests/test_utils_http.py Co-authored-by: célina <[email protected]> --------- Co-authored-by: célina <[email protected]> * reset * Release: v1.0.0.rc3 * [hf CLI] check for updates and notify user (#3418) * [hf CLI] check for updates and notify user * no alpha or beta * dirty check * check once every 24h * move ANSI / tabulate utils to their own module to avoid circular import issues * do not touch installers CI * Update src/huggingface_hub/cli/_cli_utils.py Co-authored-by: célina <[email protected]> * docstring * update powershell command --------- Co-authored-by: célina <[email protected]> * Fix forward ref validation if total false (#3423) * Release: v1.0.0.rc4 * Print version only in CLI * Disable rich in CLI (#3427) * Fix async client hook (#3433) * Release: v1.0.0.rc5 * Expose typer_factory publicly (#3435) * Release: v1.0.0.rc6 * fix docstring parameter type (#3446) * Fix `hf_raise_for_status` on async stream + tests (#3442) * Fix hf_raise_for_status on async stream + tests * use response hook * [CLI] Revamp `hf cache` (#3439) * apply revamp-hf-cache on top of rebased v1.0-release * remove binary prefixes (KIB, MIB, GIB, TIB, PIB) * remove redundant negative check * refactor helpers * refactor helpers * improve filter keys and error messages * remove str fields * raise value error if op not in dict * tweak csv * add cache summary after table printing * fix parsing * filtering * nit * remove unnecessary default value * add docstring for helpers * use typer.confirm * refacto * more docstring * remove id filter * review suggestions * [CLI] Update cache CLI docs and migration guide (#3450) * update docs and migration guide * update * add pipe examples * update ko docs * [InferenceClient] Server-side auto-routing for conversational task (#3448) * Server-side auto-routing for conversational task * no /auto in path * [CLI] Remove `[cli]` extra (#3451) * remove cli extra * fix * too fast * reorder deps by alphabetical order * Remove any hf-transfer related code (#3444) * Remove any hf-transfer related code * quality * fix tests * more docs removed * inconsistency * remove xet_enabled setting * last doc review? * Update docs/source/en/guides/upload.md Co-authored-by: célina <[email protected]> * Update docs/source/en/guides/download.md Co-authored-by: célina <[email protected]> * Update docs/source/en/package_reference/environment_variables.md Co-authored-by: célina <[email protected]> * forgot one * fix test * unparallelize hf_transfer for now * fix test --------- Co-authored-by: célina <[email protected]> * fix stuff * backward compatible cli tracking (v1.x) (#3459) * backward compatible cli tracking * fix test * Add auto-generated CLI reference (#3462) * Add auto-generated CLI reference * add tip in CLI guide * clearer message * add verbsoe mode * dummy guy * fix encoding issues * hf transfer migration guide * instead --------- Co-authored-by: célina <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 61bc87e commit 52c718a

File tree

245 files changed

+10832
-16786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+10832
-16786
lines changed

.github/conda/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ requirements:
1616
- pip
1717
- fsspec
1818
- filelock
19-
- requests
19+
- httpx
2020
- tqdm
2121
- typing-extensions
2222
- packaging
@@ -26,7 +26,7 @@ requirements:
2626
- python
2727
- pip
2828
- filelock
29-
- requests
29+
- httpx
3030
- tqdm
3131
- typing-extensions
3232
- packaging
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Check CLI installers
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "utils/installers/**"
9+
- ".github/workflows/check-installers.yml"
10+
pull_request:
11+
paths:
12+
- "utils/installers/**"
13+
- ".github/workflows/check-installers.yml"
14+
workflow_dispatch: {}
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
linux-installer:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Run installer
27+
shell: bash
28+
run: |
29+
set -euo pipefail
30+
31+
HF_TEST_ROOT=$(mktemp -d)
32+
INSTALL_DIR="$HF_TEST_ROOT/install"
33+
BIN_DIR="$HF_TEST_ROOT/bin"
34+
35+
HF_HOME="$INSTALL_DIR" HF_CLI_BIN_DIR="$BIN_DIR" utils/installers/install.sh --no-modify-path
36+
37+
export PATH="$BIN_DIR:$PATH"
38+
39+
HF_VERSION_PATH="$HF_TEST_ROOT/hf-version.txt"
40+
hf version | tee "$HF_VERSION_PATH"
41+
if ! grep -Eq 'huggingface_hub version: [0-9]+(\.[0-9]+){1,2}' "$HF_VERSION_PATH"; then
42+
echo "hf version output missing huggingface_hub version" >&2
43+
cat "$HF_VERSION_PATH" >&2
44+
exit 1
45+
fi
46+
47+
NO_COLOR=1 hf --help
48+
49+
rm -rf "$HF_TEST_ROOT"
50+
51+
windows-installer:
52+
runs-on: windows-latest
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v4
56+
57+
- name: Run installer
58+
shell: pwsh
59+
run: |
60+
$hfTestRoot = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString())
61+
$installDir = Join-Path $hfTestRoot 'install'
62+
$binDir = Join-Path $hfTestRoot 'bin'
63+
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
64+
New-Item -ItemType Directory -Path $binDir -Force | Out-Null
65+
66+
$env:HF_HOME = $installDir
67+
$env:HF_CLI_BIN_DIR = $binDir
68+
& "$PWD/utils/installers/install.ps1" -NoModifyPath
69+
70+
$env:PATH = "$binDir;$env:PATH"
71+
72+
$hfVersionPath = Join-Path $hfTestRoot 'hf-version.txt'
73+
& hf.exe version | Tee-Object -FilePath $hfVersionPath
74+
if ($LASTEXITCODE -ne 0) {
75+
throw 'hf version failed'
76+
}
77+
if (-not (Select-String -Path $hfVersionPath -Pattern 'huggingface_hub version: [0-9]+(\.[0-9]+){1,2}')) {
78+
throw 'hf version output missing huggingface_hub version'
79+
}
80+
81+
$env:NO_COLOR = '1'
82+
& hf.exe --help
83+
if ($LASTEXITCODE -ne 0) {
84+
throw 'hf --help failed'
85+
}
86+
Remove-Item Env:NO_COLOR
87+
88+
Remove-Item -Path $hfTestRoot -Recurse -Force

.github/workflows/contrib-tests.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/python-quality.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
3636
- name: Install dependencies
3737
run: uv pip install "huggingface_hub[dev] @ ."
38-
- run: .venv/bin/ruff check tests src contrib # linter
39-
- run: .venv/bin/ruff format --check tests src contrib # formatter
40-
- run: .venv/bin/python utils/check_contrib_list.py
38+
- run: .venv/bin/ruff check tests src # linter
39+
- run: .venv/bin/ruff format --check tests src # formatter
4140
- run: .venv/bin/python utils/check_inference_input_params.py
4241
- run: .venv/bin/python utils/check_static_imports.py
4342
- run: .venv/bin/python utils/check_all_variable.py
4443
- run: .venv/bin/python utils/generate_async_inference_client.py
44+
- run: .venv/bin/python utils/generate_cli_reference.py --verbose
4545
- run: .venv/bin/python utils/generate_inference_types.py
4646
- run: .venv/bin/python utils/check_task_parameters.py
4747
- run: uvx ty check src
@@ -50,4 +50,4 @@ jobs:
5050
- run: .venv/bin/mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback
5151

5252
# Run mypy on full package
53-
- run: .venv/bin/mypy src
53+
- run: .venv/bin/mypy src

.github/workflows/python-tests.yml

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,17 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
python-version: ["3.8", "3.13"]
25-
test_name:
26-
[
27-
"Repository only",
28-
"Everything else",
29-
"Inference only",
30-
"Xet only"
31-
]
24+
python-version: ["3.9", "3.13"]
25+
test_name: ["Everything else", "Inference only", "Xet only"]
3226
include:
33-
- python-version: "3.13" # LFS not ran on 3.8
27+
- python-version: "3.13" # LFS not ran on 3.9
3428
test_name: "lfs"
35-
- python-version: "3.8"
29+
- python-version: "3.9"
3630
test_name: "fastai"
3731
- python-version: "3.10" # fastai not supported on 3.12 and 3.11 -> test it on 3.10
3832
test_name: "fastai"
39-
- python-version: "3.8"
40-
test_name: "tensorflow"
41-
- python-version: "3.10" # tensorflow not supported on 3.12 -> test it on 3.10
42-
test_name: "tensorflow"
43-
- python-version: "3.8" # test torch~=1.11 on python 3.8 only.
44-
test_name: "Python 3.8, torch_1.11"
33+
- python-version: "3.9" # test torch~=1.11 on python 3.9 only.
34+
test_name: "Python 3.9, torch_1.11"
4535
- python-version: "3.12" # test torch latest on python 3.12 only.
4636
test_name: "torch_latest"
4737
steps:
@@ -65,7 +55,7 @@ jobs:
6555
6656
case "${{ matrix.test_name }}" in
6757
68-
"Repository only" | "Everything else" | "Inference only")
58+
"Everything else" | "Inference only")
6959
sudo apt update
7060
sudo apt install -y libsndfile1-dev
7161
;;
@@ -84,17 +74,11 @@ jobs:
8474
uv pip install --upgrade torch
8575
;;
8676
87-
"Python 3.8, torch_1.11")
77+
"Python 3.9, torch_1.11")
8878
uv pip install "huggingface_hub[torch] @ ."
8979
uv pip install torch~=1.11
9080
;;
9181
92-
tensorflow)
93-
sudo apt update
94-
sudo apt install -y graphviz
95-
uv pip install "huggingface_hub[tensorflow-testing] @ ."
96-
;;
97-
9882
esac
9983
10084
# If not "Xet only", we want to test upload/download with regular LFS workflow
@@ -112,13 +96,6 @@ jobs:
11296
11397
case "${{ matrix.test_name }}" in
11498
115-
"Repository only")
116-
# Run repo tests concurrently
117-
PYTEST="$PYTEST ../tests -k 'TestRepository' -n 4"
118-
echo $PYTEST
119-
eval $PYTEST
120-
;;
121-
12299
"Inference only")
123100
# Run inference tests concurrently
124101
PYTEST="$PYTEST ../tests -k 'test_inference' -n 4"
@@ -140,14 +117,7 @@ jobs:
140117
eval "$PYTEST ../tests/test_fastai*"
141118
;;
142119
143-
tensorflow)
144-
# Cannot be on same line since '_tf*' checks if tensorflow is NOT imported by default
145-
eval "$PYTEST ../tests/test_tf*"
146-
eval "$PYTEST ../tests/test_keras*"
147-
eval "$PYTEST ../tests/test_serialization.py"
148-
;;
149-
150-
"Python 3.8, torch_1.11" | torch_latest)
120+
"Python 3.9, torch_1.11" | torch_latest)
151121
eval "$PYTEST ../tests/test_hub_mixin*"
152122
eval "$PYTEST ../tests/test_serialization.py"
153123
;;
@@ -178,7 +148,7 @@ jobs:
178148
strategy:
179149
fail-fast: false
180150
matrix:
181-
python-version: ["3.8", "3.11"]
151+
python-version: ["3.9", "3.11"]
182152
test_name: ["Everything else", "Xet only"]
183153

184154
steps:

.github/workflows/release-conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
auto-update-conda: true
2828
auto-activate-base: false
29-
python-version: 3.8
29+
python-version: 3.9
3030
activate-environment: "build-hub"
3131

3232
- name: Setup conda env

Makefile

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
.PHONY: contrib quality style test
1+
.PHONY: quality style test
22

33

4-
check_dirs := contrib src tests utils setup.py
4+
check_dirs := src tests utils setup.py
55

66

77
quality:
88
ruff check $(check_dirs) # linter
99
ruff format --check $(check_dirs) # formatter
1010
python utils/check_inference_input_params.py
11-
python utils/check_contrib_list.py
1211
python utils/check_static_imports.py
1312
python utils/check_all_variable.py
1413
python utils/generate_async_inference_client.py
14+
python utils/generate_cli_reference.py
1515

1616
ty check src
1717

1818
style:
1919
ruff format $(check_dirs) # formatter
2020
ruff check --fix $(check_dirs) # linter
21-
python utils/check_contrib_list.py --update
2221
python utils/check_static_imports.py --update
2322
python utils/check_all_variable.py --update
2423
python utils/generate_async_inference_client.py --update
24+
python utils/generate_cli_reference.py --update
2525

2626
inference_check:
2727
python utils/generate_inference_types.py
@@ -38,42 +38,3 @@ repocard:
3838

3939
test:
4040
pytest ./tests/
41-
42-
# Taken from https://stackoverflow.com/a/12110773
43-
# Commands:
44-
# make contrib_setup_timm : setup tests for timm
45-
# make contrib_test_timm : run tests for timm
46-
# make contrib_timm : setup and run tests for timm
47-
# make contrib_clear_timm : delete timm virtual env
48-
#
49-
# make contrib_setup : setup ALL tests
50-
# make contrib_test : run ALL tests
51-
# make contrib : setup and run ALL tests
52-
# make contrib_clear : delete all virtual envs
53-
# Use -j4 flag to run jobs in parallel.
54-
CONTRIB_LIBS := sentence_transformers spacy timm
55-
CONTRIB_JOBS := $(addprefix contrib_,${CONTRIB_LIBS})
56-
CONTRIB_CLEAR_JOBS := $(addprefix contrib_clear_,${CONTRIB_LIBS})
57-
CONTRIB_SETUP_JOBS := $(addprefix contrib_setup_,${CONTRIB_LIBS})
58-
CONTRIB_TEST_JOBS := $(addprefix contrib_test_,${CONTRIB_LIBS})
59-
60-
contrib_clear_%:
61-
rm -rf contrib/$*/.venv
62-
63-
contrib_setup_%:
64-
python3 -m venv contrib/$*/.venv
65-
./contrib/$*/.venv/bin/pip install -r contrib/$*/requirements.txt
66-
./contrib/$*/.venv/bin/pip uninstall -y huggingface_hub
67-
./contrib/$*/.venv/bin/pip install -e .[testing]
68-
69-
contrib_test_%:
70-
./contrib/$*/.venv/bin/python -m pytest contrib/$*
71-
72-
contrib_%:
73-
make contrib_setup_$*
74-
make contrib_test_$*
75-
76-
contrib: ${CONTRIB_JOBS};
77-
contrib_clear: ${CONTRIB_CLEAR_JOBS}; echo "Successful contrib tests."
78-
contrib_setup: ${CONTRIB_SETUP_JOBS}; echo "Successful contrib setup."
79-
contrib_test: ${CONTRIB_TEST_JOBS}; echo "Successful contrib tests."

0 commit comments

Comments
 (0)