From 6af3ee6ce887df204d3babeb238c294465ddee4f Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:53:02 -0400 Subject: [PATCH 1/2] Fix build hook compatibility with Hatchling 1.32.1 Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- hatch_js/plugin.py | 2 +- hatch_js/tests/test_hook_registration.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hatch_js/tests/test_hook_registration.py diff --git a/hatch_js/plugin.py b/hatch_js/plugin.py index 263a42f..67a6657 100644 --- a/hatch_js/plugin.py +++ b/hatch_js/plugin.py @@ -12,7 +12,7 @@ __all__ = ("HatchJsBuildHook",) -class HatchJsBuildHook(BuildHookInterface[HatchJsBuildConfig]): +class HatchJsBuildHook(BuildHookInterface): """The hatch-js build hook.""" PLUGIN_NAME = "hatch-js" diff --git a/hatch_js/tests/test_hook_registration.py b/hatch_js/tests/test_hook_registration.py new file mode 100644 index 0000000..7b463c2 --- /dev/null +++ b/hatch_js/tests/test_hook_registration.py @@ -0,0 +1,21 @@ +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + +from hatch_js.hooks import hatch_register_build_hook + + +def test_registered_build_hook_accepts_hatchling_configuration(tmp_path): + hook_class = hatch_register_build_hook() + config = {} + hook = hook_class( + root=str(tmp_path), + config=config, + build_config=None, + metadata=None, + directory=str(tmp_path), + target_name="wheel", + ) + + assert isinstance(hook, BuildHookInterface) + assert hook.PLUGIN_NAME == "hatch-js" + assert hook.config is config + assert hook.target_name == "wheel" From 149096dd341ea3c9f9ce3612df3f39114e7b674f Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:58:03 -0400 Subject: [PATCH 2/2] Exclude Hatchling release with undeclared Hatch dependency Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1583e3b..f49eb70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "hatchling", + "hatchling!=1.32.1", ] build-backend = "hatchling.build" @@ -38,7 +38,7 @@ classifiers = [ ] dependencies = [ - "hatchling>=1.20", + "hatchling>=1.20,!=1.32.1", "pydantic", ] @@ -48,7 +48,7 @@ develop = [ "bump-my-version", "check-dist", "codespell", - "hatchling", + "hatchling!=1.32.1", "mdformat", "mdformat-tables>=1", "pytest",