Skip to content

Package licenses of vendored lz4 and xxHash sources - #344

Open
pctablet505 wants to merge 1 commit into
python-lz4:masterfrom
pctablet505:vendor-license-306
Open

pctablet505 wants to merge 1 commit into
python-lz4:masterfrom
pctablet505:vendor-license-306

Conversation

@pctablet505

@pctablet505 pctablet505 commented Jul 16, 2026 •

Copy link
Copy Markdown

Fixes #306

When no system liblz4 is found, the extensions are compiled from the vendored lz4 and xxHash sources in lz4libs/. The wheel on PyPI still only ships the wrapper's BSD-3-Clause LICENSE in dist-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 lz4 lib/LICENSE text (Yann Collet, 2011-2020).
  • lz4libs/LICENSE.xxhash: the xxHash LICENSE text, which carries its own copyright line.
  • setup.py: license_files lists both, plus the existing LICENSE. By default setuptools only picks up license files at the project root (LICEN[CS]E* etc.), so the ones in lz4libs/ 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-INFO now has a License-File: entry for each of the three files, and setuptools uses that list to fill dist-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.c etc. are the same BSD-2-Clause terms, so these files cover the binary-redistribution clause. LICENSE.xxhash is the current upstream file (2012-2021). The vendored xxhash.c header says 2012-2016.

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

Missing license of lz4libs in distributed python wheel

1 participant