Skip to content

Commit 6edd514

Browse files
committed
tables: ship the licences of what the wheel bundles
pyproject.toml's explicit license-files list only ever named LICENSE.txt, so nothing else ever reached dist-info/licenses/ -- confirmed against the real PyPI wheel, which has the same gap. Extend it to the licences of what this build actually compiles in or links (c-blosc + its bundled LZ4/zlib/zstd, HDF5, h5py, and our own added BZIP2.txt), not the whole upstream LICENSES/ directory: most of the rest of it (FastLZ, Snappy, Windows-only shims, the docs theme) covers content this build never ships, and a wildcard would misdeclare it. Update the post-build check to assert the exact set so a future patch that stops applying fails loudly instead of silently shipping fewer licences.
1 parent ac8b582 commit 6edd514

2 files changed

Lines changed: 75 additions & 3 deletions

File tree

.github/workflows/build-tables.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,18 @@ jobs:
169169
n.split(".dist-info/licenses/", 1)[1] for n in names
170170
if ".dist-info/licenses/" in n and not n.endswith("/")
171171
}
172-
assert "LICENSE.txt" in licences, licences
173-
assert "LICENSES/BZIP2.txt" in licences, licences
174-
assert "LICENSES/HDF5.txt" in licences, licences
172+
# Everything the wheel actually compiles in or links (patches/tables):
173+
# c-blosc and its bundled LZ4/zlib/zstd, HDF5, h5py (credited in
174+
# hdf5extension.pyx/array.py), and our own added BZIP2.txt. Not
175+
# upstream's whole LICENSES/ dir - most of the rest (FastLZ, Snappy,
176+
# Windows-only shims, the docs theme) covers content this build
177+
# never ships.
178+
expected_licences = {
179+
"LICENSE.txt", "LICENSES/BLOSC.txt", "LICENSES/BZIP2.txt",
180+
"LICENSES/H5PY.txt", "LICENSES/HDF5.txt", "LICENSES/LZ4.txt",
181+
"LICENSES/ZLIB.txt", "LICENSES/ZSTD.txt",
182+
}
183+
assert licences == expected_licences, licences
175184
EOF
176185
177186
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Sun, 6 Sep 2026 00:00:00 +0000
4+
Subject: [PATCH] Ship the licences of what the wheel actually bundles
5+
6+
pyproject.toml's `license-files = ["LICENSE.txt"]` is an explicit PEP
7+
639 list, which replaces setuptools' default glob outright rather than
8+
extending it -- so only LICENSE.txt itself ever lands in
9+
`dist-info/licenses/`, confirmed against the real PyPI wheel
10+
(tables-3.11.1-cp311-abi3-manylinux2014_x86_64...whl also ships only
11+
LICENSE.txt).
12+
13+
That leaves out the licences of what this build actually compiles in
14+
or links: c-blosc (LICENSES/BLOSC.txt) and its bundled LZ4/zlib/zstd
15+
(LICENSES/LZ4.txt, LICENSES/ZLIB.txt, LICENSES/ZSTD.txt, all compiled
16+
directly into tables' own extensions from c-blosc/internal-complibs,
17+
confirmed from this workflow's own build log's object file list), HDF5
18+
itself (LICENSES/HDF5.txt), and h5py, whose adapted code is credited in
19+
tables/hdf5extension.pyx and tables/array.py (LICENSES/H5PY.txt) --
20+
both of which ship. It also leaves out LICENSES/BZIP2.txt, which this
21+
workflow's own CIBW_BEFORE_ALL_LINUX already creates (bzip2 isn't on
22+
the manylinux policy allow-list, so auditwheel vendors it into the
23+
wheel) precisely so it can be shipped this way, but never actually
24+
was, since nothing added it to this list.
25+
26+
Not a wildcard over the whole LICENSES/ directory: it also holds
27+
FASTLZ.txt and SNAPPY.txt for codecs this c-blosc checkout does not
28+
compile (no fastlz/snappy sources exist under
29+
c-blosc/internal-complibs, and neither identifier appears anywhere
30+
else in tables/ or src/), STDINT.txt and WIN32PTHREADS.txt for
31+
Windows-only build shims (no reference outside the Windows-specific
32+
build config), and CLOUD-SPTHEME.txt for the Sphinx theme used to
33+
build the documentation, not the wheel. Declaring those would falsely
34+
claim licences for content this build never ships.
35+
36+
Upstream-Status: To upstream [not submitted: no cross-repo issue/PR contributions from this port]
37+
38+
Signed-off-by: Ludovic Henry <git@ludovic.dev>
39+
---
40+
diff --git a/pyproject.toml b/pyproject.toml
41+
index f838c31..49d808f 100644
42+
--- a/pyproject.toml
43+
+++ b/pyproject.toml
44+
@@ -112,7 +112,16 @@ pttree = "tables.scripts.pttree:main"
45+
platforms = [ "any" ]
46+
zip-safe = false
47+
# include-package-data = true
48+
-license-files = [ "LICENSE.txt" ]
49+
+license-files = [
50+
+ "LICENSE.txt",
51+
+ "LICENSES/BLOSC.txt",
52+
+ "LICENSES/BZIP2.txt",
53+
+ "LICENSES/H5PY.txt",
54+
+ "LICENSES/HDF5.txt",
55+
+ "LICENSES/LZ4.txt",
56+
+ "LICENSES/ZLIB.txt",
57+
+ "LICENSES/ZSTD.txt",
58+
+]
59+
60+
61+
[tool.setuptools.dynamic]
62+
--
63+
2.43.0

0 commit comments

Comments
 (0)