Skip to content

[CLI] Check Homebrew registry for updates when installed via brew#4204

Merged
hanouticelina merged 1 commit into
mainfrom
cursor/brew-version-check-8d33
May 12, 2026
Merged

[CLI] Check Homebrew registry for updates when installed via brew#4204
hanouticelina merged 1 commit into
mainfrom
cursor/brew-version-check-8d33

Conversation

@Wauplin

@Wauplin Wauplin commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

When huggingface_hub is installed via Homebrew, the CLI update checker now queries the Homebrew registry (https://formulae.brew.sh/api/formula/hf.json) instead of PyPI. This fixes the issue where hf update suggests an update that isn't yet available in the brew registry, leading to a confusing experience:

  1. User gets "A new version of huggingface_hub (X.Y.Z) is available!" hint
  2. User runs hf update (which runs brew upgrade hf)
  3. Brew doesn't have the new version yet → nothing happens
  4. User is confused

What changed:

  • Added _fetch_latest_brew_version() that hits https://formulae.brew.sh/api/formula/hf.json and reads .versions.stable
  • Modified _check_cli_update to use the brew registry when installation_method() == "brew" (only for huggingface_hub)
  • Non-brew installs continue to check PyPI as before

The existing installation_method() utility already reliably detects brew installs. The new brew version fetch follows the same pattern as the PyPI fetch (2s timeout, graceful fallback to None on failure).

Slack Thread

Open in Web Open in Cursor 

When huggingface_hub is installed via Homebrew, the CLI update checker
now queries https://formulae.brew.sh/api/formula/hf.json for the latest
version instead of PyPI. This avoids suggesting an update that isn't
yet available in the Homebrew registry.

For non-brew installs, the existing PyPI check is unchanged.

Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
@bot-ci-comment

bot-ci-comment Bot commented May 7, 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 Author

Choose a reason for hiding this comment

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

✔️

cc @Pierrci

@Wauplin Wauplin marked this pull request as ready for review May 7, 2026 15:46
@Wauplin Wauplin requested review from Pierrci and hanouticelina May 7, 2026 15:46

@julien-c julien-c left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good idea 👍

@Pierrci Pierrci left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice!!

@hanouticelina hanouticelina merged commit 0c75ef9 into main May 12, 2026
21 checks passed
@hanouticelina hanouticelina deleted the cursor/brew-version-check-8d33 branch May 12, 2026 16:22
@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.15.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.

5 participants