From ad5648657cd31291bd45f7ae5df93775a26bf3b9 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Tue, 13 Oct 2026 12:47:28 +0900 Subject: [PATCH 1/2] build: declare the license as a table so distro setuptools can build the wheel The SPDX string form of `project.license` (PEP 639) needs setuptools>=77. The Debian package build runs with the distribution's python3-setuptools, 68 on Ubuntu 24.04, which rejects it: ValueError: invalid pyproject.toml config: `project.license`. so `python3-flagsparse` cannot be built from v0.3.0. The table form is accepted by every setuptools from 61 to the current 84 (with a deprecation warning on new ones, removal not before 2027-02-18). setuptools includes LICENSE by default, so the `license-files` key, which old versions also reject, is not needed. --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7afb358..6dfff94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,8 +27,10 @@ requires-python = ">=3.10" # declaring them here would make pip pull the generic CUDA torch over the top. dependencies = [] authors = [{ name = "Your Name", email = "your.email@example.com" }] -license = "Apache-2.0" -license-files = ["LICENSE"] +# Table form on purpose: the SPDX string (PEP 639) needs setuptools>=77, but +# the deb build uses the distribution's python3-setuptools (68 on Ubuntu +# 24.04), which rejects it. setuptools picks LICENSE up by default. +license = { text = "Apache-2.0" } classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", From 0c055f86c4a5cbf2c93e045647fb46a416a7a237 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Tue, 13 Oct 2026 17:29:59 +0900 Subject: [PATCH 2/2] test: expect the license table form in pyproject --- tests/ci/test_packaging_metadata.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/ci/test_packaging_metadata.py b/tests/ci/test_packaging_metadata.py index a0d4537..9521aca 100644 --- a/tests/ci/test_packaging_metadata.py +++ b/tests/ci/test_packaging_metadata.py @@ -79,9 +79,11 @@ def test_python_requires_matches_metadata(): def test_license_metadata_is_apache_2(): + # The table form is the one every setuptools in the packaging targets + # accepts (ubuntu 24.04 ships 68, openEuler 24.03 ships 65); the PEP 639 + # string form needs setuptools >= 77 and is rejected below that. pyproject = _read_text("pyproject.toml") - assert 'license = "Apache-2.0"' in pyproject - assert 'license-files = ["LICENSE"]' in pyproject + assert 'license = { text = "Apache-2.0" }' in pyproject assert "Apache (Version 2.0)" in _read_text("README.md")