Skip to content

Commit ae7fcab

Browse files
Forward compatibility for multiple readme files
This makes poetry aware about the upcoming changes in poetry-core in order to support declaration of multiple readme files in pyproject.toml Relates python-poetry#873 Enable python-poetry/poetry-core#248
1 parent 25cc6a1 commit ae7fcab

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/poetry/json/schemas/poetry-schema.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,19 @@
5454
"$ref": "#/definitions/maintainers"
5555
},
5656
"readme": {
57-
"type": "string",
58-
"description": "The path to the README file"
57+
"anyOf": [
58+
{
59+
"type": "string",
60+
"description": "The path to the README file."
61+
},
62+
{
63+
"type": "array",
64+
"description": "A list of paths to the readme files.",
65+
"items": {
66+
"type": "string"
67+
}
68+
}
69+
]
5970
},
6071
"classifiers": {
6172
"type": "array",

tests/test_factory.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ def test_create_poetry():
2525
poetry = Factory().create_poetry(fixtures_dir / "sample_project")
2626

2727
package = poetry.package
28+
if hasattr(package, "readmes"):
29+
single_readme = package.readmes[0]
30+
else:
31+
single_readme = package.readme
2832

2933
assert package.name == "my-package"
3034
assert package.version.text == "1.2.3"
3135
assert package.description == "Some description."
3236
assert package.authors == ["Sébastien Eustace <[email protected]>"]
3337
assert package.license.id == "MIT"
3438
assert (
35-
package.readme.relative_to(fixtures_dir).as_posix()
39+
single_readme.relative_to(fixtures_dir).as_posix()
3640
== "sample_project/README.rst"
3741
)
3842
assert package.homepage == "https://python-poetry.org"

0 commit comments

Comments
 (0)