Skip to content

add support for PEP 639 License Clarity #10413

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

radoering
Copy link
Member

@radoering radoering commented May 31, 2025

Pull Request Check List

Requires: python-poetry/poetry-core#870
Resolves: #9670

  • Added tests for changed code (see poetry-core PR).
  • 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-files field in pyproject.toml for 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.md and libraries.md to document the license-files field 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 check command
  • Update test fixtures to use string-based license fields instead of tables

Copy link

sourcery-ai bot commented May 31, 2025

Reviewer's Guide

Implement PEP 639 license clarity by deprecating the old table-based license syntax, introducing the new license-files field (with defaults and override behavior), updating related warnings and documentation, adjusting the poetry-core dependency to the PEP 639 branch, and updating tests and fixtures to reflect the new license model.

File-Level Changes

Change Details Files
Revise license configuration to align with PEP 639
  • Deprecate { text = … }/{ file = … } table syntax for license
  • Introduce license-files list with default glob patterns and override semantics
  • Add warnings and notes about deprecation, default behavior, and empty-list handling
  • Remove outdated proprietary-license note
  • Adjust classifiers warning to drop automatic license mention
docs/pyproject.md
docs/libraries.md
Point poetry-core dependency to PEP 639 branch
  • Update poetry-core reference to use the pep639 branch in pyproject.toml
pyproject.toml
Update tests and fixtures for new license syntax
  • Add a warning in test_check for invalid SPDX identifiers
  • Replace table-based license entries with string syntax in fixture pyproject.toml files
tests/console/commands/test_check.py
tests/fixtures/invalid_pyproject/pyproject.toml
tests/fixtures/simple_project/pyproject.toml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on 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 issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on 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 dismiss on 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 review to 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

@radoering radoering added the impact/docs Contains or requires documentation changes label May 31, 2025
Copy link

github-actions bot commented May 31, 2025

Deploy preview for website ready!

✅ Preview
https://website-qfsxxilox-python-poetry.vercel.app

Built with commit 103aa7c.
This pull request is being automatically deployed with vercel-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/docs Contains or requires documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement PEP 639
1 participant