Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions tests/ci/test_packaging_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down
Loading