Add workflow regeneration to spin (#167551)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/167551
Approved by: https://github.com/Skylion007, https://github.com/albanD, https://github.com/atalman
ghstack dependencies: #167227
This commit is contained in:
Klaus Zimmermann
2025-11-20 09:26:30 +01:00
committed by PyTorch MergeBot
parent bd883bb290
commit 9d7f9834c8
3 changed files with 9 additions and 0 deletions

View File

@@ -328,3 +328,10 @@ def quicklint(ctx, apply_patches, **kwargs):
def quickfix(ctx, **kwargs):
"""Autofix changed files."""
ctx.invoke(quicklint, apply_patches=True)
@click.command()
def regenerate_github_workflows():
"""Regenerate GitHub workflows from templates."""
cmd = [sys.executable, "scripts/generate_ci_workflows.py"]
spin.util.run(cmd, cwd="./.github")

View File

@@ -317,6 +317,7 @@ With Spin, we offer a unified interface to these tasks.
|`regenerate-version`|regenerate `torch/version.py`|
|`regenerate-type-stubs`|regenerates type stubs for use by static type checkers|
|`regenerate-clangtidy-files`|regenerates clang related files needed for linting|
|`regenerate-github-workflows`|regenerates github workflows from jinja templates|
## Unit testing

View File

@@ -391,4 +391,5 @@ package = 'torch'
".spin/cmds.py:regenerate_version",
".spin/cmds.py:regenerate_type_stubs",
".spin/cmds.py:regenerate_clangtidy_files",
".spin/cmds.py:regenerate_github_workflows",
]