Skip to content

Generalize promotion script and add multi-arch keep-list filter#5109

Open
HereThereBeDragons wants to merge 1 commit intomainfrom
users/lpromber/promotion_scripts_multi_arch
Open

Generalize promotion script and add multi-arch keep-list filter#5109
HereThereBeDragons wants to merge 1 commit intomainfrom
users/lpromber/promotion_scripts_multi_arch

Conversation

@HereThereBeDragons
Copy link
Copy Markdown
Contributor

Renames promote_from_rc_to_final.py -> promote_packages.py to reflect its broader scope. The script now handles three orthogonal axes:

  --src-version-type   {rc, a}         (default: rc)
  --dest-version       {release, rc<N>, a<YYYYMMDD>}  (default: release)
  --keep-gfx-archs     positive arch list, e.g. gfx1201,gfx1010

Common transitions covered: rc -> release (existing default), a -> release, a -> rc. --skip-version-promotion (mutex with the version flags; requires --keep-gfx-archs) runs only the arch-trim pass on already- versioned wheels.

Multi-arch keep-list pass — for aggregator wheels (rocm, torch, torchvision, ...) and per-gfx wheels:

  • Per-gfx wheels for non-kept archs are skipped (and deleted with --delete-old-on-success).
  • METADATA / PKG-INFO loses Provides-Extra: device-gfx<N> and matching Requires-Dist: ...-gfx<N> lines for non-kept archs.
  • requires.txt loses [device-gfx<N>] sections and [device-all] body deps for non-kept archs.
  • _dist_info.py loses AVAILABLE_TARGET_FAMILIES.append('gfx<N>') for non-kept archs.
  • When the package's default arch is dropped, three sites are repointed at keep[0] (so the [device] extra still resolves): DEFAULT_TARGET_FAMILY in _dist_info.py, the bare extra == "device" line in METADATA, and the [device] body in requires.txt.
  • Single-arch packages are auto-detected and pass through unchanged.
  • Empty intersection of keep list and found archs raises ValueError.

Other changes:

  • New tests/promote_keep_list_test.py: unit tests for the keep-list helpers, version-string transitions, and argparse mutex/validation.
  • tests/promote_from_rc_to_final_test.py -> promote_packages_test.py.
  • third_party/change_wheel_version: skip dir / dist-info / data renames when old_slug == new_slug, so --skip-version-promotion can repack a wheel without touching its version. Same-version guard tightened to use the resolved new_version.
  • upload_release_packages.py docstring updated to point at the new script name.
  • how_to_do_release.md: new subsections for nightly (a) promotion (a -> release, a -> rc) and the multi-arch --keep-gfx-archs / --skip-version-promotion workflows.

…lter

Renames `promote_from_rc_to_final.py` -> `promote_packages.py` to reflect
its broader scope. The script now handles three orthogonal axes:

  --src-version-type   {rc, a}         (default: rc)
  --dest-version       {release, rc<N>, a<YYYYMMDD>}  (default: release)
  --keep-gfx-archs     positive arch list, e.g. gfx1201,gfx1010

Common transitions covered: rc -> release (existing default), a -> release,
a -> rc<N>. `--skip-version-promotion` (mutex with the version flags;
requires --keep-gfx-archs) runs only the arch-trim pass on already-
versioned wheels.

Multi-arch keep-list pass — for aggregator wheels (rocm, torch,
torchvision, ...) and per-gfx wheels:
  - Per-gfx wheels for non-kept archs are skipped (and deleted with
    --delete-old-on-success).
  - METADATA / PKG-INFO loses `Provides-Extra: device-gfx<N>` and matching
    `Requires-Dist: ...-gfx<N>` lines for non-kept archs.
  - requires.txt loses `[device-gfx<N>]` sections and `[device-all]` body
    deps for non-kept archs.
  - _dist_info.py loses `AVAILABLE_TARGET_FAMILIES.append('gfx<N>')` for
    non-kept archs.
  - When the package's *default* arch is dropped, three sites are
    repointed at keep[0] (so the [device] extra still resolves):
    `DEFAULT_TARGET_FAMILY` in _dist_info.py, the bare `extra == "device"`
    line in METADATA, and the `[device]` body in requires.txt.
  - Single-arch packages are auto-detected and pass through unchanged.
  - Empty intersection of keep list and found archs raises ValueError.

Other changes:
  - New `tests/promote_keep_list_test.py`: unit tests for the keep-list
    helpers, version-string transitions, and argparse mutex/validation.
  - `tests/promote_from_rc_to_final_test.py` -> `promote_packages_test.py`.
  - third_party/change_wheel_version: skip dir / dist-info / data renames
    when old_slug == new_slug, so --skip-version-promotion can repack a
    wheel without touching its version. Same-version guard tightened to
    use the resolved `new_version`.
  - upload_release_packages.py docstring updated to point at the new
    script name.
  - how_to_do_release.md: new subsections for nightly (`a`) promotion
    (a -> release, a -> rc) and the multi-arch `--keep-gfx-archs` /
    `--skip-version-promotion` workflows.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@HereThereBeDragons
Copy link
Copy Markdown
Contributor Author

for whatever reason git does not recognize the renaming of promote_from_rc_to_final.py -> promote_packages.py.
you might therefore want to checkout main branch and my promote_packages.py and just copy it into promote_from_rc_to_final.py to just see the partial changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

1 participant