Update typer dependency version in setup.py#4193
Conversation
Hello! ## Pull Request overview * Add a minimum version for `typer` ## Details As shown in this documentation page (https://typer.tiangolo.com/tutorial/commands/help/#suggest-commands), the `suggest_commands` parameter was only added in typer 0.20.0. It's being used by hf_hub, so we must ensure that typer gets updated (or we only add `suggest_commands=False` if typer is newer than 0.20.0, that would also be fine). Either way, upgrading `huggingace_hub` didn't push my typer, which was still at `0.18.0`, resulting in: ``` Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\tom\.conda\envs\sentence-transformers\Scripts\hf.exe\__main__.py", line 4, in <module> File "C:\Users\tom\.conda\envs\sentence-transformers\Lib\site-packages\huggingface_hub\cli\hf.py", line 24, in <module> from huggingface_hub.cli.auth import auth_cli File "C:\Users\tom\.conda\envs\sentence-transformers\Lib\site-packages\huggingface_hub\cli\auth.py", line 49, in <module> auth_cli = typer_factory(help="Manage authentication (login, logout, etc.).") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tom\.conda\envs\sentence-transformers\Lib\site-packages\huggingface_hub\cli\_cli_utils.py", line 639, in typer_factory return HFCliApp( ^^^^^^^^^ TypeError: Typer.__init__() got an unexpected keyword argument 'suggest_commands' ``` With any `hf` CLI command. Adding a minimum version would be safer. - Tom Aarsen
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Wauplin
left a comment
There was a problem hiding this comment.
Thanks for reporting and fixing this!
Usually not a fan of pinning a dependency to a "recent" version (Oct. 2025) but in this precise case it's fixing an already existing issue so let's do it^^
|
Same. Another option is only using suggest_commands when typer is new enough, but there might be other bugs/issues that require a newer typer.
|
Yes I thought about that but since we don't know the potential side effects, let's just bump and reassess only if someone complains^^ |
|
This PR has been shipped as part of the v1.14.0 release. |
Hello!
Pull Request overview
typerDetails
As shown in this documentation page (https://typer.tiangolo.com/tutorial/commands/help/#suggest-commands), the
suggest_commandsparameter was only added in typer 0.20.0. It's being used by hf_hub, so we must ensure that typer gets updated (or we only addsuggest_commands=Falseif typer is newer than 0.20.0, that would also be fine).Either way, upgrading
huggingace_hubdidn't push my typer, which was still at0.18.0, resulting in:With any
hfCLI command. Adding a minimum version would be safer.Note
Low Risk
Low risk dependency constraint change; may force an upgrade for environments pinned to older
typer, but reduces runtime CLI failures from unsupportedsuggest_commandsusage.Overview
Updates packaging requirements to enforce
typer>=0.20.0(previously unpinned) insetup.py, ensuring the installed CLI dependency supports newerTyperconstructor options used by the project.Reviewed by Cursor Bugbot for commit d9d4e2f. Bugbot is set up for automated code reviews on this repo. Configure here.