From bff26a5a902acccf6ae854f4b846613bb6c68b10 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:13:13 -0500 Subject: [PATCH] raise on subprocess error --- hatch_js/plugin.py | 46 --------------------------------------------- hatch_js/structs.py | 4 +++- 2 files changed, 3 insertions(+), 47 deletions(-) diff --git a/hatch_js/plugin.py b/hatch_js/plugin.py index a12dbca..263a42f 100644 --- a/hatch_js/plugin.py +++ b/hatch_js/plugin.py @@ -62,49 +62,3 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None: # Perform any cleanup actions build_plan.cleanup() - - # if build_plan.libraries: - # # force include libraries - # for library in build_plan.libraries: - # name = library.get_qualified_name(build_plan.platform.platform) - # build_data["force_include"][name] = name - - # build_data["pure_python"] = False - # machine = platform_machine() - # version_major = version_info.major - # version_minor = version_info.minor - # if "darwin" in sys_platform: - # os_name = "macosx_11_0" - # elif "linux" in sys_platform: - # os_name = "linux" - # else: - # os_name = "win" - # if all([lib.py_limited_api for lib in build_plan.libraries]): - # build_data["tag"] = f"cp{version_major}{version_minor}-abi3-{os_name}_{machine}" - # else: - # build_data["tag"] = f"cp{version_major}{version_minor}-cp{version_major}{version_minor}-{os_name}_{machine}" - # else: - # build_data["pure_python"] = False - # machine = platform_machine() - # version_major = version_info.major - # version_minor = version_info.minor - # # TODO abi3 - # if "darwin" in sys_platform: - # os_name = "macosx_11_0" - # elif "linux" in sys_platform: - # os_name = "linux" - # else: - # os_name = "win" - # build_data["tag"] = f"cp{version_major}{version_minor}-cp{version_major}{version_minor}-{os_name}_{machine}" - - # # force include libraries - # for path in Path(".").rglob("*"): - # if path.is_dir(): - # continue - # if str(path).startswith(str(build_plan.cmake.build)) or str(path).startswith("dist"): - # continue - # if path.suffix in (".pyd", ".dll", ".so", ".dylib"): - # build_data["force_include"][str(path)] = str(path) - - # for path in build_data["force_include"]: - # self._logger.warning(f"Force include: {path}") diff --git a/hatch_js/structs.py b/hatch_js/structs.py index 19c1029..faa0139 100644 --- a/hatch_js/structs.py +++ b/hatch_js/structs.py @@ -88,7 +88,9 @@ def execute(self): chdir(self.path) for command in self.commands: - system_call(command) + ret = system_call(command) + if ret != 0: + raise RuntimeError(f"hatch-js build command failed with exit code {ret}: {command}") # Check that all targets exist # Go back to original path