Skip to content

Commit 0500587

Browse files
committed
Declare the license as a PEP 639 expression in pyproject.toml
A license= keyword in setup.py still lands in the legacy free-text License field, so the published metadata reads "License: Apache-2.0" rather than "License-Expression: Apache-2.0". Only a [project] license in pyproject.toml produces the expression. Adds a pyproject.toml declaring the build backend, the license and the license file, and leaves every other field dynamic so setup.py stays the single place scripts/update-client.sh rewrites at release time. Drops the now-redundant license= keyword from the three setup scripts; pyproject.toml overrides it, and setuptools warns when both are set.
1 parent 91fd167 commit 0500587

4 files changed

Lines changed: 36 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2026 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
[build-system]
16+
requires = ["setuptools>=77"]
17+
build-backend = "setuptools.build_meta"
18+
19+
[project]
20+
name = "kubernetes"
21+
license = "Apache-2.0"
22+
license-files = ["LICENSE"]
23+
# Everything else is still declared in setup.py, which scripts/update-client.sh
24+
# rewrites on every release.
25+
dynamic = [
26+
"version",
27+
"description",
28+
"readme",
29+
"requires-python",
30+
"dependencies",
31+
"optional-dependencies",
32+
"classifiers",
33+
"keywords",
34+
"authors",
35+
"urls",
36+
]

setup-asyncio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
description="Kubernetes asynchronous python client",
4040
author_email="",
4141
author="Kubernetes",
42-
license="Apache-2.0",
4342
url="https://github.com/kubernetes-client/kubernetes/aio",
4443
keywords=["Swagger", "OpenAPI", "Kubernetes"],
4544
install_requires=REQUIRES,

setup-release.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
description="Kubernetes python client",
6161
author_email="",
6262
author="Kubernetes",
63-
license="Apache-2.0",
6463
url="https://github.com/kubernetes-client/python",
6564
keywords=["Swagger", "OpenAPI", "Kubernetes"],
6665
install_requires=REQUIRES+REQUIRES_ASYNCIO,

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
description="Kubernetes python client",
5454
author_email="",
5555
author="Kubernetes",
56-
license="Apache-2.0",
5756
url="https://github.com/kubernetes-client/python",
5857
keywords=["Swagger", "OpenAPI", "Kubernetes"],
5958
install_requires=REQUIRES,

0 commit comments

Comments
 (0)