Skip to content

Commit 8f77e2e

Browse files
authored
Fix poly sync for PEP 621 build backends that isn't hatchling or pdm (#438)
* fix(poly sync): update pypackage.toml for PEP 621 project format when using a build backend that isn't hatchling or pdm * bump Poetry plugin to 1.51.1 * bump CLI to 1.45.1
1 parent 3e1d256 commit 8f77e2e

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

components/polylith/sync/update.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,7 @@ def generate_updated_pep_621_project(data: TOMLDocument, bricks_to_add: dict) ->
4646
return tomlkit.dumps(copy)
4747

4848

49-
def generate_updated_pdm_project(data: TOMLDocument, packages: List[dict]) -> str:
50-
bricks_to_add: dict = reduce(to_key_value_include, packages, {})
51-
52-
return generate_updated_pep_621_project(data, bricks_to_add)
53-
54-
55-
def generate_updated_hatch_project(data: TOMLDocument, packages: List[dict]) -> str:
56-
bricks_to_add: dict = reduce(to_key_value_include, packages, {})
57-
49+
def generate_updated_hatch_project(data: TOMLDocument, bricks_to_add: dict) -> str:
5850
has_polylith = data.get("tool", {}).get("polylith", {}).get("bricks")
5951
has_hatch = (
6052
data.get("tool", {}).get("hatch", {}).get("build", {}).get("force-include")
@@ -91,11 +83,13 @@ def generate_updated_project(
9183
if repo.is_poetry(data):
9284
return generate_updated_poetry_project(data, packages)
9385

86+
bricks_to_add: dict = reduce(to_key_value_include, packages, {})
87+
9488
if repo.is_hatch(data):
95-
return generate_updated_hatch_project(data, packages)
89+
return generate_updated_hatch_project(data, bricks_to_add)
9690

97-
if repo.is_pdm(data):
98-
return generate_updated_pdm_project(data, packages)
91+
if repo.is_pep_621_ready(data):
92+
return generate_updated_pep_621_project(data, bricks_to_add)
9993

10094
return None
10195

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.51.0"
3+
version = "1.51.1"
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.45.0"
3+
version = "1.45.1"
44
description = "Python tooling support for the Polylith Architecture"
55
authors = ['David Vujic']
66
homepage = "https://davidvujic.github.io/python-polylith-docs/"

0 commit comments

Comments
 (0)