-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[CLI] Add hf update + drop interactive update prompt
#4131
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3930552
[CLI] Add `hf upgrade` + drop interactive update prompt
Wauplin 2ecd462
[CLI] Mention `hf upgrade` in the installation guide
Wauplin f67c00d
gint, not warning
Wauplin be4ab97
HF_HUB_DISABLE_UPDATE_CHECK
Wauplin 0d26a82
[CLI] Propagate subprocess exit code from `hf upgrade`
Wauplin 2a09347
better
Wauplin 2360629
a
Wauplin 5eb9183
docstring
Wauplin cf97f83
[CLI] Fix list repr in transformers update command message
cursoragent 699111f
hf update
Wauplin 09ed664
update
Wauplin 050148e
update
Wauplin 3b6acff
Merge branch 'main' into cli-upgrade-command
Wauplin 45a51cb
still annoyed
Wauplin d210829
Merge branch 'cli-upgrade-command' of github.com:huggingface/huggingf…
Wauplin 74016cf
Merge branch 'main' into cli-upgrade-command
hanouticelina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,13 @@ | |
| # limitations under the License. | ||
| """Contains commands to print information about the environment and version.""" | ||
|
|
||
| import typer | ||
|
|
||
| from huggingface_hub import __version__ | ||
|
|
||
| from ..utils import dump_environment_info | ||
| from ._cli_utils import run_update | ||
| from ._output import out | ||
|
|
||
|
|
||
| def env() -> None: | ||
|
|
@@ -26,3 +30,14 @@ def env() -> None: | |
| def version() -> None: | ||
| """Print information about the hf version.""" | ||
| print(__version__) | ||
|
|
||
|
|
||
| def update() -> None: | ||
| """Update the `hf` CLI to the latest version.""" | ||
| returncode = run_update() | ||
| if returncode != 0: | ||
| raise typer.Exit(code=returncode) | ||
| out.hint( | ||
| "You may also want to run `hf skills upgrade` to refresh any installed skills " | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe should be |
||
| "so your AI agent sees the latest command surface." | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.