Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions components/polylith/sync/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@ def generate_updated_pep_621_project(data: TOMLDocument, bricks_to_add: dict) ->
return tomlkit.dumps(copy)


def generate_updated_pdm_project(data: TOMLDocument, packages: List[dict]) -> str:
bricks_to_add: dict = reduce(to_key_value_include, packages, {})

return generate_updated_pep_621_project(data, bricks_to_add)


def generate_updated_hatch_project(data: TOMLDocument, packages: List[dict]) -> str:
bricks_to_add: dict = reduce(to_key_value_include, packages, {})

def generate_updated_hatch_project(data: TOMLDocument, bricks_to_add: dict) -> str:
has_polylith = data.get("tool", {}).get("polylith", {}).get("bricks")
has_hatch = (
data.get("tool", {}).get("hatch", {}).get("build", {}).get("force-include")
Expand Down Expand Up @@ -91,11 +83,13 @@ def generate_updated_project(
if repo.is_poetry(data):
return generate_updated_poetry_project(data, packages)

bricks_to_add: dict = reduce(to_key_value_include, packages, {})

if repo.is_hatch(data):
return generate_updated_hatch_project(data, packages)
return generate_updated_hatch_project(data, bricks_to_add)

if repo.is_pdm(data):
return generate_updated_pdm_project(data, packages)
if repo.is_pep_621_ready(data):
return generate_updated_pep_621_project(data, bricks_to_add)

return None

Expand Down
2 changes: 1 addition & 1 deletion projects/poetry_polylith_plugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry-polylith-plugin"
version = "1.51.0"
version = "1.51.1"
description = "A Poetry plugin that adds tooling support for the Polylith Architecture"
authors = ["David Vujic"]
homepage = "https://davidvujic.github.io/python-polylith-docs/"
Expand Down
2 changes: 1 addition & 1 deletion projects/polylith_cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "polylith-cli"
version = "1.45.0"
version = "1.45.1"
description = "Python tooling support for the Polylith Architecture"
authors = ['David Vujic']
homepage = "https://davidvujic.github.io/python-polylith-docs/"
Expand Down