[CLI] Add space-specific options to hf repos create and hf repos duplicate#3888
Draft
[CLI] Add space-specific options to hf repos create and hf repos duplicate#3888
hf repos create and hf repos duplicate#3888Conversation
…uplicate` Add --hardware/--flavor, --storage, --sleep-time, -s/--secret, and -e/--env options to both `hf repos create` and `hf repos duplicate` CLI commands. These options map to the existing space_hardware, space_storage, space_sleep_time, space_secrets, and space_variables parameters in the HfApi.create_repo() and HfApi.duplicate_repo() methods. Secrets and env vars accept KEY=VALUE format or just KEY (reads value from local environment variable). Follow-up to #3880 (review) Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
|
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. |
…bs CLI - Move EnvOpt, SecretsOpt, EnvFileOpt, SecretsFileOpt type aliases to _cli_utils.py - Move _get_extended_environ(), parse_env_map(), parse_secrets_map() to _cli_utils.py - Add env_map_to_key_value_list() converter for Hub API format - Update repos.py: use shared types and load_dotenv-based parsing (--secrets, -s) instead of custom _parse_key_value_pairs; add --env-file and --secrets-file - Update jobs.py: replace 4x duplicated env/secrets parsing blocks with shared helpers - Clean up unused imports (os, Path, Dict, get_token, load_dotenv) from jobs.py - Update tests to patch _get_extended_environ at its new _cli_utils location Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
--hardware/--flavor,--storage,--sleep-time,-s/--secret, and-e/--envoptions to bothhf repos createandhf repos duplicateCLI commands.These options map to the existing space_hardware, space_storage, space_sleep_time, space_secrets, and space_variables parameters in the HfApi.create_repo() and HfApi.duplicate_repo() methods.
Secrets and env vars accept
KEY=VALUEformat or justKEY(reads value from local environment variable).Follow-up to #3880 (review)