Skip to content

[uv_build] Emit warning when both license (PEP639) and legacy license classifiers are present in pyproject.toml #16354

@chirizxc

Description

@chirizxc

Summary

Currently, if the build-backend package is uv_build it will without error / warning build a package with pyproject.toml contains:

license = "Apache-2.0"
license-files = ["LICENSE"]

classifiers = [
    "License :: OSI Approved :: Apache Software License",
]

All classifiers that begin with License :: are deprecated.

Also, the legacy form

license = { file = "LICENSE" }

is deprecated by PEP639 and replaced with the simplified SPDX expression form:

license = "Apache-2.0"
license-files = ["LICENSE"]

Example

[build-system]
requires = ["uv_build>=0.9.3,<0.10.0"]
build-backend = "uv_build"

[project]
name = "test"
version = "0.1.0"
readme = "README.md"
# license = { file = "LICENSE" } # <== Legacy specification (https://packaging.python.org/en/latest/specifications/pyproject-toml/#legacy-specification)
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.11"
dependencies = []

classifiers = [
    "License :: OSI Approved :: Apache Software License",
]
#   ^^^^
# https://packaging.python.org/en/latest/specifications/pyproject-toml/#classifiers

For example, setuptools simply does not build the package if this situation happens

Metadata

Metadata

Assignees

Labels

build-backendenhancementNew feature or improvement to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions