Skip to content

Include license file into python wheels#1931

Open
justeph wants to merge 1 commit intohuggingface:mainfrom
justeph:include-license-file-in-python-wheels
Open

Include license file into python wheels#1931
justeph wants to merge 1 commit intohuggingface:mainfrom
justeph:include-license-file-in-python-wheels

Conversation

@justeph
Copy link
Copy Markdown

@justeph justeph commented Jan 20, 2026

python wheels distributed on PyPI don't include the license. Fix it, by symlinking the LICENSe file into bindings/python the same way it's done for rust crate in 67080e1

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Python packaging metadata so PyPI wheels include the project license, aligning the Python distribution’s licensing metadata with the repository’s top-level LICENSE.

Changes:

  • Declare the license file in bindings/python/pyproject.toml and stop treating license as dynamic metadata.
  • Add bindings/python/LICENSE intended to reference the repository’s root LICENSE (via symlink).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
bindings/python/pyproject.toml Adds PEP 621 license.file metadata and removes license from dynamic.
bindings/python/LICENSE Introduces a LICENSE file in the Python package directory (implemented as a symlink to the repo root).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bindings/python/LICENSE
@@ -0,0 +1 @@
../../LICENSE No newline at end of file
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

bindings/python/LICENSE is being added as a symlink (to ../../LICENSE). This is fragile for Python packaging: on Windows checkouts where Git can’t create symlinks (e.g., core.symlinks=false), the file often ends up as a plain text file containing the link target, which would make the declared license = { file = "LICENSE" } metadata incorrect (and could still leave wheels missing the actual license text). Prefer committing a real LICENSE file under bindings/python/ (or copying it into place as part of the build/release process) so sdist/wheel builds are platform-independent.

Copilot uses AI. Check for mistakes.
@ArthurZucker
Copy link
Copy Markdown
Collaborator

Tho I do see on pypi: License: Apache Software License
What is missing for you? the full file?

@justeph
Copy link
Copy Markdown
Author

justeph commented Mar 26, 2026

Tho I do see on pypi: License: Apache Software License What is missing for you? the full file?

Yes. When you distribute a wheel you should add the license file. Right now, if you download and unzip a wheel from pypi, it will not contain the License file. Only the name of the license is included in the METADATA file

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