diff --git a/docs/cli.md b/docs/cli.md index d95615a21d6..11de33fa6db 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -103,7 +103,9 @@ my-package * `--name`: Set the resulting package name. * `--src`: Use the src layout for the project. -* `--readme`: Specify the readme file format. One of `md` (default) or `rst`. +* `--readme`: Specify the readme file extension. Default is `md`. If you intend to publish to PyPI + keep the [recommendations for a PyPI-friendly README](https://packaging.python.org/en/latest/guides/making-a-pypi-friendly-readme/) + in mind. ## init diff --git a/src/poetry/layouts/layout.py b/src/poetry/layouts/layout.py index 5877101806b..6bb073c47d9 100644 --- a/src/poetry/layouts/layout.py +++ b/src/poetry/layouts/layout.py @@ -41,8 +41,6 @@ class Layout: - ACCEPTED_README_FORMATS = {"md", "rst"} - def __init__( self, project: str, @@ -64,12 +62,6 @@ def __init__( self._description = description self._readme_format = readme_format.lower() - if self._readme_format not in self.ACCEPTED_README_FORMATS: - accepted_readme_formats = ", ".join(self.ACCEPTED_README_FORMATS) - raise ValueError( - f"Invalid readme format '{readme_format}', use one of" - f" {accepted_readme_formats}." - ) self._license = license self._python = python diff --git a/tests/console/commands/test_new.py b/tests/console/commands/test_new.py index 7af8d6f0db7..79f09e20f27 100644 --- a/tests/console/commands/test_new.py +++ b/tests/console/commands/test_new.py @@ -157,7 +157,7 @@ def test_command_new( verify_project_directory(path, package_name, package_path, include_from) -@pytest.mark.parametrize(("fmt",), [(None,), ("md",), ("rst",)]) +@pytest.mark.parametrize(("fmt",), [(None,), ("md",), ("rst",), ("adoc",), ("creole",)]) def test_command_new_with_readme(fmt: str | None, tester: CommandTester, tmp_dir: str): package = "package" path = Path(tmp_dir) / package