build: render README alerts as bold notes on PyPI#19
Merged
Conversation
GitHub alert syntax ([!NOTE] etc.) shows up literally on PyPI. Generate the long description via hatch-fancy-pypi-readme, rewriting alerts to bold blockquotes at build time; the README keeps the GitHub callout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
GitHub's
> [!NOTE]alert syntax renders as a callout on github.com but shows up as literal[!NOTE]text on PyPI project pages (PyPI's renderer doesn't support the alerts extension). With the early-development note now in the README, the next release would have shipped that literal text to PyPI.This PR adds
hatch-fancy-pypi-readmeso the PyPI long description is generated fromREADME.mdwith alert markers rewritten to portable bold blockquotes (> [!NOTE]→> **Note:**; TIP/IMPORTANT/WARNING/CAUTION likewise). The README itself is unchanged — GitHub keeps rendering the nice callout.Why here and not a sed step in
release.yml: rewriting the README mid-workflow would dirty the tag checkout and make hatch-vcs emit a+dYYYYMMDDlocal version, which PyPI rejects. The metadata-hook approach keeps the tree clean and also fixes localuv build.uv.lockunchanged — build-system requirements aren't part of the dependency lock.uv buildsdist PKG-INFO and a wheel built from the extracted sdist both contain> **Note:**and no literal[!NOTE](README.md was already in the sdist include list).🤖 Generated with Claude Code