Skip to content

CI: copy central LICENSE into package directories before build - #609

Open
paul-gerber-svg wants to merge 2 commits into
eclipse-basyx:developfrom
rwth-iat:add-license-to-source-dis
Open

CI: copy central LICENSE into package directories before build#609
paul-gerber-svg wants to merge 2 commits into
eclipse-basyx:developfrom
rwth-iat:add-license-to-source-dis

Conversation

@paul-gerber-svg

@paul-gerber-svg paul-gerber-svg commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

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 #462

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
Comment thread .github/workflows/pr.yml
- name: Checkout Repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0

- uses: ./.github/actions/build-server

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the Python package server is being built in this action? In that case, we should also include the LICENSE file there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the workflows and Dockerfiles for server:

  • server isn't packaged or published as a standalone Python distribution (sdist/wheel) to PyPI like sdk and compliance_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 root LICENSE file if needed.
  • The Dockerfiles explicitly copy only ./server/app and ./server/pyproject.toml, so executing cp LICENSE server/ in CI would be ignored by the Docker build anyway.

Therefore, no cp LICENSE step is required for the server build.

@hpoeche

hpoeche commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I recently had to deep-dive in setuptools configuration options and came across this. We should consider here, that the way we define the license in our pyproject.toml files is deprecated. More information and migration guide can be found here: https://setuptools.pypa.io/en/latest/userguide/license_migration.html

Additionally, I personally would prefer symlinks over copying files in CI, if this is not already an option you considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants