Repository navigation
Package licenses of vendored lz4 and xxHash sources - #344
Open
pctablet505 wants to merge 1 commit into
Open
pctablet505 wants to merge 1 commit into
pctablet505 wants to merge 1 commit into
Conversation
The wheel only ever shipped the wrapper's own BSD-3-Clause LICENSE, even though it also bundles and compiles the vendored lz4/xxHash C sources under lz4libs/ when no system liblz4 is used. Those sources carry their own BSD-2-Clause license (Yann Collet), which was never included in the license files, MANIFEST.in, or setup.py metadata. Add lz4libs/LICENSE and lz4libs/LICENSE.xxhash with the upstream license text, declare them via license_files in setup.py so setuptools packages them into the wheel's dist-info/licenses/, list them in MANIFEST.in for the sdist, and document the vendored licensing in docs/license.rst. Fixes python-lz4#306
pctablet505
marked this pull request as ready for review
July 17, 2026 12:46
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.
Fixes #306
When no system
liblz4is found, the extensions are compiled from the vendored lz4 and xxHash sources inlz4libs/. The wheel on PyPI still only ships the wrapper's BSD-3-ClauseLICENSEindist-info/licenses/. Those sources are BSD-2-Clause, which requires the notice to travel with binary redistributions. This adds both license texts to the sdist and the wheel.Change
lz4libs/LICENSE: the lz4lib/LICENSEtext (Yann Collet, 2011-2020).lz4libs/LICENSE.xxhash: the xxHashLICENSEtext, which carries its own copyright line.setup.py:license_fileslists both, plus the existingLICENSE. By default setuptools only picks up license files at the project root (LICEN[CS]E*etc.), so the ones inlz4libs/have to be listed.MANIFEST.in: includes all three for the sdist.docs/license.rst: says when the bundled libraries are used and where their licenses are.Testing
Built the sdist locally.
PKG-INFOnow has aLicense-File:entry for each of the three files, and setuptools uses that list to filldist-info/licenses/in the wheel. I did not rebuild and inspect a wheel.Notes
On the second question in #306: the per-file headers in
lz4.c,xxhash.cetc. are the same BSD-2-Clause terms, so these files cover the binary-redistribution clause.LICENSE.xxhashis the current upstream file (2012-2021). The vendoredxxhash.cheader says 2012-2016.