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

Support specifying the license file in the pyproject.toml file #1812

Merged
merged 2 commits into from
May 27, 2024

Conversation

MarieRoald
Copy link
Contributor

Briefcase can now read the project.license.file-key in the pyproject.toml file. Without this PR, the license file name is hard-coded to "LICENSE". This is relevant for linux builds, where the license file is included in the built package. With this PR, it still defaults to "LICENSE", but if project.license.file is set in pyproject.toml, then that file is used instead.

This is related to the LICENSE file handling in #1235

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Summary of in-person discussion: This is great; however, we probably want to:

  • Preserve the PEP621 structure of the license field as a dictionary
  • If the file sub-field is used, use that as the file name (rather than a separate license_file field)
  • If the text sub-field is used, output that text as a LICENSE file - possibly with a warning if the text doesn't appear to be a full license text
  • If license is a bare string (which will be the legacy behavior from older Briefcase projects), issue a warning and convert it to license = {"file": "LICENSE"}, since we know the license will be a file.

Signed-off-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Signed-off-by: Marie Roald <roald.marie@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Looks good! There's obviously a few gaps related to license.text handling, but those are going to be difficult to address without a fix for #1829. I'll take a swing at some of the language in the error messages before this lands, but otherwise, I think this is good to land!

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

I've tweaked the error and warning text, so we're good to go! Thanks for the contribution

@freakboy3742 freakboy3742 merged commit 31beb73 into beeware:main May 27, 2024
43 checks passed
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.

2 participants