-
Notifications
You must be signed in to change notification settings - Fork 816
[hf CLI] check for updates and notify user #3418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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. |
@hanouticelina this one is ready for review now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice addition!
Co-authored-by: célina <hanouticelina@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very cool, thank you @Wauplin!
while you're at it, could you update the windows command everywhere (including the docs) to
powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"
Changing the execution policy allows running a script from the internet.
(taken from astral installation guide)
Mentioned on internal slack
With this PR, any CLI command will trigger an auto-check of the latest version available on PyPI and suggest the user to upgrade if a new version is available. This autocheck is disabled if user is running on a
.dev
or.rc
version. The check is done only once every 24h to avoid spamming user. If any exception is raised in the process, it will fail silently and do not stop the CLI command.A utility method has been added to check if
huggingface_hub
package has been installed via the HF installer (e.g.curl ... | sh
), via Homebrew or via pip (default). This allows us to print a personalized message on how to autoupdate.Example:
(note: fake example as it wouldn't be triggered on a dev version)