Skip to content

fix deprecated parts in pyproject example in README#10479

Merged
radoering merged 4 commits intopython-poetry:mainfrom
KUHLwasStolen:readme-example-update
Aug 2, 2025
Merged

fix deprecated parts in pyproject example in README#10479
radoering merged 4 commits intopython-poetry:mainfrom
KUHLwasStolen:readme-example-update

Conversation

@KUHLwasStolen
Copy link
Copy Markdown
Contributor

@KUHLwasStolen KUHLwasStolen commented Jul 30, 2025

This pull request updates the pyproject.toml example in the README as it was largely deprecated according to this section of the documentation.
A more detailed list of affected fields can be found in issue #10477
The new example should basically be equivalent to the old example, but sticks closer to the documentation's recommendations.

Pull Request Check List

Resolves: #10477

  • Added tests for changed code. (no code changed)
  • Updated documentation for changed code. (no code changed)
  • Checked pyproject changes with poetry check

Summary by Sourcery

Revise the pyproject.toml example in the README to remove deprecated tool.poetry sections and adopt the PEP 621–compliant [project] table with updated metadata and dependency syntax.

Documentation:

  • Replace the legacy [tool.poetry] example with a PEP 621–style [project] section
  • Update metadata fields (license, readme, python requirements, authors, keywords) to align with documentation
  • Refactor dependencies and optional dependencies to inline semver constraints under [project.dependencies] and [project.optional-dependencies]
  • Add [project.urls] and [project.scripts] sections and remove deprecated tool.poetry.group and tool.poetry.scripts entries

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Jul 30, 2025

Reviewer's Guide

The README’s pyproject.toml example has been refactored to replace deprecated Poetry-specific syntax with a PEP 621–compliant [project] table, migrating core metadata, dependencies, and auxiliary sections to align with current Poetry documentation.

Entity relationship diagram for pyproject.toml sections after the update

erDiagram
    PROJECT ||--o{ PROJECT_URLS : has
    PROJECT ||--o{ PROJECT_SCRIPTS : has
    PROJECT ||--o{ PROJECT_OPTIONAL_DEPENDENCIES : has
    PROJECT ||--o{ PROJECT_DEPENDENCIES : has
    PROJECT {
        string name
        string version
        string description
        dict license
        list authors
        string readme
        string requires-python
        list keywords
    }
    PROJECT_URLS {
        string repository
        string homepage
    }
    PROJECT_SCRIPTS {
        string my_package_cli
    }
    PROJECT_OPTIONAL_DEPENDENCIES {
        string my-extra
    }
    PROJECT_DEPENDENCIES {
        string aiohttp
        string requests
        string tomli
        string cleo
    }
Loading

Class diagram for pyproject.toml metadata structure before and after the update

classDiagram
    class ToolPoetry {
        <<deprecated>>
        name: str
        version: str
        description: str
        license: str
        authors: list
        readme: list
        keywords: list
        dependencies: dict
        scripts: dict
    }
    class Project {
        name: str
        version: str
        description: str
        license: dict
        authors: list
        readme: str
        requires-python: str
        keywords: list
        dependencies: list
        urls: dict
        scripts: dict
        optional-dependencies: dict
    }
    ToolPoetry <|-- Project : migrated to
    class ToolPoetryDependencies {
        python: str
        aiohttp: str
        requests: dict
        tomli: dict
        cleo: dict
        pendulum: dict
    }
    class ProjectDependencies {
        python: str
        aiohttp: str
        requests: str
        tomli: dict
        cleo: str
        pendulum: str
    }
    ToolPoetry --> ToolPoetryDependencies : dependencies
    Project --> ProjectDependencies : dependencies
Loading

File-Level Changes

Change Details Files
Adopt PEP 621 [project] table and migrate core metadata
  • Replaced [tool.poetry] header with [project]
  • Converted license to inline table and added readme and requires-python fields
  • Reformatted authors as inline tables
README.md
Migrate dependency declarations to PEP 621 format
  • Replaced [tool.poetry.dependencies] with a project.dependencies array
  • Converted version constraints to inline semver notation
  • Added upper version cap for python and simplified tomli syntax
README.md
Introduce PEP 621 sub-tables and remove deprecated entries
  • Added [project.urls] with repository and homepage
  • Defined [project.scripts] and [project.optional-dependencies] sections
  • Removed legacy [tool.poetry.scripts] block
README.md

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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @KUHLwasStolen - I've reviewed your changes - here's some feedback:

  • The dependencies section still uses [tool.poetry.dependencies]—consider switching it to the PEP 621 [project.dependencies] table to keep the example fully spec-compliant.
  • The docs dependencies are defined under Poetry’s group syntax; you may want to migrate them to PEP 621’s [project.optional-dependencies] instead of using [tool.poetry.group.docs.dependencies].
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The dependencies section still uses [tool.poetry.dependencies]—consider switching it to the PEP 621 [project.dependencies] table to keep the example fully spec-compliant.
- The docs dependencies are defined under Poetry’s group syntax; you may want to migrate them to PEP 621’s [project.optional-dependencies] instead of using [tool.poetry.group.docs.dependencies].

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@KUHLwasStolen KUHLwasStolen marked this pull request as draft July 31, 2025 14:36
@KUHLwasStolen KUHLwasStolen marked this pull request as ready for review July 31, 2025 15:58
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @KUHLwasStolen - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@radoering radoering force-pushed the readme-example-update branch from bff3d25 to 85c24e9 Compare August 2, 2025 08:01
@radoering radoering merged commit 66cd777 into python-poetry:main Aug 2, 2025
53 checks passed
@KUHLwasStolen KUHLwasStolen deleted the readme-example-update branch August 2, 2025 08:13
radoering pushed a commit that referenced this pull request Aug 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 2, 2025

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyproject.toml example in README uses deprecated fields

2 participants