Skip to content

[1.0] Httpx migration#3328

Merged
Wauplin merged 32 commits intov1.0-releasefrom
httpx-migration
Sep 10, 2025
Merged

[1.0] Httpx migration#3328
Wauplin merged 32 commits intov1.0-releasefrom
httpx-migration

Conversation

@Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Sep 3, 2025

Draft to migrate from requests to httpx.

Opening this PR to trigger CI. Mid-term goal is to merge the branch into a "v1-milestone" branch.

Breaking changes so far:

  • "per method" proxies ignored => should be set globally
  • configure_http_backend => set_client_factory/set_async_client_factory (and all this low-level stuff in general). Still keeping get_session the same.
  • no more requests.HTTPError raised, only httpx.HTTPError. Good practice is to catch HfHubHttpError (both backward and forward compatible)
  • httpx doesn't have the concept of SSLError (it's just a generic ConnectError). In the download process we used to raise on SSLError (which is a subclass of ConnectionError) but not other ConnectionErrors. Let's reassess this later.
  • InferenceClient can now be used as a context manager with InferenceClient(...) as client:. Benefit is to be sure connections are closed (especially useful when streaming tokens from an LLM)
  • trust_env removed from AsyncInferenceClient init parameters
  • LocalEntryNotFoundError do not derive from HTTPError anymore. We now have EntryNotFoundError(Exception), LocalEntryNotFoundError (file not found + entry not found errors) and RemoteEntryNotFoundError (http error + entry not found error)

Resources:

@HuggingFaceDocBuilderDev

It looks like you've updated code related to model or dataset cards in this PR.

Some content is duplicated among the following files. Please make sure that everything stays consistent.

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 5, 2025

Script to test inference locally:

import asyncio

from huggingface_hub import AsyncInferenceClient, InferenceClient


CHAT_MODEL = "openai/gpt-oss-20b"
CHAT_MESSAGE = {"role": "user", "content": "What is the capital of France?"}

# chat completion - sync

print("\nChat completion - sync\n")

client = InferenceClient(provider="groq", model=CHAT_MODEL)
stream = client.chat.completions.create(messages=[CHAT_MESSAGE], stream=True)
for chunk in stream:
    print(chunk.choices[0].delta.reasoning or chunk.choices[0].delta.content, end="")


# chat completion - async

print("\n\nChat completion - async\n")


async def main():
    client = AsyncInferenceClient(provider="groq", model=CHAT_MODEL)
    stream = await client.chat.completions.create(messages=[CHAT_MESSAGE], stream=True)
    async for chunk in stream:
        print(chunk.choices[0].delta.reasoning or chunk.choices[0].delta.content, end="")


asyncio.run(main())


# image to image - sync

print("\n\nImage to image - sync\n")

client = InferenceClient(provider="fal-ai", model="Qwen/Qwen-Image-Edit")
image = client.image_to_image("https://cataas.com/cat", prompt="turn the cat into a tiger")
image.save("tiger_sync.jpg")

# image to image - async

print("\nImage to image - async\n")


async def main():
    client = AsyncInferenceClient(provider="fal-ai", model="Qwen/Qwen-Image-Edit")
    image = await client.image_to_image("https://cataas.com/cat", prompt="turn the cat into a tiger")
    image.save("tiger_async.jpg")


asyncio.run(main())

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited about this! 🔥
the number of loc changes and file changed might seems scary but it's quite easy to review! I didn't review the tests yet though, I will do that in a second round of review 😄



def get_session() -> requests.Session:
async def set_async_client_factory(async_client_factory: ASYNC_CLIENT_FACTORY_T) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to make this function async since it makes no I/O and doesn't await anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. Not needed indeed 👍 (I changed the logic several times TBH and at first it was required)

Co-authored-by: célina <hanouticelina@gmail.com>
Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all the changes made to the tests! all good

@Wauplin Wauplin changed the base branch from main to v1.0-release September 9, 2025 15:33
@Wauplin Wauplin changed the title [WIP] [DO NOT MERGE] Httpx migration [1.0] Httpx migration Sep 9, 2025
@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 9, 2025

I've updated the target branch to v1.0-release. Possible to re-review/approve @hanouticelina

I'll handle the documentation part separately.

@Wauplin Wauplin marked this pull request as ready for review September 9, 2025 15:34
@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 10, 2025

