Skip to content

Stage the Python license file during builds#9015

Open
steadytao wants to merge 1 commit intogoogle:masterfrom
steadytao:fix-8789-stage-python-license-during-build
Open

Stage the Python license file during builds#9015
steadytao wants to merge 1 commit intogoogle:masterfrom
steadytao:fix-8789-stage-python-license-during-build

Conversation

@steadytao
Copy link
Copy Markdown

Summary

Stage the repo-root LICENSE file into the Python package directory during builds.

Problem

The Python package can no longer use ../LICENSE in license_files but the current license_files = LICENSE configuration also warns because python/LICENSE does not exist at build time.

Fix

  • copy the repo-root LICENSE into the Python package directory before calling setup()
  • let setuptools include it through license_files = LICENSE
  • remove the staged copy afterwards so no tracked duplicate is needed in the repo

Testing

  • ran python -m build in python/
  • verified the previous license_files warning is gone
  • verified the built wheel includes dist-info/licenses/LICENSE
  • verified the temporary python/LICENSE file is removed after the build

Fixes #8789.

Copy the repo-root LICENSE into the Python package directory for the duration of setup() so license_files = LICENSE remains valid without using deprecated parent-directory paths.

Remove the staged copy after the build completes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy license file to directory temporarily during Python build

1 participant