hatch-cpp 0.5.0__py3-none-any.whl → 0.5.2__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 +3 -1
- hatch_cpp/tests/test_hook_registration.py +21 -0
- hatch_cpp/tests/test_structs.py +5 -0
- {hatch_cpp-0.5.0.dist-info → hatch_cpp-0.5.2.dist-info}/METADATA +3 -3
- {hatch_cpp-0.5.0.dist-info → hatch_cpp-0.5.2.dist-info}/RECORD +9 -8
- {hatch_cpp-0.5.0.dist-info → hatch_cpp-0.5.2.dist-info}/WHEEL +0 -0
- {hatch_cpp-0.5.0.dist-info → hatch_cpp-0.5.2.dist-info}/entry_points.txt +0 -0
- {hatch_cpp-0.5.0.dist-info → hatch_cpp-0.5.2.dist-info}/licenses/LICENSE +0 -0
hatch_cpp/__init__.py
CHANGED
hatch_cpp/plugin.py
CHANGED
|
@@ -28,11 +28,13 @@ def _wheel_tag(platform: str, machine: str, version_major: int, version_minor: i
|
|
|
28
28
|
os_name = "linux"
|
|
29
29
|
else:
|
|
30
30
|
os_name = "win"
|
|
31
|
+
# platform.machine() reports AMD64/ARM64 on Windows, but PEP 425 platform tags are lowercase
|
|
32
|
+
machine = machine.lower()
|
|
31
33
|
abi = "abi3" if abi3 else f"cp{version_major}{version_minor}"
|
|
32
34
|
return f"cp{version_major}{version_minor}-{abi}-{os_name}_{machine}"
|
|
33
35
|
|
|
34
36
|
|
|
35
|
-
class HatchCppBuildHook(BuildHookInterface
|
|
37
|
+
class HatchCppBuildHook(BuildHookInterface):
|
|
36
38
|
"""The hatch-cpp build hook."""
|
|
37
39
|
|
|
38
40
|
PLUGIN_NAME = "hatch-cpp"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
2
|
+
|
|
3
|
+
from hatch_cpp.hooks import hatch_register_build_hook
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_registered_build_hook_accepts_hatchling_configuration(tmp_path):
|
|
7
|
+
hook_class = hatch_register_build_hook()
|
|
8
|
+
config = {}
|
|
9
|
+
hook = hook_class(
|
|
10
|
+
root=str(tmp_path),
|
|
11
|
+
config=config,
|
|
12
|
+
build_config=None,
|
|
13
|
+
metadata=None,
|
|
14
|
+
directory=str(tmp_path),
|
|
15
|
+
target_name="wheel",
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
assert isinstance(hook, BuildHookInterface)
|
|
19
|
+
assert hook.PLUGIN_NAME == "hatch-cpp"
|
|
20
|
+
assert hook.config is config
|
|
21
|
+
assert hook.target_name == "wheel"
|
hatch_cpp/tests/test_structs.py
CHANGED
|
@@ -87,6 +87,11 @@ class TestStructs:
|
|
|
87
87
|
with pytest.raises(ValueError, match="PYODIDE_ABI_VERSION"):
|
|
88
88
|
_wheel_tag("emscripten", "wasm32", 3, 14, False)
|
|
89
89
|
|
|
90
|
+
def test_wheel_tag_machine_is_lowercased(self):
|
|
91
|
+
assert _wheel_tag("win32", "AMD64", 3, 11, False) == "cp311-cp311-win_amd64"
|
|
92
|
+
assert _wheel_tag("win32", "ARM64", 3, 11, True) == "cp311-abi3-win_arm64"
|
|
93
|
+
assert _wheel_tag("linux", "x86_64", 3, 11, False) == "cp311-cp311-linux_x86_64"
|
|
94
|
+
|
|
90
95
|
def test_pyodide_build_plan_compiles_objects_before_linking(self, monkeypatch: pytest.MonkeyPatch):
|
|
91
96
|
monkeypatch.setenv("PYODIDE_ABI_VERSION", "2026_0")
|
|
92
97
|
monkeypatch.setenv("CC", "/toolchain/cc")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: hatch-cpp
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
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
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
20
20
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
21
21
|
Requires-Python: >=3.10
|
|
22
22
|
Requires-Dist: hatch-build<0.6,>=0.5
|
|
23
|
-
Requires-Dist: hatchling
|
|
23
|
+
Requires-Dist: hatchling!=1.32.1
|
|
24
24
|
Requires-Dist: pkn
|
|
25
25
|
Requires-Dist: pydantic
|
|
26
26
|
Provides-Extra: develop
|
|
@@ -29,7 +29,7 @@ Requires-Dist: bump-my-version; extra == 'develop'
|
|
|
29
29
|
Requires-Dist: check-dist; extra == 'develop'
|
|
30
30
|
Requires-Dist: codespell; extra == 'develop'
|
|
31
31
|
Requires-Dist: hatch-build>=0.3.2; extra == 'develop'
|
|
32
|
-
Requires-Dist: hatchling; extra == 'develop'
|
|
32
|
+
Requires-Dist: hatchling!=1.32.1; extra == 'develop'
|
|
33
33
|
Requires-Dist: mdformat; extra == 'develop'
|
|
34
34
|
Requires-Dist: mdformat-tables>=1; extra == 'develop'
|
|
35
35
|
Requires-Dist: nanobind; extra == 'develop'
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
hatch_cpp/__init__.py,sha256=
|
|
1
|
+
hatch_cpp/__init__.py,sha256=UxfEw36fxdjilyMAx80Fby60eY8HCALAzne3jFbazPc,114
|
|
2
2
|
hatch_cpp/config.py,sha256=YY0kqhKxIPOIwiuSb6Q0u1EtbKTScw2eIs5zWYz5FBA,5188
|
|
3
3
|
hatch_cpp/hooks.py,sha256=OfcAgx6gVL0ukvpyln5OTiwhqxObJ0b4FKr850fYP3I,178
|
|
4
|
-
hatch_cpp/plugin.py,sha256=
|
|
4
|
+
hatch_cpp/plugin.py,sha256=yaIzmENsGuJPtBvwcJJwxxKduRJumU7zbMyDTSf2ICw,4641
|
|
5
5
|
hatch_cpp/utils.py,sha256=dxLCyoMLC7C0trJ8mlvwA5-JzVNt2JI9JSGYcHTHBY4,275
|
|
6
6
|
hatch_cpp/tests/test_hatch_build.py,sha256=q2IKTFi3Pq99UsOyL84V-C9VtFUs3ZcA9UlA8lpRW54,1553
|
|
7
|
+
hatch_cpp/tests/test_hook_registration.py,sha256=RQ-EqFpgqs4gkSGLEBB5sNIhVSdcAHutiH51xDhT3z4,621
|
|
7
8
|
hatch_cpp/tests/test_platform_specific.py,sha256=SRKAojh6PkwKZnEj8SjvfFa_Dy8NSKw4R82ol8O1TZs,20126
|
|
8
9
|
hatch_cpp/tests/test_projects.py,sha256=WAV8OAV-4Xp4o91S1nlj9ptmpexlXEIXnfSozt0mhCI,2123
|
|
9
|
-
hatch_cpp/tests/test_structs.py,sha256=
|
|
10
|
+
hatch_cpp/tests/test_structs.py,sha256=BXpLW7pDdA3apKdFaDxVK_7pKPGi_7y0G58bm-Itz54,14782
|
|
10
11
|
hatch_cpp/tests/test_vcpkg_ref.py,sha256=f6VLFQZeD3aWVbAVB2Ds3VAE1kSphgbEnkfzHqxa3Uo,12116
|
|
11
12
|
hatch_cpp/tests/test_project_basic/pyproject.toml,sha256=eqM1UVpNmJWDfsuO18ZG_VOV9I4tAWgsM5Dhf49X8Nc,694
|
|
12
13
|
hatch_cpp/tests/test_project_basic/cpp/project/basic.cpp,sha256=gQ2nmdLqIdgaqxSKvkN_vbp6Iv_pAoVIHETXPRnALb0,117
|
|
@@ -63,8 +64,8 @@ hatch_cpp/toolchains/__init__.py,sha256=anza4tXKxauobWMOUrxX3sEO0qs7sp6VdLXhLae3
|
|
|
63
64
|
hatch_cpp/toolchains/cmake.py,sha256=9fOGXuJ4bpkKjU789GApK59WS4iZQNQK19Q_Zq_Byb4,3709
|
|
64
65
|
hatch_cpp/toolchains/common.py,sha256=lU6o5J8Kvhp-eNlq5BKp4CQ7TVOlyKMbP4pgMwIbYog,20235
|
|
65
66
|
hatch_cpp/toolchains/vcpkg.py,sha256=q527R-6nhjkCiTG2cMyoJFwBJGjq8crGlsCy7V5skvk,5657
|
|
66
|
-
hatch_cpp-0.5.
|
|
67
|
-
hatch_cpp-0.5.
|
|
68
|
-
hatch_cpp-0.5.
|
|
69
|
-
hatch_cpp-0.5.
|
|
70
|
-
hatch_cpp-0.5.
|
|
67
|
+
hatch_cpp-0.5.2.dist-info/METADATA,sha256=P84AO15SOB1jfGMm8Sr4tmla4h0RmLKGpMeG1GzMq_M,10556
|
|
68
|
+
hatch_cpp-0.5.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
69
|
+
hatch_cpp-0.5.2.dist-info/entry_points.txt,sha256=RgXfjpD4iwomJQK5n7FnPkXzb5fOnF5v3DI5hbkgVcw,30
|
|
70
|
+
hatch_cpp-0.5.2.dist-info/licenses/LICENSE,sha256=FWyFTpd5xXEz50QpGDtsyIv6dgR2z_dHdoab_Nq_KMw,11452
|
|
71
|
+
hatch_cpp-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|