Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/poetry/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _configure_package_metadata(
package.readmes = (root / readme["file"],)
package.readme_content_type = readme["content-type"]
elif "text" in readme:
package.readme_content = root / readme["text"]
package.readme_content = readme["text"]
package.readme_content_type = readme["content-type"]
elif custom_readme := tool_poetry.get("readme"):
custom_readmes = (
Expand Down
13 changes: 13 additions & 0 deletions tests/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,19 @@ def test_create_poetry_classifiers(
assert poetry.package.all_classifiers == expected


def test_create_poetry_inline_readme_text(tmp_path: Path) -> None:
pyproject = tmp_path / "pyproject.toml"
pyproject.write_text(
'[project]\nname="foo"\nversion="1"\ndescription = ""\n'
'readme = { text = "some text", content-type = "text/markdown" }\n',
encoding="utf-8",
)
poetry = Factory().create_poetry(tmp_path)

assert poetry.package.readme_content == "some text"
assert poetry.package.readme_content_type == "text/markdown"


def test_create_poetry_no_readme(tmp_path: Path) -> None:
pyproject = tmp_path / "pyproject.toml"
pyproject.write_text(
Expand Down