Skip to content

Use setuptools license_expression for the license metadata - #2688

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-client:masterfrom
chala2001:pyproject-license-expression
Aug 28, 2026
Merged

Use setuptools license_expression for the license metadata#2688
kubernetes-prow[bot] merged 1 commit into
kubernetes-client:masterfrom
chala2001:pyproject-license-expression

Conversation

@chala2001

@chala2001 chala2001 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Follow-up to #2687, as requested there.

#2687 set the license to the SPDX identifier Apache-2.0, but a plain license=
keyword lands in the legacy free-text License field. setuptools'
license_expression= keyword produces the PEP 639 License-Expression field
instead, so that is what the three setup scripts now use.

Metadata built with setuptools 84.0.0:

before:  License: Apache-2.0
after:   License-Expression: Apache-2.0

Checked all three scripts, and the distribution names are unchanged:

setup.py           Name: kubernetes        License-Expression: Apache-2.0
setup-release.py   Name: kubernetes        License-Expression: Apache-2.0
setup-asyncio.py   Name: kubernetes.aio    License-Expression: Apache-2.0

License-File: LICENSE is still there, and the legacy License field is gone.
pip install -e ., which is what tox does via usedevelop = True, still works.

Which issue(s) this PR fixes:

Follow-up to #2687, no separate issue.

Special notes for your reviewer:

license_expression= needs setuptools 77 or newer. Older versions ignore it with a
warning rather than failing, so an old build environment gets the same metadata it
gets today.

An earlier version of this PR added a pyproject.toml with [project] license.
That worked, but [project] name cannot be dynamic, so it renamed the
setup-asyncio.py build from kubernetes.aio to kubernetes. The keyword route
you asked for avoids that entirely and is three lines instead of a new file.

Does this PR introduce a user-facing change?

Package metadata now declares the license using the PEP 639 `License-Expression` field.

@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Aug 27, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog August 27, 2026 18:01
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 27, 2026
@yliaog

yliaog commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

please use setuptools' license_expression= keyword in setup() instead, thanks.

@chala2001
chala2001 force-pushed the pyproject-license-expression branch from 0500587 to 8bedad9 Compare August 28, 2026 02:27
@kubernetes-prow kubernetes-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 28, 2026
@chala2001 chala2001 changed the title Declare the license as a PEP 639 expression in pyproject.toml Use setuptools license_expression for the license metadata Aug 28, 2026
@chala2001

chala2001 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Done - switched to license_expression= in the three setup scripts and dropped the pyproject.toml. Verified License-Expression: Apache-2.0 in all three builds, and setup-asyncio.py keeps its kubernetes.aio name this way. Thanks..

@yliaog

yliaog commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

thanks for the PR

/lgtm
/approve

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 28, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chala2001, yliaog

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 28, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit fa09746 into kubernetes-client:master Aug 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants