Skip to content

Commit 53e6efe

Browse files
committed
Add Flatbuffers as git submodule and vendor Python runtime
- Add Google Flatbuffers as git submodule at deps/flatbuffers - Pinned to commit 95053e6a (v25.9.23-2, same as zlmdb) - Vendor Python runtime at root flatbuffers/ directory for packaging - Consistent with zlmdb approach (submodule + vendored copy) Part of #1760
1 parent be24de7 commit 53e6efe

28 files changed

+4855
-29
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule ".cicd"]
55
path = .cicd
66
url = https://github.com/wamp-proto/wamp-cicd.git
7+
[submodule "deps/flatbuffers"]
8+
path = deps/flatbuffers
9+
url = https://github.com/google/flatbuffers.git

README.md

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -321,31 +321,65 @@ masking) and UTF-8 validation.
321321

322322
### WAMP Serializers
323323

324-
- `serialization`: To install additional WAMP serializers: CBOR,
325-
MessagePack, UBJSON and Flatbuffers
324+
**As of v25.11.1, all WAMP serializers are included by default** - batteries included!
326325

327-
**Above is for advanced uses. In general we recommend to use CBOR
328-
where you can, and JSON (from the standard library) otherwise.**
326+
Autobahn|Python now ships with full support for all WAMP serializers out-of-the-box:
329327

330-
---
328+
- **JSON** (standard library) - always available
329+
- **MessagePack** - high-performance binary serialization
330+
- **CBOR** - IETF standard binary serialization (RFC 8949)
331+
- **UBJSON** - Universal Binary JSON
332+
- **Flatbuffers** - Google's zero-copy serialization (vendored)
333+
334+
#### Architecture & Performance
335+
336+
The serializer dependencies are optimized for both **CPython** and **PyPy**:
337+
338+
| Serializer | CPython | PyPy | Wheel Type | Notes |
339+
|------------|---------|------|------------|-------|
340+
| **json** | stdlib | stdlib | - | Always available |
341+
| **msgpack** | Binary wheel (C extension) | u-msgpack-python (pure Python) | Native + Universal | PyPy JIT makes pure Python faster than C |
342+
| **ujson** | Binary wheel | Binary wheel | Native | Available for both implementations |
343+
| **cbor2** | Binary wheel | Pure Python fallback | Native + Universal | Binary wheels + py3-none-any |
344+
| **ubjson** | Pure Python | Pure Python | Source | Set `PYUBJSON_NO_EXTENSION=1` to skip C build |
345+
| **flatbuffers** | Vendored | Vendored | Included | Always available, no external dependency |
346+
347+
**Key Design Principles:**
331348

332-
To install Autobahn with all available serializers:
349+
1. **Batteries Included**: All serializers available without extra install steps
350+
2. **PyPy Optimization**: Pure Python implementations leverage PyPy's JIT for superior performance
351+
3. **Binary Wheels**: Native wheels for all major platforms (Linux x86_64/ARM64, macOS x86_64/ARM64, Windows x86_64)
352+
4. **Zero System Pollution**: All dependencies install cleanly via wheels or pure Python
353+
5. **WAMP Compliance**: Full protocol support out-of-the-box
333354

334-
pip install autobahn[serializers]
355+
**Total Additional Size**: ~590KB (negligible compared to full application install)
335356

336-
or (development install)
357+
#### Platform Coverage
337358

338-
pip install -e .[serializers]
359+
All serializer dependencies provide binary wheels for:
360+
- **Linux**: x86_64, ARM64 (manylinux, musllinux)
361+
- **macOS**: x86_64 (Intel), ARM64 (Apple Silicon)
362+
- **Windows**: x86_64 (AMD64), ARM64
363+
- **Python**: 3.11, 3.12, 3.13, 3.14 (including 3.14t free-threaded)
364+
- **Implementations**: CPython, PyPy 3.11+
339365

340-
Further, to speed up JSON on CPython using `ujson`, set the
341-
environment variable:
366+
#### Backwards Compatibility
367+
368+
The `serialization` optional dependency is maintained for backwards compatibility:
369+
370+
pip install autobahn[serialization] # Still works, but now a no-op
371+
372+
#### ujson Acceleration
373+
374+
To speed up JSON on CPython using the faster `ujson`, set:
342375

343376
AUTOBAHN_USE_UJSON=1
344377

345-
Warning
378+
> **Warning**: Using `ujson` will break the ability of Autobahn to transport and translate binary application payloads in WAMP transparently. This ability depends on features of the standard library `json` module not available in `ujson`.
379+
380+
#### Recommendations
346381

347-
Using `ujson` (on both CPython and PyPy) will break the ability
348-
of Autobahn to transport and translate binary application
349-
payloads in WAMP transparently. This ability depends on features
350-
of the regular JSON standard library module not available on
351-
`ujson`.
382+
- **General use**: JSON (stdlib) or CBOR
383+
- **High performance**: MessagePack or Flatbuffers
384+
- **Strict standards**: CBOR (IETF RFC 8949)
385+
- **Zero-copy**: Flatbuffers (for large payloads)

autobahn/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
#
2525
###############################################################################
2626

27-
__version__ = "25.10.2"
27+
__version__ = "25.11.1"
2828

2929
__build__ = "00000000-0000000"

deps/flatbuffers

Submodule flatbuffers added at 95053e6

flatbuffers/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2014 Google Inc. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from . import util
16+
from ._version import __version__
17+
from .builder import Builder
18+
from .compat import range_func as compat_range
19+
from .table import Table

flatbuffers/_version.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2019 Google Inc. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Placeholder, to be updated during the release process
16+
# by the setup.py
17+
__version__ = "25.9.23"

0 commit comments

Comments
 (0)