Skip to content

Fix Python bindings build with recent hatchling releases - #1043

Closed
vincenzopalazzo wants to merge 1 commit into
lightningdevkit:mainfrom
vincenzopalazzo:claude/fix-python-readme-metadata
Closed

Fix Python bindings build with recent hatchling releases#1043
vincenzopalazzo wants to merge 1 commit into
lightningdevkit:mainfrom
vincenzopalazzo:claude/fix-python-readme-metadata

Conversation

@vincenzopalazzo

Copy link
Copy Markdown
Member

Summary

check-python is currently failing on main (and consequently on every open PR). Recent hatchling releases validate that project.readme resolves inside the project directory, so our readme = "../../README.md" aborts the build before anything else runs:

ValueError: Readme path must be within the project directory: ../../README.md

This affects scripts/python_build_wheel.sh too, not just CI.

Rather than duplicating the README into bindings/python/, this declares readme dynamic and reads the repository README from a custom metadata hook, which passes it along as literal text and hence skips the path validation.

Test plan

  • uv pip install -e bindings/python succeeds again (fails on main today)
  • uv build --wheel succeeds, and the resulting METADATA has Description-Content-Type: text/markdown with a body byte-identical to the repository README.md — so the published PyPI description is unchanged

Disclosure

This PR was prepared with AI assistance (Claude Code).

🤖 Generated with Claude Code

`hatchling` validates that `project.readme` resolves inside the project
directory, so our `readme = "../../README.md"` now aborts every build of
the Python bindings with:

    ValueError: Readme path must be within the project directory: ../../README.md

This breaks the `check-python` CI job as well as `python_build_wheel.sh`.

Rather than duplicating the README into `bindings/python`, declare
`readme` dynamic and read the repository README from a custom metadata
hook, which hands it over as literal text and hence skips the path
validation. The resulting wheel metadata is byte-identical to what we
published before.

This commit was written with AI assistance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ldk-reviews-bot

Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@vincenzopalazzo

Copy link
Copy Markdown
Member Author

Superseded by #1041, which fixes this with the same dynamic = ["readme"] + metadata-hook approach as part of the broader wheel-release work. I missed that it was already open — sorry for the noise.

@vincenzopalazzo
vincenzopalazzo deleted the claude/fix-python-readme-metadata branch August 11, 2026 18:04
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