[CLI] migrate hf jobs to out singleton#4254
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. |
hf jobs to `out singletonhf jobs to out singleton
Wauplin
left a comment
There was a problem hiding this comment.
Thanks for migrating this! Most comments are related to templating, which I think we should drop for the sake of simplicity
|
|
||
| out.result("Job started", id=job.id, url=job.url) | ||
| if detach: | ||
| out.hint(f"Use `hf jobs logs {job.id}` to fetch the logs.") |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 56dfd66. Configure here.
|
Merged #4265 to use |
…ce/huggingface_hub into cli-migrate-jobs-out-singleton
There was a problem hiding this comment.
Pinact found unpinned actions in this repo.
Auto-fixable, but outside this PR's diff (run pinact run locally and commit):
.github/workflows/model_card_consistency_reminder.yml:15—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-prerelease.yml:34—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:23—- actions/checkout@v6→- actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:25—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:57—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:174—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:293—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:348—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:435—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:555—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:690—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:1018—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/style-bot-action.yml:184—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:17—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:20—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:46—actions/create-github-app-token@v3→actions/create-github-app-token@bcd2ba4921… # v3.2.0.github/workflows/sync-hf-cli-skill.yml:53—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:60—astral-sh/setup-uv@v7→astral-sh/setup-uv@37802adc94… # v7.6.0.github/workflows/sync-hf-cli-skill.yml:86—peter-evans/create-pull-request@v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1.github/workflows/build_repocard_examples.yaml:18—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:37—- actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6→- actions/setup-node@48b55a011b… # v6.4.0.github/workflows/update-inference-types.yaml:71—peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1
There was a problem hiding this comment.
Pinact found unpinned actions in this repo.
Auto-fixable, but outside this PR's diff (run pinact run locally and commit):
.github/workflows/model_card_consistency_reminder.yml:15—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-prerelease.yml:34—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:23—- actions/checkout@v6→- actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:25—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:57—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:174—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:293—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:348—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:435—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:555—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:690—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:1018—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/style-bot-action.yml:184—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:17—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:20—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:46—actions/create-github-app-token@v3→actions/create-github-app-token@bcd2ba4921… # v3.2.0.github/workflows/sync-hf-cli-skill.yml:53—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:60—astral-sh/setup-uv@v7→astral-sh/setup-uv@37802adc94… # v7.6.0.github/workflows/sync-hf-cli-skill.yml:86—peter-evans/create-pull-request@v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1.github/workflows/build_repocard_examples.yaml:18—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:37—- actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6→- actions/setup-node@48b55a011b… # v6.4.0.github/workflows/update-inference-types.yaml:71—peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1
There was a problem hiding this comment.
Pinact found unpinned actions in this repo.
Auto-fixable, but outside this PR's diff (run pinact run locally and commit):
.github/workflows/model_card_consistency_reminder.yml:15—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-prerelease.yml:34—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:23—- actions/checkout@v6→- actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:25—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:57—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:174—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:293—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:348—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:435—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:555—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:690—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:1018—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/style-bot-action.yml:184—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:17—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:20—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:46—actions/create-github-app-token@v3→actions/create-github-app-token@bcd2ba4921… # v3.2.0.github/workflows/sync-hf-cli-skill.yml:53—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:60—astral-sh/setup-uv@v7→astral-sh/setup-uv@37802adc94… # v7.6.0.github/workflows/sync-hf-cli-skill.yml:86—peter-evans/create-pull-request@v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1.github/workflows/build_repocard_examples.yaml:18—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:37—- actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6→- actions/setup-node@48b55a011b… # v6.4.0.github/workflows/update-inference-types.yaml:71—peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1
|
This PR has been shipped as part of the v1.17.0 release. |

Last piece of #3979.
This PR migrates
hf jobsto theoutframework.breaking changes introduced in
hf jobs psandhf jobs scheduled ps(I think it's fine, the alternative would be special casing_output.pyjustfor these two list commands) :1.
--formattable is removed. Use--format auto|human|agent|quiet|json.2. json output shape changed for
hf jobs ps:-
commandis now a string (e.g. "python script.py"), was a list (e.g.["python", "script.py"]).
-
statusis now a string (e.g."RUNNING"), was a dict (e.g.{"stage": "RUNNING").Note
Medium Risk
User-visible CLI breaking changes on
hf jobs psandhf jobs scheduled ps(format flags and JSON field shapes); behavior is otherwise presentation-layer only for jobs commands.Overview
Migrates the
hf jobscommand group to the sharedoutCLI output layer (out.result,out.table,out.dict,out.text,out.warning,out.hint) instead of ad-hocprint/json.dumps/print_list_output.hf jobs psandhf jobs scheduled psnow use--format auto|human|agent|json|quiet(defaultauto) with optional Go-style templates ({{.id}}).--format tableand-q/--quietare removed; quiet IDs come from--format quiet. Forhf jobs ps, JSON output flattenscommandto a string andstatusto a stage string (not a list or nested object). Inspect/labels and lifecycle commands get consistent structured output; docs for the list commands are regenerated to match._output.Output.set_modeaccepts string mode names (e.g.'agent') in addition to the enum.Reviewed by Cursor Bugbot for commit 63b352d. Bugbot is set up for automated code reviews on this repo. Configure here.