hatch-cpp 0.1.2__tar.gz → 0.1.4__tar.gz

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.
Files changed (30) hide show
  1. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/PKG-INFO +1 -1
  2. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/__init__.py +1 -1
  3. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/plugin.py +24 -1
  4. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/pyproject.toml +2 -2
  5. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/.gitignore +0 -0
  6. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/LICENSE +0 -0
  7. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/README.md +0 -0
  8. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/hooks.py +0 -0
  9. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/structs.py +0 -0
  10. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_all.py +0 -0
  11. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_basic/cpp/project/basic.cpp +0 -0
  12. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_basic/cpp/project/basic.hpp +0 -0
  13. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_basic/project/__init__.py +0 -0
  14. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_basic/pyproject.toml +0 -0
  15. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_nanobind/cpp/project/basic.cpp +0 -0
  16. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_nanobind/cpp/project/basic.hpp +0 -0
  17. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_nanobind/project/__init__.py +0 -0
  18. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_nanobind/pyproject.toml +0 -0
  19. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_override_classes/cpp/project/basic.cpp +0 -0
  20. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_override_classes/cpp/project/basic.hpp +0 -0
  21. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_override_classes/project/__init__.py +0 -0
  22. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_override_classes/pyproject.toml +0 -0
  23. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_pybind/cpp/project/basic.cpp +0 -0
  24. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_pybind/cpp/project/basic.hpp +0 -0
  25. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_pybind/project/__init__.py +0 -0
  26. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_project_pybind/pyproject.toml +0 -0
  27. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/tests/test_projects.py +0 -0
  28. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/toolchains/__init__.py +0 -0
  29. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/toolchains/cmake.py +0 -0
  30. {hatch_cpp-0.1.2 → hatch_cpp-0.1.4}/hatch_cpp/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hatch-cpp
3
- Version: 0.1.2
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,4 +1,4 @@
1
- __version__ = "0.1.2"
1
+ __version__ = "0.1.4"
2
2
 
3
3
  from .hooks import hatch_register_build_hook
4
4
  from .plugin import HatchCppBuildHook
@@ -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, _: dict[str, t.Any]) -> None:
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}"
@@ -8,7 +8,7 @@ authors = [{name = "the hatch-cpp authors", email = "t.paine154@gmail.com"}]
8
8
  description = "Hatch plugin for C++ builds"
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
11
- version = "0.1.2"
11
+ version = "0.1.4"
12
12
  requires-python = ">=3.9"
13
13
  keywords = [
14
14
  "hatch",
@@ -62,7 +62,7 @@ Repository = "https://github.com/python-project-templates/hatch-cpp"
62
62
  Homepage = "https://github.com/python-project-templates/hatch-cpp"
63
63
 
64
64
  [tool.bumpversion]
65
- current_version = "0.1.2"
65
+ current_version = "0.1.4"
66
66
  commit = true
67
67
  tag = false
68
68
 
File without changes
File without changes
File without changes
File without changes
File without changes