Skip to content

[CI] Make nightly wheel version PEP 440 / PyPI compliant#1000

Open
hunhoffe wants to merge 3 commits into
Xilinx:aie-publicfrom
hunhoffe:pypi-compliant-versioning
Open

[CI] Make nightly wheel version PEP 440 / PyPI compliant#1000
hunhoffe wants to merge 3 commits into
Xilinx:aie-publicfrom
hunhoffe:pypi-compliant-versioning

Conversation

@hunhoffe
Copy link
Copy Markdown

@hunhoffe hunhoffe commented May 13, 2026

Problem

Today's nightly wheel version is X.Y.Z.{datetime}+{hash}. The +hash local version segment is rejected by PyPI on upload, so the wheels can only ship to GitHub Releases and the llvm-aie PyPI namespace stays unclaimed.

Change

Three small edits, scoped to .github/workflows/:

  1. Version → X.Y.Z.{datetime} (4-segment PEP 440 release). PyPI-uploadable. Bare pip install llvm-aie works without --pre, matching the project's posture (nightlies are the shipped artifact). Pinnable as llvm-aie==X.Y.Z.{datetime} for reproducible builds downstream.

  2. Embed the source SHA inside the wheel as commit.txt. PEP 440 no longer lets the hash ride in the version string, so this keeps it recoverable from the unpacked tree. long_description still links the GitHub commit URL.

  3. DATETIME granularity hour → minute. With +hash removed, two uploaded runs in the same hour would produce identical wheel filenames and silently overwrite on GitHub Releases. Minute granularity makes practical collisions impossible.

The get_wheel_version step is also adjusted — it previously assumed a + was present in the version and would crash without one.

Notes for reviewers

  • Sample wheel name: llvm_aie-19.0.0.202605131342-py3-none-manylinux_2_28_x86_64.whl
  • A future stable release would need to bump the major (e.g. 20.0.0), since 19.0.0.{datetime} sorts above 19.0.0 under PEP 440. Happy to switch to a .devN scheme instead if the project would prefer that ordering property — the trade-off is --pre becomes required for bare pip install.
  • This PR does not add a PyPI publish step but should make that step easier in the future.

Thanks for considering — let me know what you'd like adjusted!

The nightly wheel version was `X.Y.Z.{datetime}+{hash}`. The `+hash`
local version segment is rejected by PyPI on upload, which prevents
publishing under the project's own name and leaves the `llvm-aie` PyPI
namespace unclaimed (a supply-chain risk for downstream consumers like
mlir-aie that resolve `pip install llvm-aie`).

Switch the nightly to `X.Y.Z.{datetime}` (PEP 440 4-segment release):
  - PyPI-uploadable.
  - `pip install llvm-aie` resolves to the latest nightly with no
    `--pre` required, matching this project's posture (nightlies are
    the only artifact shipped, not pre-releases of a future stable).
  - Pinnable: `llvm-aie==X.Y.Z.{datetime}` resolves a specific build.

Embed the source commit inside the wheel as `commit.txt` so the SHA is
recoverable from the unpacked tree (PEP 440 no longer lets it ride in
the version string).

Bump DATETIME granularity from hour to minute. With `+hash` removed,
two uploaded runs in the same hour (release: published colliding with
the nightly cron, manual workflow_dispatch re-runs, etc.) would produce
identical wheel filenames and silently overwrite on GitHub Releases /
fail on PyPI. Minute granularity makes practical collisions impossible
since the build itself takes longer than a minute.

Adjust the get_wheel_version step accordingly: it previously assumed a
`+` was present in the version string and would crash without it.

Note: a future stable release would need to bump the major (e.g.
`20.0.0`) since `19.0.0.{datetime}` sorts above `19.0.0` under PEP 440.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@konstantinschwarz konstantinschwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me! I assume we'll need to synchronize with the consumers of our packages to use the new names for version pinning

@hunhoffe hunhoffe marked this pull request as ready for review May 21, 2026 01:58
@hunhoffe hunhoffe requested a review from philippjh as a code owner May 21, 2026 01:58
@hunhoffe
Copy link
Copy Markdown
Author

Hi! Would a maintainer be willing to kick off the AMD AIE Distro workflow against this branch? It's workflow_dispatch-only and doesn't run on PRs, so the version-string changes haven't actually been exercised in CI yet. A single Linux x86_64 matrix entry is enough to verify — I'd like to confirm the wheel filename, embedded commit.txt, and the patched get_wheel_version step all behave as intended before this merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants