From d835402e9b424d4df6773ab12537aa90ecccac0e Mon Sep 17 00:00:00 2001 From: David Vujic Date: Tue, 30 Jan 2024 18:47:29 +0100 Subject: [PATCH] fix(hatch): the project toml template (#164) * fix(hatch): the project toml template need to include the build hook table to be activated * bump Plugin version to 1.14.8 * bump CLI version to 1.1.1 --- components/polylith/project/templates.py | 2 ++ projects/poetry_polylith_plugin/pyproject.toml | 2 +- projects/polylith_cli/pyproject.toml | 2 +- test/components/polylith/project/test_templates.py | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/polylith/project/templates.py b/components/polylith/project/templates.py index 5e37d90b..ae03eec7 100644 --- a/components/polylith/project/templates.py +++ b/components/polylith/project/templates.py @@ -31,6 +31,8 @@ dependencies = [] +[tool.hatch.build.hooks.polylith-bricks] + [tool.polylith.bricks] """ diff --git a/projects/poetry_polylith_plugin/pyproject.toml b/projects/poetry_polylith_plugin/pyproject.toml index 68309e3e..0cc35cd0 100644 --- a/projects/poetry_polylith_plugin/pyproject.toml +++ b/projects/poetry_polylith_plugin/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry-polylith-plugin" -version = "1.14.7" +version = "1.14.8" description = "A Poetry plugin that adds tooling support for the Polylith Architecture" authors = ["David Vujic"] homepage = "https://davidvujic.github.io/python-polylith-docs/" diff --git a/projects/polylith_cli/pyproject.toml b/projects/polylith_cli/pyproject.toml index 474a14eb..11f67156 100644 --- a/projects/polylith_cli/pyproject.toml +++ b/projects/polylith_cli/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polylith-cli" -version = "1.1.0" +version = "1.1.1" description = "Python tooling support for the Polylith Architecture" authors = ['David Vujic'] homepage = "https://davidvujic.github.io/python-polylith-docs/" diff --git a/test/components/polylith/project/test_templates.py b/test/components/polylith/project/test_templates.py index 9184b2a3..7984e0f4 100644 --- a/test/components/polylith/project/test_templates.py +++ b/test/components/polylith/project/test_templates.py @@ -19,10 +19,13 @@ def test_poetry_template(): def test_hatch_template(): data = tomlkit.loads(templates.hatch_pyproject.format(**template_data)) + assert "hatch-polylith-bricks" in data["build-system"]["requires"] + assert data["tool"]["hatch"]["build"]["hooks"]["polylith-bricks"] == {} assert data["tool"]["polylith"]["bricks"] == {} def test_pdm_template(): data = tomlkit.loads(templates.pdm_pyproject.format(**template_data)) + assert "pdm-polylith-bricks" in data["build-system"]["requires"] assert data["tool"]["polylith"]["bricks"] == {}