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", 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")