From 105d88a3f8e2e6ab54e53e667c2ca4c6928cf6b5 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 12 Feb 2026 09:52:04 -0800 Subject: [PATCH 1/2] python: migrate to PEP 639 license-files - Change license from deprecated table form to SPDX expression string - Remove deprecated License :: trove classifier - Update build-wheels.mjs to set license-files with both SDK LICENSE and CLI-LICENSE.md for bundled wheels - Update SPDX expression to 'MIT AND LicenseRef-Copilot-CLI' for bundled CLI wheels --- python/pyproject.toml | 4 ++-- python/scripts/build-wheels.mjs | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index b902b050..1d91a41b 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -8,14 +8,14 @@ version = "0.1.0" description = "Python SDK for GitHub Copilot CLI" readme = "README.md" requires-python = ">=3.9" -license = {text = "MIT"} +license = "MIT" +# license-files is set by scripts/build-wheels.mjs for bundled CLI wheels authors = [ {name = "GitHub", email = "opensource@github.com"} ] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/python/scripts/build-wheels.mjs b/python/scripts/build-wheels.mjs index 7d810408..1fe83df4 100644 --- a/python/scripts/build-wheels.mjs +++ b/python/scripts/build-wheels.mjs @@ -180,13 +180,19 @@ async function buildWheel(platform, pkgVersion, cliVersion, outputDir, licensePa // Create __init__.py writeFileSync(join(binDir, "__init__.py"), '"""Bundled Copilot CLI binary."""\n'); - // Copy and modify pyproject.toml - replace license reference with file + // Copy and modify pyproject.toml for bundled CLI wheel let pyprojectContent = readFileSync(join(pythonDir, "pyproject.toml"), "utf-8"); - // Replace the license specification with file reference + // Update SPDX expression to cover both SDK and bundled CLI licenses pyprojectContent = pyprojectContent.replace( - 'license = {text = "MIT"}', - 'license = {file = "CLI-LICENSE.md"}' + 'license = "MIT"', + 'license = "MIT AND LicenseRef-Copilot-CLI"' + ); + + // License files are copied into the build dir, so use local paths + pyprojectContent = pyprojectContent.replace( + 'license = "MIT AND LicenseRef-Copilot-CLI"', + 'license = "MIT AND LicenseRef-Copilot-CLI"\nlicense-files = ["LICENSE", "CLI-LICENSE.md"]' ); // Add package-data configuration @@ -202,6 +208,9 @@ async function buildWheel(platform, pkgVersion, cliVersion, outputDir, licensePa cpSync(join(pythonDir, "README.md"), join(buildDir, "README.md")); } + // Copy SDK LICENSE + cpSync(join(repoRoot, "LICENSE"), join(buildDir, "LICENSE")); + // Copy CLI LICENSE cpSync(licensePath, join(buildDir, "CLI-LICENSE.md")); From 8b9bac5ab42d5a26c3deb0b535eac09f850cd285 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 12 Feb 2026 12:52:39 -0800 Subject: [PATCH 2/2] python: collapse two-step license replacement into one Address review feedback: combine the SPDX expression and license-files replacements into a single atomic operation to avoid fragile coupling. --- python/scripts/build-wheels.mjs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/python/scripts/build-wheels.mjs b/python/scripts/build-wheels.mjs index 1fe83df4..753e165e 100644 --- a/python/scripts/build-wheels.mjs +++ b/python/scripts/build-wheels.mjs @@ -183,15 +183,9 @@ async function buildWheel(platform, pkgVersion, cliVersion, outputDir, licensePa // Copy and modify pyproject.toml for bundled CLI wheel let pyprojectContent = readFileSync(join(pythonDir, "pyproject.toml"), "utf-8"); - // Update SPDX expression to cover both SDK and bundled CLI licenses + // Update SPDX expression and add license-files for both SDK and bundled CLI licenses pyprojectContent = pyprojectContent.replace( 'license = "MIT"', - 'license = "MIT AND LicenseRef-Copilot-CLI"' - ); - - // License files are copied into the build dir, so use local paths - pyprojectContent = pyprojectContent.replace( - 'license = "MIT AND LicenseRef-Copilot-CLI"', 'license = "MIT AND LicenseRef-Copilot-CLI"\nlicense-files = ["LICENSE", "CLI-LICENSE.md"]' );