Skip to content

fix: preserve empty inline readme and license text - #345

Merged
henryiii merged 4 commits into
pypa:mainfrom
nawaaaaaAaar:fix/oss-track04-pyproject-metadata
Oct 22, 2026
Merged

henryiii merged 4 commits into
pypa:mainfrom
nawaaaaaAaar:fix/oss-track04-pyproject-metadata

Conversation

@nawaaaaaAaar

Copy link
Copy Markdown
Contributor

Problem

The readme and legacy license-table parsers use truthiness to distinguish an absent text/file key from a supplied value. As a result, an explicitly supplied empty inline string is silently discarded. An empty filename is also silently ignored rather than going through normal file validation.

Reproduced on unchanged upstream 058b1bff032c164f115d4e2ead991c7bc6acc8cc: an empty inline readme and license both become None. The added cases fail in four places: empty readme text, empty license text, and empty readme/license filenames.

Change

Use is None for the mutually exclusive field-presence check and for selecting the filename branch. Empty inline text is retained, including its readme content type and RFC 822 representation. Empty filenames receive the existing file-not-found configuration error. No schema or unrelated parser changes.

Validation

  • Python 3.12 and 3.14: python -m pytest -q: 516 passed on each (upstream baseline: 512).
  • pre-commit run --files pyproject_metadata/pyproject.py tests/test_standard_metadata.py: all applicable hooks passed, including ruff check/format, check-sdist, codespell, and repository checks.
  • python -m mypy: success, 17 source files.
  • python -m build: sdist and wheel built.
  • Installed-wheel smoke test: explicitly empty readme and license text are retained.
  • git diff --check: passed.

Linux tested locally; Windows and macOS were not run locally. Open issues and PRs were checked; no equivalent empty-text fix was found.

AI assistance: prepared and tested by Perplexity Computer. No human-review attestation is implied.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Write an empty Description header for an empty readme, so the RFC 822
output reads back as an empty description like as_json. Report an
empty readme content-type instead of dropping the readme. Add a
changelog entry.

Assisted-by: ClaudeCode:claude-opus-5-5
Comment thread docs/changelog.md Outdated
henryiii and others added 2 commits October 22, 2026 11:23
An empty readme file is common, and the extra header changes the output
for downstream backends. Keep the earlier output with no body.

Assisted-by: ClaudeCode:claude-opus-5-5
@henryiii henryiii changed the title Preserve empty inline readme and license text fix: preserve empty inline readme and license text Oct 22, 2026
@henryiii
henryiii merged commit 25d94b4 into pypa:main Oct 22, 2026
25 checks passed
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.

3 participants