Merging on v1.0-release for now but feel free to comment on this PR.

@Wauplin Wauplin merged commit d40e4ac into v1.0-release Sep 10, 2025
26 of 27 checks passed
@Wauplin Wauplin deleted the httpx-migration branch September 10, 2025 13:29
hanouticelina added a commit that referenced this pull request Sep 24, 2025
* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>
hanouticelina added a commit that referenced this pull request Sep 25, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* add hf repo delete command

* add repo settings, repo move, repo branch commands

* fix test

* Apply suggestions from code review

Co-authored-by: Lucain <lucain@huggingface.co>

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
hanouticelina added a commit that referenced this pull request Sep 25, 2025
* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>
hanouticelina added a commit that referenced this pull request Sep 25, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* add hf repo delete command

* add repo settings, repo move, repo branch commands

* fix test

* Apply suggestions from code review

Co-authored-by: Lucain <lucain@huggingface.co>

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
hanouticelina added a commit that referenced this pull request Sep 29, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <175728472+Copilot@users.noreply.github.com>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Wauplin added a commit that referenced this pull request Oct 1, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>
Co-authored-by: célina <hanouticelina@gmail.com>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
hanouticelina added a commit that referenced this pull request Oct 14, 2025
* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>
hanouticelina added a commit that referenced this pull request Oct 14, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* add hf repo delete command

* add repo settings, repo move, repo branch commands

* fix test

* Apply suggestions from code review

Co-authored-by: Lucain <lucain@huggingface.co>

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
hanouticelina added a commit that referenced this pull request Oct 14, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <175728472+Copilot@users.noreply.github.com>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
hanouticelina added a commit that referenced this pull request Oct 14, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>
Co-authored-by: célina <hanouticelina@gmail.com>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Wauplin added a commit that referenced this pull request Oct 23, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* add hf repo delete command

* add repo settings, repo move, repo branch commands

* fix test

* Apply suggestions from code review

Co-authored-by: Lucain <lucain@huggingface.co>

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <175728472+Copilot@users.noreply.github.com>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>
Co-authored-by: célina <hanouticelina@gmail.com>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
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 <hanouticelina@gmail.com>

* fix test on widnwso

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

* docstring

* update powershell command

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

* Update docs/source/en/guides/download.md

Co-authored-by: célina <hanouticelina@gmail.com>

* Update docs/source/en/package_reference/environment_variables.md

Co-authored-by: célina <hanouticelina@gmail.com>

* forgot one

* fix test

* unparallelize hf_transfer for now

* fix test

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
hanouticelina added a commit that referenced this pull request Nov 5, 2025
* [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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* add hf repo delete command

* add repo settings, repo move, repo branch commands

* fix test

* Apply suggestions from code review

Co-authored-by: Lucain <lucain@huggingface.co>

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>

* 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 <lucain@huggingface.co>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>

* 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 <175728472+Copilot@users.noreply.github.com>

* update docs

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* 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 <hanouticelina@gmail.com>

* Update src/huggingface_hub/utils/_http.py

Co-authored-by: célina <hanouticelina@gmail.com>

* Update src/huggingface_hub/hf_file_system.py

Co-authored-by: célina <hanouticelina@gmail.com>

* not async

* fix tests

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <lucain@huggingface.co>
Co-authored-by: célina <hanouticelina@gmail.com>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
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 <hanouticelina@gmail.com>

* fix test on widnwso

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* 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 <hanouticelina@gmail.com>

* docstring

* update powershell command

---------

Co-authored-by: célina <hanouticelina@gmail.com>

* Fix forward ref validation if total false (#3423)

* Release: v1.0.0.rc4

* Disable rich in CLI (#3427)

* Print version only in CLI

* add inference endpoints cli

* fix naming

* update docs

* wording

* remove logging

* don't instantiate logger when not needed

* refactor

* remove unused import

* nit

* nit

* Apply suggestions from code review

Co-authored-by: Lucain <lucain@huggingface.co>

* use docstring

* rework CLI UX

* fix merge conflicts

* some fixes

* fix

* generate cli reference

* Update src/huggingface_hub/cli/inference_endpoints.py

Co-authored-by: Lucain <lucain@huggingface.co>

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Lucain Pouget <lucainp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants