pycapnp 2.2.2__tar.gz → 2.2.4__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 (107) hide show
  1. {pycapnp-2.2.2 → pycapnp-2.2.4}/CHANGELOG.md +15 -0
  2. {pycapnp-2.2.2/pycapnp.egg-info → pycapnp-2.2.4}/PKG-INFO +69 -5
  3. {pycapnp-2.2.2 → pycapnp-2.2.4}/README.md +48 -1
  4. {pycapnp-2.2.2 → pycapnp-2.2.4}/_custom_build/backend.py +1 -3
  5. {pycapnp-2.2.2 → pycapnp-2.2.4}/buildutils/bundle.py +1 -2
  6. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/__init__.py +0 -1
  7. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/_gen.py +5 -19
  8. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/capabilityHelper.cpp +3 -0
  9. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/capnp.cpp +7692 -7799
  10. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/capnp.pyx +52 -13
  11. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/capnp_api.h +23 -23
  12. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/version.py +2 -2
  13. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_calculator_client.py +1 -3
  14. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_calculator_server.py +1 -4
  15. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_reconnecting_ssl_client.py +3 -9
  16. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_server.py +1 -4
  17. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_socket_message_server.py +1 -3
  18. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_ssl_calculator_client.py +5 -14
  19. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_ssl_calculator_server.py +3 -10
  20. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_ssl_client.py +4 -10
  21. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_ssl_server.py +3 -10
  22. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/py_custom_message_builder.py +22 -7
  23. {pycapnp-2.2.2 → pycapnp-2.2.4/pycapnp.egg-info}/PKG-INFO +69 -5
  24. {pycapnp-2.2.2 → pycapnp-2.2.4}/pycapnp.egg-info/SOURCES.txt +1 -2
  25. pycapnp-2.2.4/pycapnp.egg-info/requires.txt +1 -0
  26. pycapnp-2.2.4/pyproject.toml +71 -0
  27. {pycapnp-2.2.2 → pycapnp-2.2.4}/setup.py +8 -13
  28. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_async_write_large_payload.py +2 -6
  29. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_capability_context.py +1 -3
  30. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_examples.py +3 -9
  31. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_get_data_view.py +3 -5
  32. pycapnp-2.2.4/test/test_py_custom_message_builder.py +79 -0
  33. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_regression.py +11 -33
  34. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_schema.py +2 -6
  35. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_serialization.py +21 -3
  36. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_struct.py +7 -21
  37. pycapnp-2.2.2/Pipfile +0 -16
  38. pycapnp-2.2.2/pyproject.toml +0 -7
  39. pycapnp-2.2.2/requirements.txt +0 -11
  40. pycapnp-2.2.2/test/test_py_custom_message_builder.py +0 -48
  41. {pycapnp-2.2.2 → pycapnp-2.2.4}/LICENSE.md +0 -0
  42. {pycapnp-2.2.2 → pycapnp-2.2.4}/MANIFEST.in +0 -0
  43. {pycapnp-2.2.2 → pycapnp-2.2.4}/buildutils/__init__.py +0 -0
  44. {pycapnp-2.2.2 → pycapnp-2.2.4}/buildutils/build.py +0 -0
  45. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/__init__.pxd +0 -0
  46. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/__init__.pxd +0 -0
  47. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/capabilityHelper.h +0 -0
  48. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/checkCompiler.h +0 -0
  49. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/deserialize.h +0 -0
  50. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/fixMaybe.h +0 -0
  51. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/helpers.pxd +0 -0
  52. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/non_circular.pxd +0 -0
  53. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/rpcHelper.h +0 -0
  54. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/helpers/serialize.h +0 -0
  55. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/includes/PyCustomMessageBuilder.cpp +0 -0
  56. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/includes/PyCustomMessageBuilder.h +0 -0
  57. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/includes/__init__.pxd +0 -0
  58. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/includes/capnp_cpp.pxd +0 -0
  59. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/includes/schema_cpp.pxd +0 -0
  60. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/includes/types.pxd +0 -0
  61. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/__init__.pxd +0 -0
  62. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/__init__.py +0 -0
  63. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/capnp.pxd +0 -0
  64. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/lib/pickle_helper.py +0 -0
  65. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/templates/module.pyx +0 -0
  66. {pycapnp-2.2.2 → pycapnp-2.2.4}/capnp/templates/setup.py.tmpl +0 -0
  67. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/addressbook.capnp +0 -0
  68. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/addressbook.py +0 -0
  69. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_client.py +0 -0
  70. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/async_socket_message_client.py +0 -0
  71. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/calculator.capnp +0 -0
  72. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/selfsigned.cert +0 -0
  73. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/selfsigned.key +0 -0
  74. {pycapnp-2.2.2 → pycapnp-2.2.4}/examples/thread.capnp +0 -0
  75. {pycapnp-2.2.2 → pycapnp-2.2.4}/pycapnp.egg-info/dependency_links.txt +0 -0
  76. {pycapnp-2.2.2 → pycapnp-2.2.4}/pycapnp.egg-info/entry_points.txt +0 -0
  77. {pycapnp-2.2.2 → pycapnp-2.2.4}/pycapnp.egg-info/top_level.txt +0 -0
  78. {pycapnp-2.2.2 → pycapnp-2.2.4}/setup.cfg +0 -0
  79. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/addressbook with spaces.capnp +0 -0
  80. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/addressbook-with-dashes.capnp +0 -0
  81. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/addressbook.capnp +0 -0
  82. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/all-types.binary +0 -0
  83. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/all-types.packed +0 -0
  84. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/all-types.txt +0 -0
  85. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/all_types.capnp +0 -0
  86. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/annotations.capnp +0 -0
  87. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/bar.capnp +0 -0
  88. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/blob_test.capnp +0 -0
  89. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/foo.capnp +0 -0
  90. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/schemas/child.capnp +0 -0
  91. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/schemas/parent.capnp +0 -0
  92. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_blob_to_dict_base64.py +0 -0
  93. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_capability.capnp +0 -0
  94. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_capability.py +0 -0
  95. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_context_manager.py +0 -0
  96. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_large_read.capnp +0 -0
  97. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_large_read.py +0 -0
  98. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_load.py +0 -0
  99. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_memory_handling.py +0 -0
  100. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_object.py +0 -0
  101. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_response.capnp +0 -0
  102. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_response.py +0 -0
  103. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_rpc.py +0 -0
  104. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_rpc_calculator.py +0 -0
  105. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_structs_sequence.capnp +0 -0
  106. {pycapnp-2.2.2 → pycapnp-2.2.4}/test/test_structs_sequence.py +0 -0
  107. {pycapnp-2.2.2 → pycapnp-2.2.4}/tox.ini +0 -0
