Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package multiple license files in .dist-info #861

Open
idavis opened this issue Mar 30, 2022 · 3 comments
Open

Package multiple license files in .dist-info #861

idavis opened this issue Mar 30, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@idavis
Copy link
Contributor

idavis commented Mar 30, 2022

Summary

Add support for license-files option in metadata for PEP 639 so that licenses are added to the .dist-info wheel folder. This extends the work of #837 (#829).

There are three separate pieces covered here:

  • Supporting license-files.paths
  • Supporting license-files.globs
  • Supporting convention for automatically including license files

I think a minimum version of this feature with the highest return would be to add the convention for automatically including license files with the license-files option being treated as dynamic to trigger the default behavior. I have a working spike of the implementation but I need to write tests.

Looking through the code, we'd need to add license-files to the pyproject-toml-rs project to deal with serializing the new metadata option to unblock support for license-files.(paths|globs) which can build on the work done in #837 to append the license files to the merging metadata.

Current State

The single license specified in the pyproject.toml will be copied into the .dist-info wheel folder:

[project]
license = {file = "LICENSE"}

Desired State

The link used for multiple file use in #837 is broken (and in the code). The advanced example for PEP 639 shows the use of license-files.paths or license-files.globs for listing multiple licenses:

Example with notice:

[project]
license-files.paths = [
    "LICENSE",
    "NOTICE.txt",
]

Multiple license files:

[project]
license-files.paths = [
    "LICENSE",
    "_vendor/LICENSE",
    "_vendor/LICENSE.APACHE",
    "_vendor/LICENSE.BSD",
]

Or alternatively, matched via glob patterns:

[project]
license-files.globs = [
    "LICENSE*",
    "_vendor/LICENSE*",
]

PEP 649 - I maintain an existing package that’s already licensed gives further defaults used by setuptools for automatically including these files.

@idavis idavis added the enhancement New feature or request label Mar 30, 2022
@messense
Copy link
Member

Thanks for the issue, feel free to implement it and send PRs.

@idavis
Copy link
Contributor Author

idavis commented Mar 31, 2022

@messense I have created a PR for Adding license_expression and license_files serialization to support this work in the PyO3/pyproject-toml-rs repo.

@idavis
Copy link
Contributor Author

idavis commented Apr 1, 2022

@messense Submitted PR #862 which has just the default license packaging from PEP 639. The other items in this issue require the serialization updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants