-
Notifications
You must be signed in to change notification settings - Fork 44
Kernel docs followups #287
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,28 @@ def main(): | |
| default=None, | ||
| help="If set, the upload will be made to a particular branch of the provided `repo-id`.", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--create-card", | ||
| action="store_true", | ||
| help="If set, a templated system card will be generated from the kernel.", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--card-path", | ||
| type=str, | ||
| default=None, | ||
| help="Path to save the generated card to (only used with --create-card).", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--description", | ||
| type=str, | ||
| default=None, | ||
| help="Description to introduce the kernel (only used with --create-card).", | ||
| ) | ||
| upload_parser.add_argument( | ||
| "--create-pr", | ||
| action="store_true", | ||
| help="If set, it will create a PR on the repo-id (only used with --create-card).", | ||
| ) | ||
|
Comment on lines
+95
to
+116
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. I was thinking more of just uploading the card, not creating one. E.g. if the user changed the card, it's nice that it gets uploaded as well along with the kernels. Presumably they already have created the card before. That means we have to settle on the name though, since I think on the Hub the card is always So, maybe we should standardize on using I think orthogonal subcommands are the best, so ideally there would be a |
||
| upload_parser.add_argument( | ||
| "--private", | ||
| action="store_true", | ||
|
|
@@ -344,6 +366,10 @@ def upload_kernels(args): | |
| branch=args.branch, | ||
| private=args.private, | ||
| ) | ||
| if args.create_card: | ||
| if args.card_path is None: | ||
| args.card_path = str(Path(args.kernel_dir).resolve() / "README.md") | ||
|
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. Not for this PR, but it would be nice to make all card paths |
||
| create_and_upload_card(args) | ||
|
|
||
|
|
||
| def create_and_upload_card(args): | ||
|
|
||
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.
I'd leave this out for the upload command. Having dependent options is not nice if not needed and it's strange that the kernel upload would not generate a PR, but the card would.