Skip to content

Commit 00105f1

Browse files
authored
fix: PEP-621 template (#157)
* fix(create project): authors should be treated as a string when fetching and populating template. * fix(create project): hatch template, missing bracket * bump hatch build hook to 1.0.1 * bump poetry plugin to 1.14.6 * bump cli to 1.0.1
1 parent 786f173 commit 00105f1

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

components/polylith/project/templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"""
1818

1919
hatch_pyproject = """\
20-
build-system]
20+
[build-system]
2121
requires = ["hatchling"]
2222
build-backend = "hatchling.build"
2323

components/polylith/repo/get.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def get_metadata_section(data: dict) -> dict:
1515
return data["project"] if is_pep_621_ready(data) else data["tool"]["poetry"]
1616

1717

18-
def get_authors(path: Path) -> list:
18+
def get_authors(path: Path) -> str:
1919
data = get_pyproject_data(path)
2020
section = get_metadata_section(data)
2121

22-
return section.get("authors", [])
22+
return section.get("authors", []).as_string()
2323

2424

2525
def get_python_version(path: Path) -> str:

projects/hatch_polylith_bricks/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "hatch-polylith-bricks"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Hatch build hook plugin for Polylith"
55
authors = ['David Vujic']
66
homepage = "https://davidvujic.github.io/python-polylith-docs/"

projects/poetry_polylith_plugin/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "poetry-polylith-plugin"
3-
version = "1.14.5"
3+
version = "1.14.6"
44
description = "A Poetry plugin that adds tooling support for the Polylith Architecture"
55
authors = ["David Vujic"]
66
homepage = "https://davidvujic.github.io/python-polylith-docs/"

projects/polylith_cli/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "polylith-cli"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Python tooling support for the Polylith Architecture"
55
authors = ['David Vujic']
66
homepage = "https://davidvujic.github.io/python-polylith-docs/"

test/components/polylith/repo/test_repo_get.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_get_metadata_section():
4848

4949

5050
def test_get_authors_for_poetry_toml(monkeypatch):
51-
expected = ["Unit Test"]
51+
expected = '["Unit Test"]'
5252
data = poetry_toml.format(authors=expected)
5353

5454
monkeypatch.setattr(repo.get, "get_pyproject_data", lambda _: tomlkit.loads(data))
@@ -62,7 +62,7 @@ def test_get_authors_for_pep_621_compliant_toml(monkeypatch):
6262

6363
monkeypatch.setattr(repo.get, "get_pyproject_data", lambda _: tomlkit.loads(data))
6464

65-
assert repo.get.get_authors(path) == [{"name": "Unit Test", "email": "the-email"}]
65+
assert repo.get.get_authors(path) == authors
6666

6767

6868
def test_get_python_version_for_poetry_toml(monkeypatch):

0 commit comments

Comments
 (0)