Skip to content

ci: commit README-PYPI.md for azure and gcp to match main package#543

Merged
Nelson-PROIA merged 1 commit into
mainfrom
ci/commit-readme-pypi-azure-gcp
May 21, 2026
Merged

ci: commit README-PYPI.md for azure and gcp to match main package#543
Nelson-PROIA merged 1 commit into
mainfrom
ci/commit-readme-pypi-azure-gcp

Conversation

@Nelson-PROIA
Copy link
Copy Markdown
Contributor

Summary

The fix in #537 (run prepare_readme.py before align-version) fails in CI because uv run python syncs the project before executing, which builds the package, which validates pyproject.toml, which requires README-PYPI.md to exist. Chicken-and-egg.

The cleaner fix is the pattern the root mistralai package already uses: commit README-PYPI.md directly. Root package has done this since #518 and align-version works fine there.

Changes

  • Remove README-PYPI.md from packages/azure/.gitignore and packages/gcp/.gitignore
  • Commit freshly-generated packages/azure/README-PYPI.md and packages/gcp/README-PYPI.md (produced by running python3 scripts/prepare_readme.py in each package)
  • Drop the prepare_readme step from sdk_generation_mistralai_{azure,gcp}_sdk.yaml (added in ci: generate README-PYPI.md before aligning azure/gcp versions #537) since the file is now always present on disk
  • scripts/prepare_readme.py is still called by publish.sh and the publish workflow to refresh the file at release time, so it stays accurate
  • The README-PYPI content is identical to README.md except all relative links are rewritten to absolute https://github.com/... URLs so PyPI renders correctly

Why not use python3 scripts/prepare_readme.py (plain) in the workflow instead?

That would also work (the script is stdlib-only). But committing the file matches what the main package already does, is one less moving part in CI, and keeps the README-PYPI content visible in code review whenever it changes.

Validation

Failure reproduced on run 26233248070 and 26233250646 — same hatchling OSError: Readme file does not exist from uv run. After this PR merges, neither will recur since the file is committed.

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.
Copy link
Copy Markdown
Contributor

@louis-sanna-dev louis-sanna-dev left a comment

Choose a reason for hiding this comment

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

☄️

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