fix: use readme text directly instead of constructing path#914
fix: use readme text directly instead of constructing path#914radoering merged 1 commit intopython-poetry:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts how inline README text from pyproject.toml is handled by the Factory, and adds a regression test to verify correct readme content and content-type extraction. Sequence diagram for handling inline README text in package metadatasequenceDiagram
actor Developer
participant PoetryCLI
participant Factory
participant Package
Developer->>PoetryCLI: Run build / publish with pyproject.toml
PoetryCLI->>Factory: _configure_package_metadata(pyproject, root, package)
Factory->>Factory: Detect readme.text in tool.poetry.readme
Factory->>Package: set readme_content(readme.text)
Factory->>Package: set readme_content_type(readme.content-type)
PoetryCLI->>Package: Read readme_content and readme_content_type for packaging
Package-->>PoetryCLI: Inline README content used directly
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
We failed to fetch pull request #914.
You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.
When readme is specified as inline text in pyproject.toml
(e.g. readme = { text = "some text", content-type = "text/markdown" }),
the text content was incorrectly being joined with the project root path
via `root / readme["text"]`, producing a bogus path instead of using
the text directly.
Fixes python-poetry/poetry#10714
9c5656f to
609c8c8
Compare
There was a problem hiding this comment.
Pull request overview
Fixes handling of PEP 621 inline README text ([project].readme = { text = ..., content-type = ... }) during package creation by treating text as literal content rather than a filesystem path.
Changes:
- Update factory metadata configuration to assign inline README
textdirectly topackage.readme_content. - Add a regression test ensuring inline README text and its declared content type are preserved.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/poetry/core/factory.py |
Stops incorrectly joining inline README text with the project root; stores it as literal content. |
tests/test_factory.py |
Adds a regression test validating inline README text + content-type behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes python-poetry/poetry#10714
When readme is specified as inline text in pyproject.toml, the text was incorrectly joined with the project root path. Changed to use the text value directly.
Added test_create_poetry_inline_readme_text.
Summary by Sourcery
Handle inline README text correctly when creating Poetry packages.
Bug Fixes:
Tests: