From 090cdd0fdb170495375a3a7fd6e4805ac50aa4e4 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:48:38 -0500 Subject: [PATCH 1/2] Form wheel name --- hatch_cpp/plugin.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hatch_cpp/plugin.py b/hatch_cpp/plugin.py index 469ee39..7fcbfbf 100644 --- a/hatch_cpp/plugin.py +++ b/hatch_cpp/plugin.py @@ -2,6 +2,8 @@ import logging import os +import platform as sysplatform +import sys import typing as t from hatchling.builders.hooks.plugin.interface import BuildHookInterface @@ -18,7 +20,7 @@ class HatchCppBuildHook(BuildHookInterface[HatchCppBuildConfig]): PLUGIN_NAME = "hatch-cpp" _logger = logging.getLogger(__name__) - def initialize(self, version: str, _: dict[str, t.Any]) -> None: + def initialize(self, version: str, build_data: dict[str, t.Any]) -> None: """Initialize the plugin.""" # Log some basic information self._logger.info("Initializing hatch-cpp plugin version %s", version) @@ -30,6 +32,19 @@ def initialize(self, version: str, _: dict[str, t.Any]) -> None: self._logger.info("ignoring target name %s", self.target_name) return + build_data["pure_python"] = False + machine = sysplatform.machine() + version_major = sys.version_info.major + version_minor = sys.version_info.minor + # TODO abi3 + if "darwin" in sys.platform: + os_name = "macosx_11_0" + elif "linux" in sys.platform: + os_name = "linux" + else: + os_name = "win" + build_data["tag"] = f"cp{version_major}{version_minor}-cp{version_major}{version_minor}-{os_name}_{machine}" + # Skip if SKIP_HATCH_CPP is set # TODO: Support CLI once https://github.com/pypa/hatch/pull/1743 if os.getenv("SKIP_HATCH_CPP"): From 3173bb89b644a40b33185f8fd550fe980264e629 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:53:05 -0500 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20version:=200.1.2=20=E2=86=92=200.1.3?= 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 4007071..6ec6cb1 100644 --- a/hatch_cpp/__init__.py +++ b/hatch_cpp/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.1.2" +__version__ = "0.1.3" from .hooks import hatch_register_build_hook from .plugin import HatchCppBuildHook diff --git a/pyproject.toml b/pyproject.toml index 34a0153..a49115b 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.2" +version = "0.1.3" 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.2" +current_version = "0.1.3" commit = true tag = false