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..753e165e 100644 --- a/python/scripts/build-wheels.mjs +++ b/python/scripts/build-wheels.mjs @@ -180,13 +180,13 @@ 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 and add license-files for 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"\nlicense-files = ["LICENSE", "CLI-LICENSE.md"]' ); // Add package-data configuration @@ -202,6 +202,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"));