From 37685703a52fbd1d72ce1e449f84a40168ef4f12 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_rs/plugin.py | 2 +- hatch_rs/tests/test_hook_registration.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hatch_rs/tests/test_hook_registration.py diff --git a/hatch_rs/plugin.py b/hatch_rs/plugin.py index 4aa1e32..8b0a0bb 100644 --- a/hatch_rs/plugin.py +++ b/hatch_rs/plugin.py @@ -12,7 +12,7 @@ __all__ = ("HatchRustBuildHook",) -class HatchRustBuildHook(BuildHookInterface[HatchRustBuildConfig]): +class HatchRustBuildHook(BuildHookInterface): """The hatch-rust build hook.""" PLUGIN_NAME = "hatch-rs" diff --git a/hatch_rs/tests/test_hook_registration.py b/hatch_rs/tests/test_hook_registration.py new file mode 100644 index 0000000..29585a0 --- /dev/null +++ b/hatch_rs/tests/test_hook_registration.py @@ -0,0 +1,21 @@ +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + +from hatch_rs.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-rs" + assert hook.config is config + assert hook.target_name == "wheel" From e1c4431dbfc31e71501f0872320a7ab23593f7fd 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 dd1eda8..28bae1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "hatchling", + "hatchling!=1.32.1", ] build-backend = "hatchling.build" @@ -34,7 +34,7 @@ classifiers = [ ] dependencies = [ - "hatchling>=1.20", + "hatchling>=1.20,!=1.32.1", "packaging", "pydantic", ] @@ -46,7 +46,7 @@ develop = [ "check-dist", "codespell", "editables", - "hatchling", + "hatchling!=1.32.1", "mdformat", "mdformat-tables>=1", "pip",