Repository navigation
fix(pkg): keep added License-File headers out of a description-less METADATA - #1
Merged
Merged
Conversation
…ETADATA When a wheel's METADATA has no description there is no blank line, so the headers were appended after a newline that already ended the text. The result had a blank line before License-File, turning it into body text that installers and twine ignore. Strip trailing newlines from the header block before appending and end it with one newline when there is no body. Test: tests/test_add_wheel_notices.py, new case fails before, passes after.
Contributor
|
Merged in 92dc856. Thanks for the fix and the test that fails without it. The export that publishes this repo first landed your fix without your name on it. I've fixed the export, and your original commit is now in main's history, so this PR shows as merged under your name. |
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.
Licensing, attribution, and third-party content
and have preserved required license, copyright, attribution, and NOTICE text.
and the affected file or component (or an appropriately mapped change log).
repository's licensing and contain required third-party notices.
the Eagle Trademark Policy and preserved the required
non-affiliation and distinguishable-branding disclosures.
and any requirements stated in CONTRIBUTING.md.
Modified: 2026-10-22 by kevin9327, files: tools/add_wheel_notices.py, tests/test_add_wheel_notices.py. Existing copyright and SPDX headers are unchanged.
Change summary
tools/add_wheel_notices.pyappendedLicense-Fileheaders after the last header line. When METADATA has no description (no blank line),partition("\n\n")returns the whole text with its trailing newline, so the output became...Version: 0.4.7\n\nLicense-File: X: the new header landed in the body and metadata parsers ignore it. The fix strips trailing newlines from the header block before appending and ends the block with one newline when there is no body. Touchestools/add_wheel_notices.pyand its test.Testing and impact
pytest tests/test_add_wheel_notices.py: the newtest_metadata_without_description_keeps_license_file_in_headersfails on main and passes with the fix; all 7 pass. Wheels with a description produce byte-identical METADATA to before.Lint:
ruff==0.15.1 checkon the changed files passes. CPU only; no GPU, model weights or torch needed.Third-party materials and dependencies
None
AI-assisted or generated content
Grok Bot (an AI assistant) helped find the bug by reading the code, and drafted the fix, the test and this description. I reviewed the diff and ran the new test before the fix (fails) and after (passes), plus the rest of the touched test file.
Documentation and notices
None