pycapnp 2.1.0__tar.gz → 2.2.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.
- {pycapnp-2.1.0 → pycapnp-2.2.0}/CHANGELOG.md +5 -0
- {pycapnp-2.1.0/pycapnp.egg-info → pycapnp-2.2.0}/PKG-INFO +7 -2
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/__init__.py +1 -0
- pycapnp-2.2.0/capnp/includes/PyCustomMessageBuilder.cpp +50 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/includes/schema_cpp.pxd +5 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/capnp.cpp +15424 -11664
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/capnp.pxd +2 -2
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/capnp.pyx +201 -29
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/version.py +2 -2
- pycapnp-2.2.0/examples/py_custom_message_builder.py +48 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0/pycapnp.egg-info}/PKG-INFO +7 -2
- {pycapnp-2.1.0 → pycapnp-2.2.0}/pycapnp.egg-info/SOURCES.txt +7 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/setup.py +2 -1
- pycapnp-2.2.0/test/blob_test.capnp +5 -0
- pycapnp-2.2.0/test/test_blob_to_dict_base64.py +20 -0
- pycapnp-2.2.0/test/test_py_custom_message_builder.py +51 -0
- pycapnp-2.2.0/test/test_structs_sequence.capnp +27 -0
- pycapnp-2.2.0/test/test_structs_sequence.py +93 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/LICENSE.md +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/MANIFEST.in +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/Pipfile +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/README.md +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/_custom_build/backend.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/buildutils/__init__.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/buildutils/build.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/buildutils/bundle.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/__init__.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/_gen.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/__init__.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/capabilityHelper.cpp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/capabilityHelper.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/checkCompiler.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/deserialize.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/fixMaybe.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/helpers.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/non_circular.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/rpcHelper.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/helpers/serialize.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/includes/__init__.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/includes/capnp_cpp.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/includes/types.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/__init__.pxd +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/__init__.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/capnp_api.h +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/lib/pickle_helper.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/templates/module.pyx +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/capnp/templates/setup.py.tmpl +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/addressbook.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/addressbook.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_calculator_client.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_calculator_server.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_client.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_reconnecting_ssl_client.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_server.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_socket_message_client.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_socket_message_server.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_ssl_calculator_client.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_ssl_calculator_server.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_ssl_client.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/async_ssl_server.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/calculator.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/selfsigned.cert +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/selfsigned.key +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/examples/thread.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/pycapnp.egg-info/dependency_links.txt +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/pycapnp.egg-info/entry_points.txt +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/pycapnp.egg-info/top_level.txt +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/pyproject.toml +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/requirements.txt +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/setup.cfg +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/addressbook with spaces.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/addressbook-with-dashes.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/addressbook.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/all-types.binary +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/all-types.packed +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/all-types.txt +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/all_types.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/annotations.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/bar.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/foo.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/schemas/child.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/schemas/parent.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_capability.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_capability.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_capability_context.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_context_manager.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_examples.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_large_read.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_large_read.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_load.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_memory_handling.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_object.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_regression.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_response.capnp +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_response.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_rpc.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_rpc_calculator.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_schema.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_serialization.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/test/test_struct.py +0 -0
- {pycapnp-2.1.0 → pycapnp-2.2.0}/tox.ini +0 -0
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## v2.2.0 (2025-09-12)
|
|
2
|
+
- Add binary support in dictionaries via base64 encoding (#351)
|
|
3
|
+
- Add structure-free read_multiple_bytes_packed (#378)
|
|
4
|
+
- Support python custom message builder and make Data field's type return MemoryView (#380)
|
|
5
|
+
|
|
1
6
|
## v2.1.0 (2025-09-04)
|
|
2
7
|
- Add Python 3.13 support
|
|
3
8
|
* Python 3.8 is still enabled but will be disabled if changes are needed that prevent compatibility with newer versions of Python (e.g. 3.14)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycapnp
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: A cython wrapping of the C++ Cap'n Proto library
|
|
5
5
|
Home-page: https://github.com/capnproto/pycapnp
|
|
6
|
-
Download-URL: https://github.com/haata/pycapnp/archive/v2.
|
|
6
|
+
Download-URL: https://github.com/haata/pycapnp/archive/v2.2.0.zip
|
|
7
7
|
Author: Jacob Alexander
|
|
8
8
|
Author-email: haata@kiibohd.com
|
|
9
9
|
License: BSD-2-Clause
|
|
@@ -259,6 +259,11 @@ if __name__ == '__main__':
|
|
|
259
259
|
|
|
260
260
|
Changelog
|
|
261
261
|
=============
|
|
262
|
+
## v2.2.0 (2025-09-12)
|
|
263
|
+
- Add binary support in dictionaries via base64 encoding (#351)
|
|
264
|
+
- Add structure-free read_multiple_bytes_packed (#378)
|
|
265
|
+
- Support python custom message builder and make Data field's type return MemoryView (#380)
|
|
266
|
+
|
|
262
267
|
## v2.1.0 (2025-09-04)
|
|
263
268
|
- Add Python 3.13 support
|
|
264
269
|
* Python 3.8 is still enabled but will be disabled if changes are needed that prevent compatibility with newer versions of Python (e.g. 3.14)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#include "PyCustomMessageBuilder.h"
|
|
2
|
+
#include <stdexcept>
|
|
3
|
+
|
|
4
|
+
namespace capnp {
|
|
5
|
+
|
|
6
|
+
PyCustomMessageBuilder::PyCustomMessageBuilder(
|
|
7
|
+
PyObject* allocateSegmentCallable, uint firstSegmentWords)
|
|
8
|
+
: allocateSegmentCallable(allocateSegmentCallable), firstSize(firstSegmentWords)
|
|
9
|
+
{
|
|
10
|
+
KJ_REQUIRE(PyCallable_Check(allocateSegmentCallable),
|
|
11
|
+
"allocateSegmentCallable must be callable");
|
|
12
|
+
Py_INCREF(allocateSegmentCallable);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
PyCustomMessageBuilder::~PyCustomMessageBuilder() noexcept(false) {
|
|
16
|
+
PyGILState_STATE gstate = PyGILState_Ensure();
|
|
17
|
+
|
|
18
|
+
for (auto* obj : allocatedBuffers) {
|
|
19
|
+
Py_DECREF(obj);
|
|
20
|
+
}
|
|
21
|
+
allocatedBuffers.clear();
|
|
22
|
+
|
|
23
|
+
Py_DECREF(allocateSegmentCallable);
|
|
24
|
+
PyGILState_Release(gstate);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
kj::ArrayPtr<capnp::word> PyCustomMessageBuilder::allocateSegment(capnp::uint minimumSize) {
|
|
28
|
+
PyGILState_STATE gstate = PyGILState_Ensure();
|
|
29
|
+
KJ_DEFER({ PyGILState_Release(gstate); });
|
|
30
|
+
if (curSize == 0) {
|
|
31
|
+
minimumSize = kj::max(minimumSize, firstSize);
|
|
32
|
+
}
|
|
33
|
+
PyObject* pyBufObj = PyObject_CallFunction(allocateSegmentCallable, "I", minimumSize);
|
|
34
|
+
KJ_REQUIRE(pyBufObj, "PyCustomMessageBuilder: allocateSegment failed");
|
|
35
|
+
allocatedBuffers.push_back(pyBufObj);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
Py_buffer view;
|
|
39
|
+
int bufRes = PyObject_GetBuffer(pyBufObj, &view, PyBUF_SIMPLE);
|
|
40
|
+
KJ_REQUIRE(bufRes == 0, "PyCustomMessageBuilder: object does not support buffer protocol");
|
|
41
|
+
KJ_DEFER({ PyBuffer_Release(&view); });
|
|
42
|
+
|
|
43
|
+
size_t byteCount = view.len;
|
|
44
|
+
size_t wordCount = byteCount / sizeof(capnp::word);
|
|
45
|
+
KJ_REQUIRE(wordCount >= minimumSize, "PyCustomMessageBuilder: buffer too small for minimumSize");
|
|
46
|
+
curSize += wordCount;
|
|
47
|
+
return kj::arrayPtr(reinterpret_cast<capnp::word*>(view.buf), wordCount);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
@@ -714,6 +714,11 @@ cdef extern from "capnp/message.h" namespace " ::capnp":
|
|
|
714
714
|
enum Void:
|
|
715
715
|
VOID
|
|
716
716
|
|
|
717
|
+
cdef extern from "PyCustomMessageBuilder.h" namespace " ::capnp":
|
|
718
|
+
cdef cppclass PyCustomMessageBuilder(MessageBuilder):
|
|
719
|
+
PyCustomMessageBuilder(PyObject* allocateSegmentCallable)
|
|
720
|
+
PyCustomMessageBuilder(PyObject* allocateSegmentCallable, int firstSegmentSize)
|
|
721
|
+
|
|
717
722
|
cdef extern from "capnp/common.h" namespace " ::capnp":
|
|
718
723
|
cdef cppclass word nogil:
|
|
719
724
|
pass
|