Include license file into python wheels#1931
Include license file into python wheels#1931justeph wants to merge 1 commit intohuggingface:mainfrom
Conversation
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
There was a problem hiding this comment.
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.tomland stop treatinglicenseas dynamic metadata. - Add
bindings/python/LICENSEintended 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.
| @@ -0,0 +1 @@ | |||
| ../../LICENSE No newline at end of file | |||
There was a problem hiding this comment.
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.
|
Tho I do see on |
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 |
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