pycapnp 2.2.2__tar.gz → 2.2.3__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.
Files changed (106) hide show
  1. {pycapnp-2.2.2 → pycapnp-2.2.3}/CHANGELOG.md +7 -0
  2. {pycapnp-2.2.2/pycapnp.egg-info → pycapnp-2.2.3}/PKG-INFO +56 -2
  3. {pycapnp-2.2.2 → pycapnp-2.2.3}/Pipfile +1 -2
  4. {pycapnp-2.2.2 → pycapnp-2.2.3}/README.md +47 -0
  5. {pycapnp-2.2.2 → pycapnp-2.2.3}/_custom_build/backend.py +1 -3
  6. {pycapnp-2.2.2 → pycapnp-2.2.3}/buildutils/bundle.py +0 -1
  7. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/__init__.py +0 -1
  8. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/_gen.py +5 -19
  9. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/capnp.cpp +6746 -7046
  10. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/capnp.pyx +48 -11
  11. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/capnp_api.h +23 -23
  12. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/version.py +2 -2
  13. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_calculator_client.py +1 -3
  14. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_calculator_server.py +1 -4
  15. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_reconnecting_ssl_client.py +3 -9
  16. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_server.py +1 -4
  17. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_socket_message_server.py +1 -3
  18. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_ssl_calculator_client.py +5 -14
  19. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_ssl_calculator_server.py +3 -10
  20. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_ssl_client.py +4 -10
  21. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_ssl_server.py +3 -10
  22. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/py_custom_message_builder.py +22 -7
  23. {pycapnp-2.2.2 → pycapnp-2.2.3/pycapnp.egg-info}/PKG-INFO +56 -2
  24. pycapnp-2.2.3/pyproject.toml +28 -0
  25. {pycapnp-2.2.2 → pycapnp-2.2.3}/requirements.txt +1 -2
  26. {pycapnp-2.2.2 → pycapnp-2.2.3}/setup.py +3 -10
  27. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_async_write_large_payload.py +2 -6
  28. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_capability_context.py +1 -3
  29. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_examples.py +3 -9
  30. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_get_data_view.py +3 -5
  31. pycapnp-2.2.3/test/test_py_custom_message_builder.py +79 -0
  32. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_regression.py +11 -33
  33. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_schema.py +2 -6
  34. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_serialization.py +1 -3
  35. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_struct.py +7 -21
  36. pycapnp-2.2.2/pyproject.toml +0 -7
  37. pycapnp-2.2.2/test/test_py_custom_message_builder.py +0 -48
  38. {pycapnp-2.2.2 → pycapnp-2.2.3}/LICENSE.md +0 -0
  39. {pycapnp-2.2.2 → pycapnp-2.2.3}/MANIFEST.in +0 -0
  40. {pycapnp-2.2.2 → pycapnp-2.2.3}/buildutils/__init__.py +0 -0
  41. {pycapnp-2.2.2 → pycapnp-2.2.3}/buildutils/build.py +0 -0
  42. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/__init__.pxd +0 -0
  43. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/__init__.pxd +0 -0
  44. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/capabilityHelper.cpp +0 -0
  45. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/capabilityHelper.h +0 -0
  46. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/checkCompiler.h +0 -0
  47. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/deserialize.h +0 -0
  48. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/fixMaybe.h +0 -0
  49. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/helpers.pxd +0 -0
  50. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/non_circular.pxd +0 -0
  51. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/rpcHelper.h +0 -0
  52. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/helpers/serialize.h +0 -0
  53. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/includes/PyCustomMessageBuilder.cpp +0 -0
  54. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/includes/PyCustomMessageBuilder.h +0 -0
  55. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/includes/__init__.pxd +0 -0
  56. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/includes/capnp_cpp.pxd +0 -0
  57. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/includes/schema_cpp.pxd +0 -0
  58. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/includes/types.pxd +0 -0
  59. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/__init__.pxd +0 -0
  60. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/__init__.py +0 -0
  61. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/capnp.pxd +0 -0
  62. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/lib/pickle_helper.py +0 -0
  63. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/templates/module.pyx +0 -0
  64. {pycapnp-2.2.2 → pycapnp-2.2.3}/capnp/templates/setup.py.tmpl +0 -0
  65. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/addressbook.capnp +0 -0
  66. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/addressbook.py +0 -0
  67. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_client.py +0 -0
  68. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/async_socket_message_client.py +0 -0
  69. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/calculator.capnp +0 -0
  70. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/selfsigned.cert +0 -0
  71. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/selfsigned.key +0 -0
  72. {pycapnp-2.2.2 → pycapnp-2.2.3}/examples/thread.capnp +0 -0
  73. {pycapnp-2.2.2 → pycapnp-2.2.3}/pycapnp.egg-info/SOURCES.txt +0 -0
  74. {pycapnp-2.2.2 → pycapnp-2.2.3}/pycapnp.egg-info/dependency_links.txt +0 -0
  75. {pycapnp-2.2.2 → pycapnp-2.2.3}/pycapnp.egg-info/entry_points.txt +0 -0
  76. {pycapnp-2.2.2 → pycapnp-2.2.3}/pycapnp.egg-info/top_level.txt +0 -0
  77. {pycapnp-2.2.2 → pycapnp-2.2.3}/setup.cfg +0 -0
  78. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/addressbook with spaces.capnp +0 -0
  79. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/addressbook-with-dashes.capnp +0 -0
  80. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/addressbook.capnp +0 -0
  81. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/all-types.binary +0 -0
  82. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/all-types.packed +0 -0
  83. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/all-types.txt +0 -0
  84. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/all_types.capnp +0 -0
  85. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/annotations.capnp +0 -0
  86. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/bar.capnp +0 -0
  87. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/blob_test.capnp +0 -0
  88. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/foo.capnp +0 -0
  89. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/schemas/child.capnp +0 -0
  90. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/schemas/parent.capnp +0 -0
  91. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_blob_to_dict_base64.py +0 -0
  92. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_capability.capnp +0 -0
  93. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_capability.py +0 -0
  94. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_context_manager.py +0 -0
  95. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_large_read.capnp +0 -0
  96. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_large_read.py +0 -0
  97. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_load.py +0 -0
  98. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_memory_handling.py +0 -0
  99. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_object.py +0 -0
  100. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_response.capnp +0 -0
  101. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_response.py +0 -0
  102. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_rpc.py +0 -0
  103. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_rpc_calculator.py +0 -0
  104. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_structs_sequence.capnp +0 -0
  105. {pycapnp-2.2.2 → pycapnp-2.2.3}/test/test_structs_sequence.py +0 -0
  106. {pycapnp-2.2.2 → pycapnp-2.2.3}/tox.ini +0 -0
@@ -1,3 +1,10 @@
1
+ ## v2.2.3 (2026-05-30)
2
+ - Fix test failures on Python 3.14 (#394)
3
+ - Refine documentation for PyCustomMessageBuilder (#395)
4
+ - Replace black and flake8 with ruff for linting and formatting
5
+ - ci: deploy docs to gh-pages on tagged releases
6
+ - Add scripts/release-pypi.sh for downloading CI artifacts and uploading to PyPI
7
+
1
8
  ## v2.2.2 (2026-01-16)
2
9
  - Revert Data fields to bytes and add get_data_as_view for zero-copy access (#390)
3
10
  - Fix use-after-free in async write causing corruption with large payloads (#392)
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycapnp
3
- Version: 2.2.2
3
+ Version: 2.2.3
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.2.2.zip
6
+ Download-URL: https://github.com/haata/pycapnp/archive/v2.2.3.zip
7
7
  Author: Jacob Alexander
8
8
  Author-email: haata@kiibohd.com
9
9
  License: BSD-2-Clause
@@ -140,6 +140,53 @@ Building a Python wheel distributiion
140
140
  pip wheel .
141
141
  ```
142
142
 
143
+
144
+ ### Releasing to PyPI
145
+
146
+ Wheels and the sdist are built by the `Build` GitHub Actions workflow
147
+ (`.github/workflows/wheels.yml`) for every push, including tag pushes. The
148
+ `scripts/release-pypi.sh` helper downloads those artifacts for a given tag (or
149
+ explicit run ID) and uploads them to PyPI via `twine`.
150
+
151
+ Typical release flow:
152
+
153
+ ```bash
154
+ git tag v2.2.1
155
+ git push origin v2.2.1
156
+ # wait for the "Build" workflow run to finish successfully on GitHub
157
+
158
+ # Download artifacts and upload to PyPI (creates dist_221/ by default).
159
+ scripts/release-pypi.sh v2.2.1
160
+
161
+ # Or, target a specific Actions run id:
162
+ scripts/release-pypi.sh 1234567890
163
+
164
+ # Dry run: upload to TestPyPI (https://test.pypi.org) instead of real PyPI.
165
+ # Useful for validating the release flow end-to-end before pushing to
166
+ # production. Requires a TestPyPI account + API token configured in
167
+ # ~/.pypirc under a [testpypi] section. See
168
+ # https://packaging.python.org/en/latest/guides/using-testpypi/ .
169
+ scripts/release-pypi.sh v2.2.1 --test
170
+ ```
171
+
172
+ Requirements on the release machine:
173
+
174
+ - `gh` CLI, authenticated (`gh auth login`)
175
+ - `python3` (the script creates `.venv-release/` and installs `twine` into it)
176
+ - PyPI credentials available to `twine`, e.g. `TWINE_USERNAME=__token__` and
177
+ `TWINE_PASSWORD=<api-token>`, or a configured `~/.pypirc`
178
+
179
+ The script:
180
+
181
+ 1. Resolves the latest successful `wheels.yml` run for the tag (or uses the
182
+ given run ID).
183
+ 2. Downloads `cibw-*` artifacts and flattens all `*.whl` / `*.tar.gz` files
184
+ into the output directory (default `dist_<digits>` for tags,
185
+ `dist_run_<id>` for run IDs; pass a second arg to override, and `--force`
186
+ to reuse a non-empty directory).
187
+ 3. Runs `twine check`, prints the file list, and prompts before running
188
+ `twine upload`.
189
+
143
190
  ## Documentation/Example
144
191
 
145
192
  There is some basic documentation [here](http://capnproto.github.io/pycapnp/).
@@ -259,6 +306,13 @@ if __name__ == '__main__':
259
306
 
260
307
  Changelog
261
308
  =============
309
+ ## v2.2.3 (2026-05-30)
310
+ - Fix test failures on Python 3.14 (#394)
311
+ - Refine documentation for PyCustomMessageBuilder (#395)
312
+ - Replace black and flake8 with ruff for linting and formatting
313
+ - ci: deploy docs to gh-pages on tagged releases
314
+ - Add scripts/release-pypi.sh for downloading CI artifacts and uploading to PyPI
315
+
262
316
  ## v2.2.2 (2026-01-16)
263
317
  - Revert Data fields to bytes and add get_data_as_view for zero-copy access (#390)
264
318
  - Fix use-after-free in async write causing corruption with large payloads (#392)
@@ -6,8 +6,7 @@ verify_ssl = true
6
6
  [packages]
7
7
  Cython = "<3"
8
8
  Jinja2 = "*"
9
- black = "*"
10
- flake8 = "*"
9
+ ruff = "*"
11
10
  pkgconfig = "*"
12
11
  pytest = "*"
13
12
  sphinx = "*"
@@ -100,6 +100,53 @@ Building a Python wheel distributiion
100
100
  pip wheel .
101
101
  ```
102
102
 
103
+
104
+ ### Releasing to PyPI
105
+
106
+ Wheels and the sdist are built by the `Build` GitHub Actions workflow
107
+ (`.github/workflows/wheels.yml`) for every push, including tag pushes. The
108
+ `scripts/release-pypi.sh` helper downloads those artifacts for a given tag (or
109
+ explicit run ID) and uploads them to PyPI via `twine`.
110
+
111
+ Typical release flow:
112
+
113
+ ```bash
114
+ git tag v2.2.1
115
+ git push origin v2.2.1
116
+ # wait for the "Build" workflow run to finish successfully on GitHub
117
+
118
+ # Download artifacts and upload to PyPI (creates dist_221/ by default).
119
+ scripts/release-pypi.sh v2.2.1
120
+
121
+ # Or, target a specific Actions run id:
122
+ scripts/release-pypi.sh 1234567890
123
+
124
+ # Dry run: upload to TestPyPI (https://test.pypi.org) instead of real PyPI.
125
+ # Useful for validating the release flow end-to-end before pushing to
126
+ # production. Requires a TestPyPI account + API token configured in
127
+ # ~/.pypirc under a [testpypi] section. See
128
+ # https://packaging.python.org/en/latest/guides/using-testpypi/ .
129
+ scripts/release-pypi.sh v2.2.1 --test
130
+ ```
131
+
132
+ Requirements on the release machine:
133
+
134
+ - `gh` CLI, authenticated (`gh auth login`)
135
+ - `python3` (the script creates `.venv-release/` and installs `twine` into it)
136
+ - PyPI credentials available to `twine`, e.g. `TWINE_USERNAME=__token__` and
137
+ `TWINE_PASSWORD=<api-token>`, or a configured `~/.pypirc`
138
+
139
+ The script:
140
+
141
+ 1. Resolves the latest successful `wheels.yml` run for the tag (or uses the
142
+ given run ID).
143
+ 2. Downloads `cibw-*` artifacts and flattens all `*.whl` / `*.tar.gz` files
144
+ into the output directory (default `dist_<digits>` for tags,
145
+ `dist_run_<id>` for run IDs; pass a second arg to override, and `--force`
146
+ to reuse a non-empty directory).
147
+ 3. Runs `twine check`, prints the file list, and prompts before running
148
+ `twine upload`.
149
+
103
150
  ## Documentation/Example
104
151
 
105
152
  There is some basic documentation [here](http://capnproto.github.io/pycapnp/).
@@ -21,9 +21,7 @@ class _CustomBuildMetaBackend(backend_class):
21
21
  sys.argv = sys.argv[:1] + ["build_ext"] + flags + sys.argv[1:]
22
22
  return super().run_setup(setup_script)
23
23
 
24
- def build_wheel(
25
- self, wheel_directory, config_settings=None, metadata_directory=None
26
- ):
24
+ def build_wheel(self, wheel_directory, config_settings=None, metadata_directory=None):
27
25
  self.config_settings = config_settings
28
26
  return super().build_wheel(wheel_directory, config_settings, metadata_directory)
29
27
 
@@ -10,7 +10,6 @@
10
10
  # Adapted for use in pycapnp from pyzmq. See https://github.com/zeromq/pyzmq
11
11
  # for original project.
12
12
 
13
-
14
13
  import fileinput # noqa
15
14
  import os
16
15
  import shutil
@@ -32,7 +32,6 @@ Example Usage::
32
32
  print(phone.type, ':', phone.number)
33
33
  """
34
34
 
35
- # flake8: noqa F401 F403 F405
36
35
  from .version import version as __version__
37
36
  from .lib.capnp import *
38
37
  from .lib.capnp import (
@@ -21,21 +21,13 @@ def main():
21
21
 
22
22
  code = schema_capnp.CodeGeneratorRequest.read(sys.stdin)
23
23
  code = code.to_dict()
24
- code["nodes"] = [
25
- node for node in code["nodes"] if "struct" in node and node["scopeId"] != 0
26
- ]
24
+ code["nodes"] = [node for node in code["nodes"] if "struct" in node and node["scopeId"] != 0]
27
25
  for node in code["nodes"]:
28
26
  displayName = node["displayName"]
29
27
  parent, path = displayName.split(":")
30
- node["module_path"] = (
31
- parent.replace(".", "_")
32
- + "."
33
- + ".".join([x[0].upper() + x[1:] for x in path.split(".")])
34
- )
28
+ node["module_path"] = parent.replace(".", "_") + "." + ".".join([x[0].upper() + x[1:] for x in path.split(".")])
35
29
  node["module_name"] = path.replace(".", "_")
36
- node["c_module_path"] = "::".join(
37
- [x[0].upper() + x[1:] for x in path.split(".")]
38
- )
30
+ node["c_module_path"] = "::".join([x[0].upper() + x[1:] for x in path.split(".")])
39
31
  node["schema"] = "_{}_Schema".format(node["module_name"])
40
32
  is_union = False
41
33
  for field in node["struct"]["fields"]:
@@ -63,18 +55,12 @@ def main():
63
55
  filename = f["filename"].replace(".", "_") + "_cython.pyx"
64
56
 
65
57
  file_code = dict(code)
66
- file_code["nodes"] = [
67
- node
68
- for node in file_code["nodes"]
69
- if node["displayName"].startswith(f["filename"])
70
- ]
58
+ file_code["nodes"] = [node for node in file_code["nodes"] if node["displayName"].startswith(f["filename"])]
71
59
  with open(filename, "w") as out:
72
60
  out.write(module.render(code=file_code, file=f, include_dir=include_dir))
73
61
 
74
62
  setup = env.get_template("setup.py.tmpl")
75
63
  with open("setup_capnp.py", "w") as out:
76
64
  out.write(setup.render(code=code))
77
- print(
78
- "You now need to build the cython module by running `python setup_capnp.py build_ext --inplace`."
79
- )
65
+ print("You now need to build the cython module by running `python setup_capnp.py build_ext --inplace`.")
80
66
  print()