pact-python-ffi 0.4.28.1__tar.gz → 0.5.3.0__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.
- {pact_python_ffi-0.4.28.1 → pact_python_ffi-0.5.3.0}/.gitignore +0 -1
- {pact_python_ffi-0.4.28.1 → pact_python_ffi-0.5.3.0}/PKG-INFO +8 -8
- {pact_python_ffi-0.4.28.1 → pact_python_ffi-0.5.3.0}/README.md +4 -4
- {pact_python_ffi-0.4.28.1 → pact_python_ffi-0.5.3.0}/hatch_build.py +16 -12
- {pact_python_ffi-0.4.28.1/src → pact_python_ffi-0.5.3.0}/pact_ffi/__init__.py +689 -484
- pact_python_ffi-0.5.3.0/pact_ffi/__version__.py +10 -0
- pact_python_ffi-0.5.3.0/pyproject.toml +166 -0
- pact_python_ffi-0.4.28.1/CHANGELOG.md +0 -57
- pact_python_ffi-0.4.28.1/cliff.toml +0 -115
- pact_python_ffi-0.4.28.1/docs/SUMMARY.md +0 -5
- pact_python_ffi-0.4.28.1/pyproject.toml +0 -221
- pact_python_ffi-0.4.28.1/src/pact_ffi/__version__.py +0 -34
- pact_python_ffi-0.4.28.1/tests/.ruff.toml +0 -11
- pact_python_ffi-0.4.28.1/tests/__init__.py +0 -0
- pact_python_ffi-0.4.28.1/tests/test_init.py +0 -77
- {pact_python_ffi-0.4.28.1 → pact_python_ffi-0.5.3.0}/LICENSE +0 -0
- {pact_python_ffi-0.4.28.1/src → pact_python_ffi-0.5.3.0}/pact_ffi/ffi.pyi +0 -0
- {pact_python_ffi-0.4.28.1/src → pact_python_ffi-0.5.3.0}/pact_ffi/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pact-python-ffi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.3.0
|
|
4
4
|
Summary: Python bindings for the Pact FFI library
|
|
5
5
|
Project-URL: Bug Tracker, https://github.com/pact-foundation/pact-python/issues
|
|
6
6
|
Project-URL: Changelog, https://github.com/pact-foundation/pact-python/blob/main/pact-python-ffi/CHANGELOG.md
|
|
@@ -21,14 +21,14 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
21
21
|
Classifier: Operating System :: POSIX :: Linux
|
|
22
22
|
Classifier: Programming Language :: Python
|
|
23
23
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.10
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
28
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
29
29
|
Classifier: Topic :: Software Development :: Testing
|
|
30
|
-
Requires-Python: >=3.
|
|
31
|
-
Requires-Dist: cffi~=
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Requires-Dist: cffi~=2.0
|
|
32
32
|
Description-Content-Type: text/markdown
|
|
33
33
|
|
|
34
34
|
# Pact Python FFI
|
|
@@ -51,15 +51,15 @@ Description-Content-Type: text/markdown
|
|
|
51
51
|
<td>CI/CD</td>
|
|
52
52
|
<td>
|
|
53
53
|
<a
|
|
54
|
-
href="https://github.com/pact-foundation/pact-python/actions/workflows/test.yml"><img
|
|
54
|
+
href="https://github.com/pact-foundation/pact-python/actions/workflows/test.yml?query=branch:main"><img
|
|
55
55
|
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/test.yml?branch=main&label=test"
|
|
56
56
|
alt="Test Status"></a>
|
|
57
57
|
<a
|
|
58
|
-
href="https://github.com/pact-foundation/pact-python/actions/workflows/build-
|
|
59
|
-
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/build-
|
|
58
|
+
href="https://github.com/pact-foundation/pact-python/actions/workflows/build-ffi.yml?query=branch:main"><img
|
|
59
|
+
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/build-ffi.yml?branch=main&label=build"
|
|
60
60
|
alt="Build Status"></a>
|
|
61
61
|
<a
|
|
62
|
-
href="https://github.com/pact-foundation/pact-python/actions/workflows/docs.yml"><img
|
|
62
|
+
href="https://github.com/pact-foundation/pact-python/actions/workflows/docs.yml?query=branch:main"><img
|
|
63
63
|
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/docs.yml?branch=main&label=docs"
|
|
64
64
|
alt="Build Status"></a>
|
|
65
65
|
</td>
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
<td>CI/CD</td>
|
|
19
19
|
<td>
|
|
20
20
|
<a
|
|
21
|
-
href="https://github.com/pact-foundation/pact-python/actions/workflows/test.yml"><img
|
|
21
|
+
href="https://github.com/pact-foundation/pact-python/actions/workflows/test.yml?query=branch:main"><img
|
|
22
22
|
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/test.yml?branch=main&label=test"
|
|
23
23
|
alt="Test Status"></a>
|
|
24
24
|
<a
|
|
25
|
-
href="https://github.com/pact-foundation/pact-python/actions/workflows/build-
|
|
26
|
-
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/build-
|
|
25
|
+
href="https://github.com/pact-foundation/pact-python/actions/workflows/build-ffi.yml?query=branch:main"><img
|
|
26
|
+
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/build-ffi.yml?branch=main&label=build"
|
|
27
27
|
alt="Build Status"></a>
|
|
28
28
|
<a
|
|
29
|
-
href="https://github.com/pact-foundation/pact-python/actions/workflows/docs.yml"><img
|
|
29
|
+
href="https://github.com/pact-foundation/pact-python/actions/workflows/docs.yml?query=branch:main"><img
|
|
30
30
|
src="https://img.shields.io/github/actions/workflow/status/pact-foundation/pact-python/docs.yml?branch=main&label=docs"
|
|
31
31
|
alt="Build Status"></a>
|
|
32
32
|
</td>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Hatchling build hook.
|
|
3
3
|
|
|
4
|
-
This hook is responsible for
|
|
4
|
+
This hook is responsible for downloading the Pact FFI library and building the
|
|
5
5
|
CFFI bindings for it.
|
|
6
6
|
"""
|
|
7
7
|
|
|
@@ -15,12 +15,15 @@ import sys
|
|
|
15
15
|
import tempfile
|
|
16
16
|
import urllib.request
|
|
17
17
|
from pathlib import Path
|
|
18
|
-
from typing import Any
|
|
18
|
+
from typing import TYPE_CHECKING, Any
|
|
19
19
|
|
|
20
20
|
import cffi
|
|
21
21
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
22
22
|
from packaging.tags import sys_tags
|
|
23
23
|
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from collections.abc import Mapping, MutableMapping, Sequence
|
|
26
|
+
|
|
24
27
|
PKG_DIR = Path(__file__).parent.resolve() / "src" / "pact_ffi"
|
|
25
28
|
PACT_LIB_URL = "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v{version}/{prefix}pact_ffi-{os}-{platform}{suffix}.{ext}"
|
|
26
29
|
|
|
@@ -56,7 +59,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
56
59
|
|
|
57
60
|
PLUGIN_NAME = "pact-ffi"
|
|
58
61
|
|
|
59
|
-
def __init__(self, *args:
|
|
62
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None: # noqa: ANN401
|
|
60
63
|
"""
|
|
61
64
|
Initialize the build hook.
|
|
62
65
|
|
|
@@ -73,7 +76,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
73
76
|
"""
|
|
74
77
|
shutil.rmtree(self.tmpdir, ignore_errors=True)
|
|
75
78
|
|
|
76
|
-
def clean(self, versions:
|
|
79
|
+
def clean(self, versions: Sequence[str]) -> None: # noqa: ARG002
|
|
77
80
|
"""
|
|
78
81
|
Code called to clean.
|
|
79
82
|
|
|
@@ -93,7 +96,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
93
96
|
def initialize(
|
|
94
97
|
self,
|
|
95
98
|
version: str, # noqa: ARG002
|
|
96
|
-
build_data:
|
|
99
|
+
build_data: MutableMapping[str, object],
|
|
97
100
|
) -> None:
|
|
98
101
|
"""
|
|
99
102
|
Code called immediately before each build.
|
|
@@ -103,8 +106,8 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
103
106
|
Not used (but required by the parent class).
|
|
104
107
|
|
|
105
108
|
build_data:
|
|
106
|
-
A
|
|
107
|
-
final wheel.
|
|
109
|
+
A mutable mapping to modify in-place used by Hatch when creating
|
|
110
|
+
the final wheel.
|
|
108
111
|
|
|
109
112
|
Raises:
|
|
110
113
|
UnsupportedPlatformError:
|
|
@@ -122,6 +125,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
122
125
|
except UnsupportedPlatformError as err:
|
|
123
126
|
msg = f"Pact FFI library is not available for {err.platform}"
|
|
124
127
|
self.app.display_error(msg)
|
|
128
|
+
raise
|
|
125
129
|
|
|
126
130
|
self.app.display_debug(f"Wheel artefacts: {build_data['force_include']}")
|
|
127
131
|
build_data["tag"] = self._infer_tag()
|
|
@@ -134,7 +138,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
134
138
|
"""
|
|
135
139
|
return next(t.platform for t in sys_tags())
|
|
136
140
|
|
|
137
|
-
def _install(self, version: str) ->
|
|
141
|
+
def _install(self, version: str) -> Mapping[str, str]:
|
|
138
142
|
"""
|
|
139
143
|
Install the Pact library binary.
|
|
140
144
|
|
|
@@ -307,7 +311,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
307
311
|
"pdh",
|
|
308
312
|
"powrprof",
|
|
309
313
|
"psapi",
|
|
310
|
-
"secur32",
|
|
314
|
+
"secur32", # spellchecker:disable-line
|
|
311
315
|
"shell32",
|
|
312
316
|
"user32",
|
|
313
317
|
"userenv",
|
|
@@ -376,10 +380,10 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
376
380
|
url:
|
|
377
381
|
The URL to download
|
|
378
382
|
|
|
379
|
-
|
|
383
|
+
Returns:
|
|
380
384
|
The path to the downloaded artefact.
|
|
381
385
|
"""
|
|
382
|
-
filename = url.
|
|
386
|
+
filename = url.rsplit("/", maxsplit=1)[-1]
|
|
383
387
|
artefact = PKG_DIR / "data" / filename
|
|
384
388
|
artefact.parent.mkdir(parents=True, exist_ok=True)
|
|
385
389
|
|
|
@@ -402,7 +406,7 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
402
406
|
While the ABI3 interface was introduced in Python 3.2, we target the
|
|
403
407
|
earliest supported version of Python in the Python wrapper.
|
|
404
408
|
|
|
405
|
-
|
|
409
|
+
Returns:
|
|
406
410
|
The tag for the current build.
|
|
407
411
|
"""
|
|
408
412
|
python_version = f"{sys.version_info.major}{sys.version_info.minor}"
|