From 26f9bef0878d7ac86b762e922606afe0a423f3e9 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 21 Nov 2023 20:11:37 +0000 Subject: [PATCH] Correct hatch build hook --- pyproject.toml | 2 +- scripts/build-frontend.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ea6e73f..64fb3eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ source = "vcs" [tool.hatch.build] artifacts = ["cista/wwwroot"] -hooks.custom.path = "scripts/build-frontend.py" +targets.sdist.hooks.custom.path = "scripts/build-frontend.py" hooks.vcs.version-file = "cista/_version.py" hooks.vcs.template = """ # This file is automatically generated by hatch build. diff --git a/scripts/build-frontend.py b/scripts/build-frontend.py index 7f94070..85e52b2 100644 --- a/scripts/build-frontend.py +++ b/scripts/build-frontend.py @@ -10,9 +10,6 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface class CustomBuildHook(BuildHookInterface): def initialize(self, version, build_data): super().initialize(version, build_data) - # A hack to stop building twice on run - if not build_data.get("force_include"): - return stderr.write(">>> Building Cista frontend\n") npm = shutil.which("npm") if npm is None: