diff --git a/hatch_cpp/plugin.py b/hatch_cpp/plugin.py index a0480a9..3e4f3c4 100644 --- a/hatch_cpp/plugin.py +++ b/hatch_cpp/plugin.py @@ -34,7 +34,7 @@ def _wheel_tag(platform: str, machine: str, version_major: int, version_minor: i return f"cp{version_major}{version_minor}-{abi}-{os_name}_{machine}" -class HatchCppBuildHook(BuildHookInterface[HatchCppBuildConfig]): +class HatchCppBuildHook(BuildHookInterface): """The hatch-cpp build hook.""" PLUGIN_NAME = "hatch-cpp" diff --git a/hatch_cpp/tests/test_hook_registration.py b/hatch_cpp/tests/test_hook_registration.py new file mode 100644 index 0000000..75dd412 --- /dev/null +++ b/hatch_cpp/tests/test_hook_registration.py @@ -0,0 +1,21 @@ +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + +from hatch_cpp.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-cpp" + assert hook.config is config + assert hook.target_name == "wheel" diff --git a/pyproject.toml b/pyproject.toml index 8b3d2c8..b832b94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "hatchling", + "hatchling!=1.32.1", ] build-backend = "hatchling.build" @@ -37,7 +37,7 @@ classifiers = [ ] dependencies = [ - "hatchling", + "hatchling!=1.32.1", "hatch-build>=0.5,<0.6", "pkn", "pydantic", @@ -49,7 +49,7 @@ develop = [ "bump-my-version", "check-dist", "codespell", - "hatchling", + "hatchling!=1.32.1", "hatch-build>=0.3.2", "mdformat", "mdformat-tables>=1",