FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix build hook compatibility with Hatchling 1.32.1 by timkpaine · Pull Request #132 · python-project-templates/hatch-cpp · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .toml  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion hatch_cpp/plugin.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions hatch_cpp/tests/test_hook_registration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 3 additions & 3 deletions pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"hatchling",
"hatchling!=1.32.1",
]
build-backend = "hatchling.build"

Expand Down Expand Up @@ -37,7 +37,7 @@ classifiers = [
]

dependencies = [
"hatchling",
"hatchling!=1.32.1",
"hatch-build>=0.5,<0.6",
"pkn",
"pydantic",
Expand All @@ -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",
Expand Down

Back | FazBrowse Home | New Git URL