From a43b262508ab43df447d68f4b3e7fd7fc4e81154 Mon Sep 17 00:00:00 2001 From: pctablet505 Date: Thu, 16 Jul 2026 21:56:53 +0530 Subject: [PATCH] Package licenses of vendored lz4 and xxHash sources 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 #306 --- MANIFEST.in | 3 +++ docs/license.rst | 8 ++++++++ lz4libs/LICENSE | 24 ++++++++++++++++++++++++ lz4libs/LICENSE.xxhash | 26 ++++++++++++++++++++++++++ setup.py | 5 +++++ 5 files changed, 66 insertions(+) create mode 100644 lz4libs/LICENSE create mode 100644 lz4libs/LICENSE.xxhash diff --git a/MANIFEST.in b/MANIFEST.in index 9561fb10..bfb51c75 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,4 @@ include README.rst +include LICENSE +include lz4libs/LICENSE +include lz4libs/LICENSE.xxhash diff --git a/docs/license.rst b/docs/license.rst index 3d599fa9..5fdc679f 100644 --- a/docs/license.rst +++ b/docs/license.rst @@ -2,3 +2,11 @@ Licensing ========= Code specific to this project is covered by the `BSD 3-Clause License `_ + +This package bundles the LZ4 and xxHash C libraries (under ``lz4libs/``) when +they are built from source rather than linked against a system-provided +``liblz4``. Those libraries are covered by their own `BSD 2-Clause License +`_, copyright Yann Collet. The +license texts are included alongside the vendored sources in +``lz4libs/LICENSE`` and ``lz4libs/LICENSE.xxhash``, and are packaged with the +distributed sdist and wheel. diff --git a/lz4libs/LICENSE b/lz4libs/LICENSE new file mode 100644 index 00000000..48849169 --- /dev/null +++ b/lz4libs/LICENSE @@ -0,0 +1,24 @@ +LZ4 Library +Copyright (c) 2011-2020, Yann Collet +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lz4libs/LICENSE.xxhash b/lz4libs/LICENSE.xxhash new file mode 100644 index 00000000..e4c5da72 --- /dev/null +++ b/lz4libs/LICENSE.xxhash @@ -0,0 +1,26 @@ +xxHash Library +Copyright (c) 2012-2021 Yann Collet +All rights reserved. + +BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/setup.py b/setup.py index eb9030fa..2f82a92e 100644 --- a/setup.py +++ b/setup.py @@ -183,6 +183,11 @@ def pkgconfig_installed_check(lib, required_version, default): author='Jonathan Underwood', author_email='jonathan.underwood@gmail.com', license='BSD-3-Clause', + license_files=[ + 'LICENSE', + 'lz4libs/LICENSE', + 'lz4libs/LICENSE.xxhash', + ], url='https://github.com/python-lz4/python-lz4', packages=packages, ext_modules=ext_modules,