hatch-cpp 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hatch_cpp/__init__.py +1 -1
- hatch_cpp/plugin.py +24 -1
- {hatch_cpp-0.1.2.dist-info → hatch_cpp-0.1.4.dist-info}/METADATA +1 -1
- {hatch_cpp-0.1.2.dist-info → hatch_cpp-0.1.4.dist-info}/RECORD +7 -7
- {hatch_cpp-0.1.2.dist-info → hatch_cpp-0.1.4.dist-info}/WHEEL +0 -0
- {hatch_cpp-0.1.2.dist-info → hatch_cpp-0.1.4.dist-info}/entry_points.txt +0 -0
- {hatch_cpp-0.1.2.dist-info → hatch_cpp-0.1.4.dist-info}/licenses/LICENSE +0 -0
hatch_cpp/__init__.py
CHANGED
hatch_cpp/plugin.py
CHANGED
|
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
+
import platform as sysplatform
|
|
6
|
+
import sys
|
|
5
7
|
import typing as t
|
|
6
8
|
|
|
7
9
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
@@ -18,7 +20,7 @@ class HatchCppBuildHook(BuildHookInterface[HatchCppBuildConfig]):
|
|
|
18
20
|
PLUGIN_NAME = "hatch-cpp"
|
|
19
21
|
_logger = logging.getLogger(__name__)
|
|
20
22
|
|
|
21
|
-
def initialize(self, version: str,
|
|
23
|
+
def initialize(self, version: str, build_data: dict[str, t.Any]) -> None:
|
|
22
24
|
"""Initialize the plugin."""
|
|
23
25
|
# Log some basic information
|
|
24
26
|
self._logger.info("Initializing hatch-cpp plugin version %s", version)
|
|
@@ -30,6 +32,19 @@ class HatchCppBuildHook(BuildHookInterface[HatchCppBuildConfig]):
|
|
|
30
32
|
self._logger.info("ignoring target name %s", self.target_name)
|
|
31
33
|
return
|
|
32
34
|
|
|
35
|
+
build_data["pure_python"] = False
|
|
36
|
+
machine = sysplatform.machine()
|
|
37
|
+
version_major = sys.version_info.major
|
|
38
|
+
version_minor = sys.version_info.minor
|
|
39
|
+
# TODO abi3
|
|
40
|
+
if "darwin" in sys.platform:
|
|
41
|
+
os_name = "macosx_11_0"
|
|
42
|
+
elif "linux" in sys.platform:
|
|
43
|
+
os_name = "linux"
|
|
44
|
+
else:
|
|
45
|
+
os_name = "win"
|
|
46
|
+
build_data["tag"] = f"cp{version_major}{version_minor}-cp{version_major}{version_minor}-{os_name}_{machine}"
|
|
47
|
+
|
|
33
48
|
# Skip if SKIP_HATCH_CPP is set
|
|
34
49
|
# TODO: Support CLI once https://github.com/pypa/hatch/pull/1743
|
|
35
50
|
if os.getenv("SKIP_HATCH_CPP"):
|
|
@@ -65,3 +80,11 @@ class HatchCppBuildHook(BuildHookInterface[HatchCppBuildConfig]):
|
|
|
65
80
|
|
|
66
81
|
# Perform any cleanup actions
|
|
67
82
|
build_plan.cleanup()
|
|
83
|
+
|
|
84
|
+
# force include libraries
|
|
85
|
+
for library in libraries:
|
|
86
|
+
if build_plan.platform.platform == "win32":
|
|
87
|
+
suffix = "dll"
|
|
88
|
+
else:
|
|
89
|
+
suffix = "so"
|
|
90
|
+
build_data["force_include"][f"{library.name}.{suffix}"] = f"{library.name}.{suffix}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hatch-cpp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Hatch plugin for C++ builds
|
|
5
5
|
Project-URL: Repository, https://github.com/python-project-templates/hatch-cpp
|
|
6
6
|
Project-URL: Homepage, https://github.com/python-project-templates/hatch-cpp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
hatch_cpp/__init__.py,sha256=
|
|
1
|
+
hatch_cpp/__init__.py,sha256=2Kua5noGk43pVa4A0cQkjrIoU4jNodNXO8_WMGRokfA,129
|
|
2
2
|
hatch_cpp/hooks.py,sha256=SQkF5WJIgzw-8rvlTzuQvBqdP6K3fHgnh6CZOZFag50,203
|
|
3
|
-
hatch_cpp/plugin.py,sha256=
|
|
3
|
+
hatch_cpp/plugin.py,sha256=dFKo6NKVa-fBXhz2nGB_vFDMvCGKtHn5GeFyCXX9vAo,3089
|
|
4
4
|
hatch_cpp/structs.py,sha256=haFLBwb3T1YOC-ZjsbPB_X2Hv8whp4WMu3MrAIMdLkg,8857
|
|
5
5
|
hatch_cpp/utils.py,sha256=topOiT6biVzisNAEKHvYzU-JdA56B3LA61jbU9fjAEQ,4444
|
|
6
6
|
hatch_cpp/tests/test_all.py,sha256=zxMSmbNDdS_pIhjBR9IQfnJLtehCmbHqJXWC40Y8TXg,28
|
|
@@ -23,8 +23,8 @@ hatch_cpp/tests/test_project_pybind/cpp/project/basic.hpp,sha256=LZSfCfhLY_91MBO
|
|
|
23
23
|
hatch_cpp/tests/test_project_pybind/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
hatch_cpp/toolchains/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
hatch_cpp/toolchains/cmake.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
hatch_cpp-0.1.
|
|
27
|
-
hatch_cpp-0.1.
|
|
28
|
-
hatch_cpp-0.1.
|
|
29
|
-
hatch_cpp-0.1.
|
|
30
|
-
hatch_cpp-0.1.
|
|
26
|
+
hatch_cpp-0.1.4.dist-info/METADATA,sha256=prtX86SG1y3FlNtGsgoHQxcopKpiML02jRbsjY3qepw,3003
|
|
27
|
+
hatch_cpp-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
28
|
+
hatch_cpp-0.1.4.dist-info/entry_points.txt,sha256=RgXfjpD4iwomJQK5n7FnPkXzb5fOnF5v3DI5hbkgVcw,30
|
|
29
|
+
hatch_cpp-0.1.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
30
|
+
hatch_cpp-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|