ci: generate README-PYPI.md before aligning azure/gcp versions#537
Merged
Conversation
aa542ea to
9ed2f14
Compare
uv version <new> triggers a hatchling editable build which validates pyproject.toml. The azure and gcp packages declare readme = "README-PYPI.md" but the file is generated at publish time by scripts/prepare_readme.py and not committed. On fresh CI checkouts hatchling raises OSError: Readme file does not exist: README-PYPI.md before the version is bumped. Run prepare_readme.py before uv version so the file exists for validation, mirroring what publish.sh already does at release time.
9ed2f14 to
b2bdef6
Compare
This was referenced May 21, 2026
Nelson-PROIA
added a commit
that referenced
this pull request
May 21, 2026
The mistralai-{azure,gcp} pyproject.toml files reference README-PYPI.md
which is generated by scripts/prepare_readme.py from the regular README.md
with relative links rewritten to absolute GitHub URLs.
Until now, the file was gitignored per package and only generated at
publish time. This caused align-version to fail in CI because uv version
triggers a hatchling editable build which validates pyproject.toml, and
hatchling refuses to validate a non-existent readme file.
The root mistralai package already commits its README-PYPI.md (added in
#518) and works fine. Apply the same pattern to azure and gcp:
- Remove README-PYPI.md from each package's .gitignore
- Commit the generated file
- Drop the prepare_readme step from gen workflows (added in #537)
since the file is now always present on disk
prepare_readme.py is still called by publish.sh and the publish workflow
to refresh the file at release time, so it stays accurate.
This was referenced May 21, 2026
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.
Summary
The azure and gcp gen workflows fail at the
align-versionstep becauseuv version <new>triggers a hatchling editable build that validatespyproject.toml. Both packages declarereadme = "README-PYPI.md"but that file is generated at publish time byscripts/prepare_readme.pyand not committed.On fresh CI checkouts the file is missing, so hatchling raises:
before the version bump can complete.
Fix
Run
scripts/prepare_readme.pybeforeuv versionin both workflows, mirroring whatpublish.shalready does at release time.Validation
Reproduced the failure locally on
packages/azurewith the pinned hatchling:uv version 2.0.1failed with the exact same traceback. With the fix applied (running prepare_readme.py first),uv versionsucceeds.This is a no-op on existing repo state — the workflow change only affects future gen runs.