Skip to content

Update typer dependency version in setup.py#4193

Merged
Wauplin merged 1 commit into
mainfrom
fix/min_typer
May 6, 2026
Merged

Update typer dependency version in setup.py#4193
Wauplin merged 1 commit into
mainfrom
fix/min_typer

Conversation

@tomaarsen

@tomaarsen tomaarsen commented May 6, 2026

Copy link
Copy Markdown
Member

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

Note

Low Risk
Low risk dependency constraint change; may force an upgrade for environments pinned to older typer, but reduces runtime CLI failures from unsupported suggest_commands usage.

Overview
Updates packaging requirements to enforce typer>=0.20.0 (previously unpinned) in setup.py, ensuring the installed CLI dependency supports newer Typer constructor 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.

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
@bot-ci-comment

bot-ci-comment Bot commented May 6, 2026

Copy link
Copy Markdown

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 Wauplin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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^^

@Wauplin Wauplin merged commit 32476d9 into main May 6, 2026
21 checks passed
@Wauplin Wauplin deleted the fix/min_typer branch May 6, 2026 09:55
@tomaarsen

Copy link
Copy Markdown
Member Author

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.

  • Tom Aarsen

@Wauplin

Wauplin commented May 6, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Tom Aarsen

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^^

@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.14.0 release.

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.

2 participants