add support for PEP 639 License Clarity
Pull Request Check List
Requires: python-poetry/poetry-core#870 Resolves: #9670
- [x] Added tests for changed code (see poetry-core PR).
- [x] Updated documentation for changed code.
Summary by Sourcery
Add support for PEP 639 license clarity by simplifying license specification, introducing a license-files field with default glob patterns, and updating documentation, tests, and dependency references accordingly.
New Features:
- Introduce
license-filesfield inpyproject.tomlfor specifying license file patterns with configurable defaults
Enhancements:
- Deprecate table-based license specification in favor of simple string identifiers
- Define default license file globs included in distributions and allow overriding by an empty list
Documentation:
- Update
pyproject.mdandlibraries.mdto document thelicense-filesfield and deprecation of table syntax - Clarify default license-related files included in wheel and sdist builds
Tests:
- Add warning for deprecated or invalid SPDX license identifiers in the
checkcommand - Update test fixtures to use string-based license fields instead of tables
Reviewer's Guide
Add PEP 639 License Clarity support by simplifying license specification, introducing a license-files field with default glob patterns, deprecating table-based license syntax, and updating documentation, tests, and dependency references accordingly.
Class diagram for license specification changes in pyproject.toml
classDiagram
class ProjectMetadata {
+license: str
+license_files: List[str]
}
ProjectMetadata : -license (table syntax) [deprecated]
ProjectMetadata : +license (SPDX string)
ProjectMetadata : +license_files (glob patterns)
ProjectMetadata : +license_files = default patterns if not specified
ProjectMetadata : +license_files = [] disables inclusion
Class diagram for updated build process including license files
classDiagram
class Builder {
+build_sdist()
+build_wheel()
+include_license_files(patterns: List[str])
}
Builder --> ProjectMetadata
Builder : +include_license_files uses license_files from ProjectMetadata
Builder : +include_license_files uses default patterns if not specified
Builder : +include_license_files skips if patterns is empty
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Simplify license specification and introduce license-files field |
|
docs/pyproject.mddocs/libraries.mdpyproject.toml |
| Update builder metadata and test assertions for license expressions |
|
tests/masonry/builders/test_editable_builder.py |
| Add SPDX validation warnings and update related tests and fixtures |
|
tests/console/commands/test_check.pytests/fixtures/invalid_pyproject/pyproject.tomltests/fixtures/simple_project/pyproject.toml |
| Require updated packaging version for PEP 639 support |
|
pyproject.toml |
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
-
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. -
Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Deploy preview for website ready!
✅ Preview https://website-2pqoe34nt-python-poetry.vercel.app
Built with commit 94098f6d6de33cdf73be572ac3453e6ee546edb3. This pull request is being automatically deployed with vercel-action
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.