hatch-cpp 0.1.7__py3-none-any.whl → 0.1.8__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.7"
1
+ __version__ = "0.1.8"
2
2
 
3
3
  from .hooks import hatch_register_build_hook
4
4
  from .plugin import HatchCppBuildHook
hatch_cpp/structs.py CHANGED
@@ -102,8 +102,15 @@ class HatchCppPlatform(BaseModel):
102
102
  toolchain = "clang"
103
103
  elif "cl" in CC and "cl" in CXX:
104
104
  toolchain = "msvc"
105
+ # Fallback to platform defaults
106
+ elif platform == "linux":
107
+ toolchain = "gcc"
108
+ elif platform == "darwin":
109
+ toolchain = "clang"
110
+ elif platform == "win32":
111
+ toolchain = "msvc"
105
112
  else:
106
- raise Exception(f"Unrecognized toolchain: {CC}, {CXX}")
113
+ toolchain = "gcc"
107
114
 
108
115
  # Customizations
109
116
  if which("ccache") and not environ.get("HATCH_CPP_DISABLE_CCACHE"):
@@ -117,6 +124,12 @@ class HatchCppPlatform(BaseModel):
117
124
  # LD = which("ld.lld")
118
125
  return HatchCppPlatform(cc=CC, cxx=CXX, ld=LD, platform=platform, toolchain=toolchain)
119
126
 
127
+ @staticmethod
128
+ def platform_for_toolchain(toolchain: CompilerToolchain) -> HatchCppPlatform:
129
+ platform = HatchCppPlatform.default()
130
+ platform.toolchain = toolchain
131
+ return platform
132
+
120
133
  def get_compile_flags(self, library: HatchCppLibrary, build_type: BuildType = "release") -> str:
121
134
  flags = ""
122
135
 
@@ -241,11 +254,27 @@ class HatchCppBuildConfig(BaseModel):
241
254
  cmake: Optional[HatchCppCmakeConfiguration] = Field(default=None)
242
255
  platform: Optional[HatchCppPlatform] = Field(default_factory=HatchCppPlatform.default)
243
256
 
244
- @model_validator(mode="after")
245
- def check_toolchain_matches_args(self):
246
- if self.cmake and self.libraries:
257
+ @model_validator(mode="wrap")
258
+ @classmethod
259
+ def validate_model(cls, data, handler):
260
+ if "toolchain" in data:
261
+ data["platform"] = HatchCppPlatform.platform_for_toolchain(data["toolchain"])
262
+ data.pop("toolchain")
263
+ elif "platform" not in data:
264
+ data["platform"] = HatchCppPlatform.default()
265
+ if "cc" in data:
266
+ data["platform"].cc = data["cc"]
267
+ data.pop("cc")
268
+ if "cxx" in data:
269
+ data["platform"].cxx = data["cxx"]
270
+ data.pop("cxx")
271
+ if "ld" in data:
272
+ data["platform"].ld = data["ld"]
273
+ data.pop("ld")
274
+ model = handler(data)
275
+ if model.cmake and model.libraries:
247
276
  raise ValueError("Must not provide libraries when using cmake toolchain.")
248
- return self
277
+ return model
249
278
 
250
279
 
251
280
  class HatchCppBuildPlan(HatchCppBuildConfig):
@@ -0,0 +1,17 @@
1
+ #pragma once
2
+ #include "Python.h"
3
+
4
+ PyObject* hello(PyObject*, PyObject*);
5
+
6
+ static PyMethodDef extension_methods[] = {
7
+ {"hello", (PyCFunction)hello, METH_NOARGS},
8
+ {nullptr, nullptr, 0, nullptr}
9
+ };
10
+
11
+ static PyModuleDef extension_module = {
12
+ PyModuleDef_HEAD_INIT, "extension", "extension", -1, extension_methods};
13
+
14
+ PyMODINIT_FUNC PyInit_extension(void) {
15
+ Py_Initialize();
16
+ return PyModule_Create(&extension_module);
17
+ }
@@ -0,0 +1,5 @@
1
+ #include "project/basic.hpp"
2
+
3
+ PyObject* hello(PyObject*, PyObject*) {
4
+ return PyUnicode_FromString("A string");
5
+ }
@@ -0,0 +1,17 @@
1
+ #pragma once
2
+ #include "Python.h"
3
+
4
+ PyObject* hello(PyObject*, PyObject*);
5
+
6
+ static PyMethodDef extension_methods[] = {
7
+ {"hello", (PyCFunction)hello, METH_NOARGS},
8
+ {nullptr, nullptr, 0, nullptr}
9
+ };
10
+
11
+ static PyModuleDef extension_module = {
12
+ PyModuleDef_HEAD_INIT, "extension", "extension", -1, extension_methods};
13
+
14
+ PyMODINIT_FUNC PyInit_extension(void) {
15
+ Py_Initialize();
16
+ return PyModule_Create(&extension_module);
17
+ }
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.20"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "hatch-cpp-test-project-toolchain"
7
+ description = "Toolchain override test project for hatch-cpp"
8
+ version = "0.1.0"
9
+ requires-python = ">=3.9"
10
+ dependencies = [
11
+ "hatchling>=1.20",
12
+ "hatch-cpp",
13
+ ]
14
+
15
+ [tool.hatch.build]
16
+ artifacts = [
17
+ "project/*.dll",
18
+ "project/*.dylib",
19
+ "project/*.so",
20
+ ]
21
+
22
+ [tool.hatch.build.sources]
23
+ src = "/"
24
+
25
+ [tool.hatch.build.targets.sdist]
26
+ packages = ["project"]
27
+
28
+ [tool.hatch.build.targets.wheel]
29
+ packages = ["project"]
30
+
31
+ [tool.hatch.build.hooks.hatch-cpp]
32
+ verbose = true
33
+ libraries = [
34
+ {name = "project/extension", sources = ["cpp/project/basic.cpp"], include-dirs = ["cpp"]}
35
+ ]
36
+ toolchain = "gcc"
37
+ cc = "clang"
38
+ cxx = "clang++"
@@ -13,6 +13,8 @@ class TestProject:
13
13
  [
14
14
  "test_project_basic",
15
15
  "test_project_override_classes",
16
+ "test_project_override_classes",
17
+ "test_project_override_toolchain",
16
18
  "test_project_pybind",
17
19
  "test_project_nanobind",
18
20
  "test_project_limited_api",
@@ -29,8 +31,7 @@ class TestProject:
29
31
  # compile
30
32
  check_call(
31
33
  [
32
- "hatchling",
33
- "build",
34
+ "hatch-build",
34
35
  "--hooks-only",
35
36
  ],
36
37
  cwd=f"hatch_cpp/tests/{project}",
@@ -46,3 +46,11 @@ class TestStructs:
46
46
  assert f"-DHATCH_CPP_TEST_PROJECT_BASIC_PYTHON_VERSION=3.{version_info.minor}" in hatch_build_plan.commands[0]
47
47
  if hatch_build_plan.platform.platform == "darwin":
48
48
  assert "-DCMAKE_OSX_DEPLOYMENT_TARGET=11" in hatch_build_plan.commands[0]
49
+
50
+ def test_platform_toolchain_override(self):
51
+ txt = (Path(__file__).parent / "test_project_override_toolchain" / "pyproject.toml").read_text()
52
+ toml = loads(txt)
53
+ hatch_build_config = HatchCppBuildConfig(name=toml["project"]["name"], **toml["tool"]["hatch"]["build"]["hooks"]["hatch-cpp"])
54
+ assert "clang" in hatch_build_config.platform.cc
55
+ assert "clang++" in hatch_build_config.platform.cxx
56
+ assert hatch_build_config.platform.toolchain == "gcc"
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: hatch-cpp
3
+ Version: 0.1.8
4
+ Summary: Hatch plugin for C++ builds
5
+ Project-URL: Repository, https://github.com/python-project-templates/hatch-cpp
6
+ Project-URL: Homepage, https://github.com/python-project-templates/hatch-cpp
7
+ Author-email: the hatch-cpp authors <t.paine154@gmail.com>
8
+ License: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: build,c++,cmake,cpp,hatch,python
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: Implementation :: CPython
22
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
23
+ Requires-Python: >=3.9
24
+ Requires-Dist: hatchling>=1.20
25
+ Requires-Dist: pydantic
26
+ Provides-Extra: develop
27
+ Requires-Dist: build; extra == 'develop'
28
+ Requires-Dist: bump-my-version; extra == 'develop'
29
+ Requires-Dist: check-manifest; extra == 'develop'
30
+ Requires-Dist: codespell<2.5,>=2.4; extra == 'develop'
31
+ Requires-Dist: hatch-build; extra == 'develop'
32
+ Requires-Dist: hatchling; extra == 'develop'
33
+ Requires-Dist: mdformat-tables>=1; extra == 'develop'
34
+ Requires-Dist: mdformat<0.8,>=0.7.22; extra == 'develop'
35
+ Requires-Dist: nanobind<2.10.0; extra == 'develop'
36
+ Requires-Dist: pybind11; extra == 'develop'
37
+ Requires-Dist: pytest; extra == 'develop'
38
+ Requires-Dist: pytest-cov; extra == 'develop'
39
+ Requires-Dist: ruff; extra == 'develop'
40
+ Requires-Dist: toml; extra == 'develop'
41
+ Requires-Dist: twine; extra == 'develop'
42
+ Requires-Dist: uv; extra == 'develop'
43
+ Requires-Dist: wheel; extra == 'develop'
44
+ Description-Content-Type: text/markdown
45
+
46
+ # hatch-cpp
47
+
48
+ Hatch plugin for C++ builds
49
+
50
+ [![Build Status](https://github.com/python-project-templates/hatch-cpp/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/hatch-cpp/actions/workflows/build.yaml)
51
+ [![codecov](https://codecov.io/gh/python-project-templates/hatch-cpp/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/hatch-cpp)
52
+ [![License](https://img.shields.io/github/license/python-project-templates/hatch-cpp)](https://github.com/python-project-templates/hatch-cpp)
53
+ [![PyPI](https://img.shields.io/pypi/v/hatch-cpp.svg)](https://pypi.python.org/pypi/hatch-cpp)
54
+
55
+ ## Overview
56
+
57
+ A simple, extensible C++ build plugin for [hatch](https://hatch.pypa.io/latest/).
58
+
59
+ ```toml
60
+ [tool.hatch.build.hooks.hatch-cpp]
61
+ libraries = [
62
+ {name = "project/extension", sources = ["cpp/project/basic.cpp"], include-dirs = ["cpp"]}
63
+ ]
64
+ ```
65
+
66
+ For more complete systems, see:
67
+
68
+ - [scikit-build-core](https://github.com/scikit-build/scikit-build-core)
69
+ - [setuptools](https://setuptools.pypa.io/en/latest/userguide/ext_modules.html)
70
+
71
+ ## Configuration
72
+
73
+ Configuration is driven from the `[tool.hatch.build.hooks.hatch-cpp]` hatch hook configuration field in a `pyproject.toml`.
74
+ It is designed to closely match existing Python/C/C++ packaging tools.
75
+
76
+ ```toml
77
+ verbose = true
78
+ libraries = { Library Args }
79
+ cmake = { CMake Args }
80
+ platform = { Platform, either "linux", "darwin", or "win32" }
81
+ ```
82
+
83
+ See the [test cases](./hatch_cpp/tests/) for more concrete examples.
84
+
85
+ `hatch-cpp` is driven by [pydantic](https://docs.pydantic.dev/latest/) models for configuration and execution of the build.
86
+ These models can themselves be overridden by setting `build-config-class` / `build-plan-class`.
87
+
88
+ ### Library Arguments
89
+
90
+ ```toml
91
+ name = "mylib"
92
+ sources = [
93
+ "path/to/file.cpp",
94
+ ]
95
+ language = "c++"
96
+
97
+ binding = "cpython" # or "pybind11", "nanobind", "generic"
98
+ std = "" # Passed to -std= or /std:
99
+
100
+ include_dirs = ["paths/to/add/to/-I"]
101
+ library_dirs = ["paths/to/add/to/-L"]
102
+ libraries = ["-llibraries_to_link"]
103
+
104
+ extra_compile_args = ["--extra-compile-args"]
105
+ extra_link_args = ["--extra-link-args"]
106
+ extra_objects = ["extra_objects"]
107
+
108
+ define_macros = ["-Ddefines_to_use"]
109
+ undef_macros = ["-Uundefines_to_use"]
110
+
111
+ py_limited_api = "cp39" # limited API to use
112
+ ```
113
+
114
+ ### CMake Arguments
115
+
116
+ `hatch-cpp` has some convenience integration with CMake.
117
+ Though this is not designed to be as full-featured as e.g. `scikit-build`, it should be satisfactory for many small projects.
118
+
119
+ ```toml
120
+ root = "path/to/cmake/root"
121
+ build = "path/to/cmake/build/folder"
122
+ install = "path/to/cmake/install/folder"
123
+
124
+ cmake_arg_prefix = "MYPROJECT_"
125
+ cmake_args = {} # any other cmake args to pass
126
+ cmake_env_args = {} # env-specific cmake args to pass
127
+
128
+ include_flags = {} # include flags to pass -D
129
+ ```
130
+
131
+ ### Environment Variables
132
+
133
+ `hatch-cpp` will respect standard environment variables for compiler control.
134
+
135
+ | Name | Default | Description |
136
+ | :------------------------- | :------ | :-------------------- |
137
+ | `CC` | | C Compiler override |
138
+ | `CXX` | | C++ Compiler override |
139
+ | `LD` | | Linker override |
140
+ | `HATCH_CPP_PLATFORM` | | Platform to build |
141
+ | `HATCH_CPP_DISABLE_CCACHE` | | Disable CCache usage |
142
+
143
+ > [!NOTE]
144
+ > This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
@@ -1,10 +1,10 @@
1
- hatch_cpp/__init__.py,sha256=iL_H3Zhh1jKzI3DB7IrRjibqnsFh0QPAQL1ERHAR7hI,129
1
+ hatch_cpp/__init__.py,sha256=PG6tcYLGctNYf_dsMhB0P4JB-wagyyjDSzutyhUIgHY,129
2
2
  hatch_cpp/hooks.py,sha256=SQkF5WJIgzw-8rvlTzuQvBqdP6K3fHgnh6CZOZFag50,203
3
3
  hatch_cpp/plugin.py,sha256=AV5hcVcPPIOsalKKiGSXHcHrLlZ7mKIVc-g5_waK9fk,4403
4
- hatch_cpp/structs.py,sha256=LDaAjzpAl4G7IysMIz6zUV1H5GcVBL2BAxA7DXjtxQw,13895
4
+ hatch_cpp/structs.py,sha256=xNYK3ESJbwsNpBHOWCTtQgAGgjAuswcxUWNcegLI2w8,14898
5
5
  hatch_cpp/utils.py,sha256=lxd3U3aMYsTS6DYMc1y17MR16LzgRzv92f_xh87LSg8,297
6
- hatch_cpp/tests/test_projects.py,sha256=vmJ218C_jP5nsen2gwjPtob0AoH4J_jNS5nOckHamvw,1623
7
- hatch_cpp/tests/test_structs.py,sha256=5y_xi2Hsg5NwG34hWuQoycJZEOMRI384RjPjIY4skw4,2090
6
+ hatch_cpp/tests/test_projects.py,sha256=J3Ea6ADlDOe_bCXAyBlM-IHrmVAv_hTpFcB5_pzAoHY,1692
7
+ hatch_cpp/tests/test_structs.py,sha256=6S8LhX7TULd_UBwKCOWkH05MHPMSJMwEmzXktxWtV7s,2584
8
8
  hatch_cpp/tests/test_project_basic/pyproject.toml,sha256=eqM1UVpNmJWDfsuO18ZG_VOV9I4tAWgsM5Dhf49X8Nc,694
9
9
  hatch_cpp/tests/test_project_basic/cpp/project/basic.cpp,sha256=gQ2nmdLqIdgaqxSKvkN_vbp6Iv_pAoVIHETXPRnALb0,117
10
10
  hatch_cpp/tests/test_project_basic/cpp/project/basic.hpp,sha256=SO5GhPj8k3RzWrfH37lFSDc8w1Vf3yqTUhxmr1hnoko,422
@@ -15,6 +15,7 @@ hatch_cpp/tests/test_project_cmake/pyproject.toml,sha256=pu9RWhm_FY7KlcdOg2nmp-o
15
15
  hatch_cpp/tests/test_project_cmake/cpp/project/basic.cpp,sha256=gQ2nmdLqIdgaqxSKvkN_vbp6Iv_pAoVIHETXPRnALb0,117
16
16
  hatch_cpp/tests/test_project_cmake/cpp/project/basic.hpp,sha256=SO5GhPj8k3RzWrfH37lFSDc8w1Vf3yqTUhxmr1hnoko,422
17
17
  hatch_cpp/tests/test_project_cmake/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ hatch_cpp/tests/test_project_cmake/project/include/project/basic.hpp,sha256=SO5GhPj8k3RzWrfH37lFSDc8w1Vf3yqTUhxmr1hnoko,422
18
19
  hatch_cpp/tests/test_project_limited_api/pyproject.toml,sha256=k_2y7YpZP5I-KPvKOZLmnHqoKXVE2oVM8fjxtRKoTo0,726
19
20
  hatch_cpp/tests/test_project_limited_api/cpp/project/basic.cpp,sha256=gQ2nmdLqIdgaqxSKvkN_vbp6Iv_pAoVIHETXPRnALb0,117
20
21
  hatch_cpp/tests/test_project_limited_api/cpp/project/basic.hpp,sha256=SO5GhPj8k3RzWrfH37lFSDc8w1Vf3yqTUhxmr1hnoko,422
@@ -27,14 +28,18 @@ hatch_cpp/tests/test_project_override_classes/pyproject.toml,sha256=ykoZnutSWLYI
27
28
  hatch_cpp/tests/test_project_override_classes/cpp/project/basic.cpp,sha256=gQ2nmdLqIdgaqxSKvkN_vbp6Iv_pAoVIHETXPRnALb0,117
28
29
  hatch_cpp/tests/test_project_override_classes/cpp/project/basic.hpp,sha256=SO5GhPj8k3RzWrfH37lFSDc8w1Vf3yqTUhxmr1hnoko,422
29
30
  hatch_cpp/tests/test_project_override_classes/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
+ hatch_cpp/tests/test_project_override_toolchain/pyproject.toml,sha256=t4zW-beld-tQzLsP7czECLMLYrewwF37EtNMrn-BRM8,758
32
+ hatch_cpp/tests/test_project_override_toolchain/cpp/project/basic.cpp,sha256=gQ2nmdLqIdgaqxSKvkN_vbp6Iv_pAoVIHETXPRnALb0,117
33
+ hatch_cpp/tests/test_project_override_toolchain/cpp/project/basic.hpp,sha256=SO5GhPj8k3RzWrfH37lFSDc8w1Vf3yqTUhxmr1hnoko,422
34
+ hatch_cpp/tests/test_project_override_toolchain/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
35
  hatch_cpp/tests/test_project_pybind/pyproject.toml,sha256=3IVlSprxx8XaC36s6OSgKr-OiSPn6cH6nX8pbp10suM,716
31
36
  hatch_cpp/tests/test_project_pybind/cpp/project/basic.cpp,sha256=MT3eCSQKr4guI3XZHV8kw8PoBGC6LEK8ClxnNMBnvnI,78
32
37
  hatch_cpp/tests/test_project_pybind/cpp/project/basic.hpp,sha256=LZSfCfhLY_91MBOxtnvDk7DcceO-9GhCHKpMnAjGe18,146
33
38
  hatch_cpp/tests/test_project_pybind/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
39
  hatch_cpp/toolchains/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
40
  hatch_cpp/toolchains/cmake.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- hatch_cpp-0.1.7.dist-info/METADATA,sha256=z95QlwYagluSoKGVxGm9sdjCcVF_y93MCmxSc3yvnZ0,3043
37
- hatch_cpp-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
- hatch_cpp-0.1.7.dist-info/entry_points.txt,sha256=RgXfjpD4iwomJQK5n7FnPkXzb5fOnF5v3DI5hbkgVcw,30
39
- hatch_cpp-0.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
40
- hatch_cpp-0.1.7.dist-info/RECORD,,
41
+ hatch_cpp-0.1.8.dist-info/METADATA,sha256=i4Y3Pcky1C2Gp46UEjyn8MzV6uO0JnyltuA4JRTr3Uw,5529
42
+ hatch_cpp-0.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
+ hatch_cpp-0.1.8.dist-info/entry_points.txt,sha256=RgXfjpD4iwomJQK5n7FnPkXzb5fOnF5v3DI5hbkgVcw,30
44
+ hatch_cpp-0.1.8.dist-info/licenses/LICENSE,sha256=FWyFTpd5xXEz50QpGDtsyIv6dgR2z_dHdoab_Nq_KMw,11452
45
+ hatch_cpp-0.1.8.dist-info/RECORD,,
@@ -186,7 +186,11 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
+ <<<<<<< before updating
189
190
  Copyright [yyyy] [name of copyright owner]
191
+ =======
192
+ Copyright 2025 the hatch-cpp authors
193
+ >>>>>>> after updating
190
194
 
191
195
  Licensed under the Apache License, Version 2.0 (the "License");
192
196
  you may not use this file except in compliance with the License.
@@ -1,72 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: hatch-cpp
3
- Version: 0.1.7
4
- Summary: Hatch plugin for C++ builds
5
- Project-URL: Repository, https://github.com/python-project-templates/hatch-cpp
6
- Project-URL: Homepage, https://github.com/python-project-templates/hatch-cpp
7
- Author-email: the hatch-cpp authors <t.paine154@gmail.com>
8
- License: Apache-2.0
9
- License-File: LICENSE
10
- Keywords: build,c++,cmake,cpp,hatch,python
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Programming Language :: Python :: Implementation :: CPython
20
- Classifier: Programming Language :: Python :: Implementation :: PyPy
21
- Requires-Python: >=3.9
22
- Requires-Dist: hatchling>=1.20
23
- Requires-Dist: pydantic
24
- Provides-Extra: develop
25
- Requires-Dist: build; extra == 'develop'
26
- Requires-Dist: bump-my-version; extra == 'develop'
27
- Requires-Dist: check-manifest; extra == 'develop'
28
- Requires-Dist: nanobind; extra == 'develop'
29
- Requires-Dist: pybind11; extra == 'develop'
30
- Requires-Dist: pytest; extra == 'develop'
31
- Requires-Dist: pytest-cov; extra == 'develop'
32
- Requires-Dist: ruff<0.9,>=0.3; extra == 'develop'
33
- Requires-Dist: toml; extra == 'develop'
34
- Requires-Dist: twine; extra == 'develop'
35
- Requires-Dist: wheel; extra == 'develop'
36
- Description-Content-Type: text/markdown
37
-
38
- # hatch-cpp
39
-
40
- Hatch plugin for C++ builds
41
-
42
- [![Build Status](https://github.com/python-project-templates/hatch-cpp/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/hatch-cpp/actions/workflows/build.yml)
43
- [![codecov](https://codecov.io/gh/python-project-templates/hatch-cpp/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/hatch-cpp)
44
- [![License](https://img.shields.io/github/license/python-project-templates/hatch-cpp)](https://github.com/python-project-templates/hatch-cpp)
45
- [![PyPI](https://img.shields.io/pypi/v/hatch-cpp.svg)](https://pypi.python.org/pypi/hatch-cpp)
46
-
47
- ## Overview
48
-
49
- A simple, extensible C++ build plugin for [hatch](https://hatch.pypa.io/latest/).
50
-
51
- ```toml
52
- [tool.hatch.build.hooks.hatch-cpp]
53
- libraries = [
54
- {name = "project/extension", sources = ["cpp/project/basic.cpp"], include-dirs = ["cpp"]}
55
- ]
56
- ```
57
-
58
- For more complete systems, see:
59
- - [scikit-build-core](https://github.com/scikit-build/scikit-build-core)
60
- - [setuptools](https://setuptools.pypa.io/en/latest/userguide/ext_modules.html)
61
-
62
- ## Environment Variables
63
- | Name | Default | Description |
64
- |:-----|:--------|:------------|
65
- |`CC`| | |
66
- |`CXX`| | |
67
- |`LD`| | |
68
- |`HATCH_CPP_PLATFORM`| | |
69
- |`HATCH_CPP_DISABLE_CCACHE`| | |
70
-
71
- > [!NOTE]
72
- > This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).