Skip to content

fix(pkg): keep added License-File headers out of a description-less METADATA - #1

Merged
seyfal merged 1 commit into
eagle-hq:mainfrom
kevin9327:fix-wheel-notices-bare-metadata
Oct 27, 2026
Merged

seyfal merged 1 commit into
eagle-hq:mainfrom
kevin9327:fix-wheel-notices-bare-metadata

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

Licensing, attribution, and third-party content

  • I have checked whether my changes contain or modify Eagle 4-licensed files,
    and have preserved required license, copyright, attribution, and NOTICE text.
  • Materially modified Eagle files are identified with the date, modifier,
    and the affected file or component (or an appropriately mapped change log).
  • Any added third-party code, data, or weights are compatible with the
    repository's licensing and contain required third-party notices.
  • If this is a public fork or derivative distribution, I have followed
    the Eagle Trademark Policy and preserved the required
    non-affiliation and distinguishable-branding disclosures.
  • I have reviewed the contribution terms (PDF)
    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.py appended License-File headers 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. Touches tools/add_wheel_notices.py and its test.

Testing and impact

pytest tests/test_add_wheel_notices.py: the new test_metadata_without_description_keeps_license_file_in_headers fails 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 check on 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

…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.
@seyfal

seyfal commented Oct 26, 2026 •

Copy link
Copy Markdown
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.

@seyfal seyfal closed this Oct 26, 2026
@seyfal seyfal reopened this Oct 27, 2026
@seyfal
seyfal merged commit 13ce40d into eagle-hq:main Oct 27, 2026
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