pact-python-ffi 0.5.8.0__tar.gz → 0.5.10.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.5.8.0 → pact_python_ffi-0.5.10.0}/PKG-INFO +3 -3
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/hatch_build.py +33 -24
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/pact_ffi/__init__.py +402 -287
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/pyproject.toml +6 -12
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/.gitignore +0 -0
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/LICENSE +0 -0
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/README.md +0 -0
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/pact_ffi/__version__.py +0 -0
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/pact_ffi/ffi.pyi +0 -0
- {pact_python_ffi-0.5.8.0 → pact_python_ffi-0.5.10.0}/pact_ffi/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pact-python-ffi
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.10.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,13 +21,13 @@ 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.10
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.11
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
27
|
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
29
29
|
Classifier: Topic :: Software Development :: Testing
|
|
30
|
-
Requires-Python: >=3.
|
|
30
|
+
Requires-Python: >=3.11
|
|
31
31
|
Requires-Dist: cffi~=2.0
|
|
32
32
|
Description-Content-Type: text/markdown
|
|
33
33
|
|
|
@@ -386,37 +386,46 @@ class PactBuildHook(BuildHookInterface[Any]):
|
|
|
386
386
|
"""
|
|
387
387
|
Patch the upstream header so that CFFI can compile it.
|
|
388
388
|
|
|
389
|
-
The upstream `pact.h` emits the callback
|
|
390
|
-
`pactffi_register_plugin_log_callback`
|
|
391
|
-
|
|
392
|
-
`Option<extern "C" fn(...)>`,
|
|
393
|
-
|
|
389
|
+
The upstream `pact.h` emits the callback parameters of
|
|
390
|
+
`pactffi_register_plugin_log_callback` and
|
|
391
|
+
`pactffi_register_log_callback` as opaque structs passed by value, which
|
|
392
|
+
cannot be compiled. The Rust signatures are `Option<extern "C" fn(...)>`,
|
|
393
|
+
whose ABI is a nullable function pointer. See
|
|
394
|
+
https://github.com/pact-foundation/pact-reference/issues/544.
|
|
394
395
|
|
|
395
396
|
Args:
|
|
396
397
|
source:
|
|
397
398
|
The contents of the upstream `pact.h`.
|
|
398
399
|
|
|
399
400
|
Returns:
|
|
400
|
-
The header contents with the
|
|
401
|
-
|
|
401
|
+
The header contents with the callbacks declared as function
|
|
402
|
+
pointers.
|
|
402
403
|
"""
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
"
|
|
410
|
-
|
|
411
|
-
"
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
"
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
404
|
+
for callback, register, first_arg in (
|
|
405
|
+
(
|
|
406
|
+
"PluginLogCallback",
|
|
407
|
+
"pactffi_register_plugin_log_callback",
|
|
408
|
+
"plugin_instance_id",
|
|
409
|
+
),
|
|
410
|
+
("LogCallback", "pactffi_register_log_callback", "log_id"),
|
|
411
|
+
):
|
|
412
|
+
opaque = f"typedef struct Option_{callback} Option_{callback};"
|
|
413
|
+
if opaque not in source:
|
|
414
|
+
continue
|
|
415
|
+
self.app.display_debug(f"Patching Option_{callback} in pact.h")
|
|
416
|
+
source = source.replace(
|
|
417
|
+
opaque,
|
|
418
|
+
f"typedef void (*{callback})("
|
|
419
|
+
f"const char *{first_arg}, "
|
|
420
|
+
"const char *test_run_id, "
|
|
421
|
+
"const char *level, "
|
|
422
|
+
"const char *target, "
|
|
423
|
+
"const char *message);",
|
|
424
|
+
).replace(
|
|
425
|
+
f"void {register}(struct Option_{callback} callback);",
|
|
426
|
+
f"void {register}({callback} callback);",
|
|
427
|
+
)
|
|
428
|
+
return source
|
|
420
429
|
|
|
421
430
|
def _download(self, url: str) -> Path:
|
|
422
431
|
"""
|