@@ -1,3 +1,18 @@
1
+ ## v2.2.4 (2026-07-03)
2
+ - Fix memory leak in `_DynamicCapabilityClient._send_helper()` (#398)
3
+ - Fix SIGSEGV (NULL pointer dereference) on malformed Text field
4
+ - Update default bundled capnproto to 1.4.0
5
+ - Migrate project dependency management, testing, and CI to `uv`
6
+ - Consolidate configurations into `pyproject.toml` (removed `Pipfile` and `requirements.txt`)
7
+ - Apply small ruff linting fixes
8
+
9
+ ## v2.2.3 (2026-05-30)
10
+ - Fix test failures on Python 3.14 (#394)
11
+ - Refine documentation for PyCustomMessageBuilder (#395)
12
+ - Replace black and flake8 with ruff for linting and formatting
13
+ - ci: deploy docs to gh-pages on tagged releases
14
+ - Add scripts/release-pypi.sh for downloading CI artifacts and uploading to PyPI
15
+
1
16
  ## v2.2.2 (2026-01-16)
2
17
  - Revert Data fields to bytes and add get_data_as_view for zero-copy access (#390)
3
18
  - 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.4
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/capnproto/pycapnp/archive/v2.2.4.zip
7
7
  Author: Jacob Alexander
8
8
  Author-email: haata@kiibohd.com
9
9
  License: BSD-2-Clause
@@ -15,16 +15,18 @@ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
15
15
  Classifier: Operating System :: POSIX
16
16
  Classifier: Programming Language :: C++
17
17
  Classifier: Programming Language :: Cython
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
22
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
23
24
  Classifier: Programming Language :: Python :: Implementation :: PyPy
24
25
  Classifier: Topic :: Communications
25
- Requires-Python: >=3.8
26
+ Requires-Python: >=3.9
26
27
  Description-Content-Type: text/markdown
27
28
  License-File: LICENSE.md
29
+ Requires-Dist: jinja2
28
30
  Dynamic: author
29
31
  Dynamic: author-email
30
32
  Dynamic: classifier
@@ -117,7 +119,7 @@ While not directly supported by pycapnp, a tool has been created to help generat
117
119
 
118
120
  ## Python Versions
119
121
 
120
- Python 3.8+ is supported.
122
+ Python 3.9+ is supported.
121
123
 
122
124
 
123
125
  ## Development
@@ -140,6 +142,53 @@ Building a Python wheel distributiion
140
142
  pip wheel .
141
143
  ```
142
144
 
145
+
146
+ ### Releasing to PyPI
147
+
148
+ Wheels and the sdist are built by the `Build` GitHub Actions workflow
149
+ (`.github/workflows/wheels.yml`) for every push, including tag pushes. The
150
+ `scripts/release-pypi.sh` helper downloads those artifacts for a given tag (or
151
+ explicit run ID) and uploads them to PyPI via `twine`.
152
+
153
+ Typical release flow:
154
+
155
+ ```bash
156
+ git tag v2.2.1
157
+ git push origin v2.2.1
158
+ # wait for the "Build" workflow run to finish successfully on GitHub
159
+
160
+ # Download artifacts and upload to PyPI (creates dist_221/ by default).
161
+ scripts/release-pypi.sh v2.2.1
162
+
163
+ # Or, target a specific Actions run id:
164
+ scripts/release-pypi.sh 1234567890
165
+
166
+ # Dry run: upload to TestPyPI (https://test.pypi.org) instead of real PyPI.
167
+ # Useful for validating the release flow end-to-end before pushing to
168
+ # production. Requires a TestPyPI account + API token configured in
169
+ # ~/.pypirc under a [testpypi] section. See
170
+ # https://packaging.python.org/en/latest/guides/using-testpypi/ .
171
+ scripts/release-pypi.sh v2.2.1 --test
172
+ ```
173
+
174
+ Requirements on the release machine:
175
+
176
+ - `gh` CLI, authenticated (`gh auth login`)
177
+ - `python3` (the script creates `.venv-release/` and installs `twine` into it)
178
+ - PyPI credentials available to `twine`, e.g. `TWINE_USERNAME=__token__` and
179
+ `TWINE_PASSWORD=<api-token>`, or a configured `~/.pypirc`
180
+
181
+ The script:
182
+
183
+ 1. Resolves the latest successful `wheels.yml` run for the tag (or uses the
184
+ given run ID).
185
+ 2. Downloads `cibw-*` artifacts and flattens all `*.whl` / `*.tar.gz` files
186
+ into the output directory (default `dist_<digits>` for tags,
187
+ `dist_run_<id>` for run IDs; pass a second arg to override, and `--force`
188
+ to reuse a non-empty directory).
189
+ 3. Runs `twine check`, prints the file list, and prompts before running
190
+ `twine upload`.
191
+
143
192
  ## Documentation/Example
144
193
 
145
194
  There is some basic documentation [here](http://capnproto.github.io/pycapnp/).
@@ -259,6 +308,21 @@ if __name__ == '__main__':
259
308
 
260
309
  Changelog
261
310
  =============
311
+ ## v2.2.4 (2026-07-03)
312
+ - Fix memory leak in `_DynamicCapabilityClient._send_helper()` (#398)
313
+ - Fix SIGSEGV (NULL pointer dereference) on malformed Text field
314
+ - Update default bundled capnproto to 1.4.0
315
+ - Migrate project dependency management, testing, and CI to `uv`
316
+ - Consolidate configurations into `pyproject.toml` (removed `Pipfile` and `requirements.txt`)
317
+ - Apply small ruff linting fixes
318
+
319
+ ## v2.2.3 (2026-05-30)
320
+ - Fix test failures on Python 3.14 (#394)
321
+ - Refine documentation for PyCustomMessageBuilder (#395)
322
+ - Replace black and flake8 with ruff for linting and formatting
323
+ - ci: deploy docs to gh-pages on tagged releases
324
+ - Add scripts/release-pypi.sh for downloading CI artifacts and uploading to PyPI
325
+
262
326
  ## v2.2.2 (2026-01-16)
263
327
  - Revert Data fields to bytes and add get_data_as_view for zero-copy access (#390)
264
328
  - Fix use-after-free in async write causing corruption with large payloads (#392)
@@ -77,7 +77,7 @@ While not directly supported by pycapnp, a tool has been created to help generat
77
77
 
78
78
  ## Python Versions
79
79
 
80
- Python 3.8+ is supported.
80
+ Python 3.9+ is supported.
81
81
 
82
82
 
83
83
  ## Development
@@ -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
@@ -26,7 +25,7 @@ pjoin = os.path.join
26
25
  #
27
26
 
28
27
 
29
- bundled_version = (1, 0, 1)
28
+ bundled_version = (1, 4, 0)
30
29
  libcapnp_name = "capnproto-c++-%i.%i.%i.tar.gz" % (bundled_version)
31
30
  libcapnp_url = "https://capnproto.org/" + libcapnp_name
32
31
 
@@ -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()
@@ -16,6 +16,9 @@ void c_reraise_kj_exception() {
16
16
  }
17
17
  catch (kj::Exception& exn) {
18
18
  auto obj = wrap_kj_exception_for_reraise(exn);
19
+ if (obj == nullptr) {
20
+ return;
21
+ }
19
22
  PyErr_SetObject((PyObject*)obj->ob_type, obj);
20
23
  Py_DECREF(obj);
21
24
  }