fix(packaging): populate PyPI project description via readme field#189
Merged
Conversation
pyproject.toml never declared [project].readme, so the built wheel/sdist METADATA has no Description body or Description-Content-Type — only the short Summary was populated. This is why PyPI renders 'no project description provided' even after the #682 description/keywords/urls fix, and it affects every version published since then, including the currently-live 0.50.0.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Root cause
PyPI's "Project description" section renders the long description (
Descriptionbody /Description-Content-Typein METADATA), which comes from[project].readmeinpyproject.toml. The #682 fix (PR #148) addeddescription(Summary),keywords, and[project.urls], but never added areadmefield.Confirmed by building the package before this fix and inspecting the wheel's
dist-info/METADATA:Summary:was populated correctly.Description-Content-Typeheader and no description body at all.Also confirmed against the live PyPI API (
https://pypi.org/pypi/fastapi-startkit/json) — the currently published0.50.0release hasinfo.descriptionas an empty string, even though it was published after the #682 fix. So this is not a "no release since the fix" issue — every version published since #682 (0.47.0 through 0.50.0) has this problem, because the root misconfiguration (missingreadme) was never addressed.Fix
Add
readme = "README.md"to[project]infastapi_startkit/pyproject.toml, pointing at the existingfastapi_startkit/README.md.Verification
Built the package locally with
uv buildbefore and after the change and inspected the wheel METADATA:Description-Content-Type, no description body.Description-Content-Type: text/markdownpresent, and the full README content appended as the METADATA body.twine checkpasses on both the sdist and wheel.No dependency, version, or behavior changes — metadata only.
Note: this PR does not publish to PyPI or merge anything. Sign-off required before publish/merge.