CI: copy central LICENSE into package directories before build - #609
CI: copy central LICENSE into package directories before build#609paul-gerber-svg wants to merge 2 commits into
Conversation
Previously, the python build backend failed to include the `LICENSE` file in sdist and wheel distributions because build processes run isolated within subpackage directories (`./sdk` and `./compliance_tool`) without access to the root `LICENSE` file. Now, the CI workflows (`pr.yml` and `release.yml`) copy the root `LICENSE` file into the respective package directories immediately before executing `python -m build`, ensuring correct metadata inclusion for PyPI releases. Fixes eclipse-basyx#562
| - name: Checkout Repository | ||
| uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0 | ||
|
|
||
| - uses: ./.github/actions/build-server |
There was a problem hiding this comment.
I guess the Python package server is being built in this action? In that case, we should also include the LICENSE file there.
There was a problem hiding this comment.
I checked the workflows and Dockerfiles for server:
serverisn't packaged or published as a standalone Python distribution (sdist/wheel) to PyPI likesdkandcompliance_tool. It is built exclusively as a Docker image.- In
.github/actions/build-server/action.yml, the Docker build context is set to the repository root (context: .), so Docker already has full access to the rootLICENSEfile if needed. - The Dockerfiles explicitly copy only
./server/appand./server/pyproject.toml, so executingcp LICENSE server/in CI would be ignored by the Docker build anyway.
Therefore, no cp LICENSE step is required for the server build.
|
I recently had to deep-dive in Additionally, I personally would prefer symlinks over copying files in CI, if this is not already an option you considered. |
Previously, the python build backend failed to include the
LICENSEfilein sdist and wheel distributions because build processes run isolated
within subpackage directories (
./sdkand./compliance_tool) withoutaccess to the root
LICENSEfile.Now, the CI workflows (
pr.ymlandrelease.yml) copy the rootLICENSEfileinto the respective package directories immediately before executing
python -m build, ensuring correct metadata inclusion for PyPI releases.Fixes #462