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" 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",