From 7ab98620ec5e6a3de6176d59044b83d116fd3b52 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 12 Jan 2025 23:08:38 -0500 Subject: [PATCH 1/3] Fix library qualified name on windows --- hatch_cpp/plugin.py | 7 ++----- hatch_cpp/structs.py | 9 +++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hatch_cpp/plugin.py b/hatch_cpp/plugin.py index 4166551..2e29539 100644 --- a/hatch_cpp/plugin.py +++ b/hatch_cpp/plugin.py @@ -83,8 +83,5 @@ def initialize(self, version: str, build_data: dict[str, t.Any]) -> None: # force include libraries for library in libraries: - if build_plan.platform.platform == "win32": - suffix = "dll" - else: - suffix = "so" - build_data["force_include"][f"{library.name}.{suffix}"] = f"{library.name}.{suffix}" + name = library.get_qualified_name(build_plan.platform.platform) + build_data["force_include"][name] = name diff --git a/hatch_cpp/structs.py b/hatch_cpp/structs.py index 26f846d..1492720 100644 --- a/hatch_cpp/structs.py +++ b/hatch_cpp/structs.py @@ -52,6 +52,15 @@ class HatchCppLibrary(BaseModel): export_symbols: List[str] = Field(default_factory=list, alias="export-symbols") depends: List[str] = Field(default_factory=list) + def get_qualified_name(self, platform): + if platform == "win32": + suffix = "dll" if self.binding == "none" else "pyd" + elif platform == "darwin" and self.binding == "none": + suffix = "dylib" + else: + suffix = "so" + return f"{self.name}.{suffix}" + class HatchCppPlatform(BaseModel): cc: str From 6a54762309860cdcbfb2cbbdbcc07c7071bcf4bd Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 12 Jan 2025 23:12:23 -0500 Subject: [PATCH 2/3] =?UTF-8?q?Bump=20version:=200.1.4=20=E2=86=92=200.1.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hatch_cpp/__init__.py | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hatch_cpp/__init__.py b/hatch_cpp/__init__.py index 7b0b672..02e0ebb 100644 --- a/hatch_cpp/__init__.py +++ b/hatch_cpp/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.1.4" +__version__ = "0.1.5" from .hooks import hatch_register_build_hook from .plugin import HatchCppBuildHook diff --git a/pyproject.toml b/pyproject.toml index 4e90653..9b3ca91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ authors = [{name = "the hatch-cpp authors", email = "t.paine154@gmail.com"}] description = "Hatch plugin for C++ builds" readme = "README.md" license = { text = "Apache-2.0" } -version = "0.1.4" +version = "0.1.5" requires-python = ">=3.9" keywords = [ "hatch", @@ -62,7 +62,7 @@ Repository = "https://github.com/python-project-templates/hatch-cpp" Homepage = "https://github.com/python-project-templates/hatch-cpp" [tool.bumpversion] -current_version = "0.1.4" +current_version = "0.1.5" commit = true tag = false From 14525ea805cfc17a5e212d29f28cea7c0a8dd939 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 12 Jan 2025 23:13:03 -0500 Subject: [PATCH 3/3] Remove double build during dist --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1473fb6..f1ad97c 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ dist-build: # build python dists dist-check: ## run python dist checker with twine python -m twine check dist/* -dist: clean build dist-build dist-check ## build all dists +dist: clean dist-build dist-check ## build all dists publish: dist # publish python assets