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