Correct hatch build hook

This commit is contained in:
Leo Vasanko 2023-11-21 20:11:37 +00:00
parent 634dabe52d
commit 26f9bef087
2 changed files with 1 additions and 4 deletions

View File

@ -49,7 +49,7 @@ source = "vcs"
[tool.hatch.build] [tool.hatch.build]
artifacts = ["cista/wwwroot"] 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.version-file = "cista/_version.py"
hooks.vcs.template = """ hooks.vcs.template = """
# This file is automatically generated by hatch build. # This file is automatically generated by hatch build.

View File

@ -10,9 +10,6 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
class CustomBuildHook(BuildHookInterface): class CustomBuildHook(BuildHookInterface):
def initialize(self, version, build_data): def initialize(self, version, build_data):
super().initialize(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") stderr.write(">>> Building Cista frontend\n")
npm = shutil.which("npm") npm = shutil.which("npm")
if npm is None: if npm is None: