Commit 3ee8584c by Stephan Spindler Committed by GitHub

Allow any file extension for README file (#5357)

Co-authored-by: Bjorn Neergaard <bjorn@neersighted.com>
parent 27034d61
......@@ -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
......
......@@ -41,8 +41,6 @@ BUILD_SYSTEM_MAX_VERSION: str | None = None
class Layout:
ACCEPTED_README_FORMATS = {"md", "rst"}
def __init__(
self,
project: str,
......@@ -64,12 +62,6 @@ class Layout:
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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment