From 7035ef97b59d2510f055606c347d36eb59b67e61 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_go/plugin.py | 2 +- hatch_go/tests/test_hook_registration.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hatch_go/tests/test_hook_registration.py diff --git a/hatch_go/plugin.py b/hatch_go/plugin.py index 322c57d..78af240 100644 --- a/hatch_go/plugin.py +++ b/hatch_go/plugin.py @@ -17,7 +17,7 @@ log = getLogger(__name__) -class HatchGoBuildHook(BuildHookInterface[HatchGoBuildConfig]): +class HatchGoBuildHook(BuildHookInterface): """The hatch-go build hook.""" PLUGIN_NAME = "hatch-go" diff --git a/hatch_go/tests/test_hook_registration.py b/hatch_go/tests/test_hook_registration.py new file mode 100644 index 0000000..7d4be68 --- /dev/null +++ b/hatch_go/tests/test_hook_registration.py @@ -0,0 +1,21 @@ +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + +from hatch_go.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-go" + assert hook.config is config + assert hook.target_name == "wheel" From 5dd28bc44bf287a1ae005e3b4b8ba5253ad4c632 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 5307532..97aed51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "hatchling", + "hatchling!=1.32.1", ] build-backend = "hatchling.build" @@ -36,7 +36,7 @@ classifiers = [ ] dependencies = [ - "hatchling>=1.20", + "hatchling>=1.20,!=1.32.1", "pydantic", ] @@ -46,7 +46,7 @@ develop = [ "bump-my-version", "check-manifest", "codespell>=2.4,<2.5", - "hatchling", + "hatchling!=1.32.1", "mdformat>=0.7.22,<1.1", "mdformat-tables>=1", "pytest",