Skip to content

fix(generator): strip PyPI Trove prefix, sort components properly - #7

Merged
traefiker merged 2 commits into
traefik:mainfrom
mmatur:fix/python-licenses-and-component-order
May 12, 2026
Merged

fix(generator): strip PyPI Trove prefix, sort components properly#7
traefiker merged 2 commits into
traefik:mainfrom
mmatur:fix/python-licenses-and-component-order

Conversation

@mmatur

@mmatur mmatur commented May 12, 2026

Copy link
Copy Markdown
Member

What does this PR do?

  • Strips PyPI Trove prefixes (License :: OSI Approved :: …) before the license-map / SPDX lookup, so Python deps no longer need one bandaid LicenseRef-License-OSI-Approved-* entry per classifier.
  • Replaces the buggy Name+Version string-concat sort with a cascading Name → Version → PURL → URL → Copyright comparator (the old one ordered e.g. acorn-jsx 5.3.2 before acorn 8.12.1).
  • Looks up npm LICENSE files case-insensitively, preserving preferred-name order.

Motivation

Fixes the rough edges surfaced while wiring assimilis into the Traefik release pipeline (traefik/traefik#13031). Sort and case-sensitivity fixes originate from @bpsoraggi's fix/component-order branch, folded in here without the no-op double-sort.

Additional Notes

End-to-end check on the SBOM from traefik/traefik#13031 (1344 components, 27 PyPI deps with License :: OSI Approved ::): identical NOTICE.md / THIRD_PARTY_LICENSES.html modulo the corrected ordering, no LicenseRef-* leak.

@mmatur
mmatur force-pushed the fix/python-licenses-and-component-order branch from 4a75e66 to 9f17db5 Compare May 12, 2026 14:55

@bpsoraggi bpsoraggi 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.

LMGTM, but there's still an issue with the License :: OSI Approved :: prefix in some cases, as seen when testing with the generated traefikee sbom

@mmatur
mmatur force-pushed the fix/python-licenses-and-component-order branch from ce5ff44 to 08cc2bd Compare May 12, 2026 17:02

@bpsoraggi bpsoraggi 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.

LGTM

@traefiker
traefiker merged commit 81e7c91 into traefik:main May 12, 2026
4 checks passed
@mmatur
mmatur deleted the fix/python-licenses-and-component-order branch May 12, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug/fix a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants