Commit b063660
authored
Add vendored Flatbuffers (#1761)
* 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
* Exclude vendored flatbuffers from ruff linting
- Add flatbuffers/* to ruff exclude list (vendored Python runtime)
- Add deps/* to ruff exclude list (git submodules)
- Prevents linting errors from upstream Google Flatbuffers code
- Consistent with zlmdb approach
Fixes code quality checks failing on E743 in flexbuffers.py
* Add permessage-brotli WebSocket compression support
Implements RFC 7692-style Brotli compression for WebSocket messages:
**New Features:**
- NEW: autobahn/websocket/compress_brotli.py - Full permessage-brotli implementation
- Follows exact same pattern as existing compress_snappy.py and compress_bzip2.py
- Registered in PERMESSAGE_COMPRESSION_EXTENSION registry
**Platform-Optimized Dependencies:**
- CPython: Uses 'brotli' package (CPyExt, 40 binary wheels for 3.11-3.14)
- PyPy: Uses 'brotlicffi' package (CFFI, 20 binary wheels for PyPy 3.11+)
- Aligns with project CFFI policy for PyPy compatibility
**Implementation Details:**
- Extension name: 'permessage-brotli'
- Supports client_no_context_takeover and server_no_context_takeover parameters
- Uses brotli.Compressor() with process()/finish() API
- Uses brotli.Decompressor() with process() API
- Context takeover control for memory-efficient streaming
**Compression Support Summary:**
After this change, autobahn[compress] provides:
- permessage-deflate: Always available (Python stdlib zlib)
- permessage-bzip2: Optional (requires bz2 in Python build)
- permessage-snappy: Optional (requires manual python-snappy install)
- permessage-brotli: NEW - Included with binary wheels (CPython + PyPy)
**Binary Wheel Coverage:**
- brotli: 40 wheels (Linux/macOS/Windows x86_64+ARM64, CPython 3.11-3.14)
- brotlicffi: 20 wheels (Linux/macOS/Windows, PyPy 3.11+)
python-snappy remains optional (no binary wheels) - users install separately if needed.
Part of #1760 - Batteries-included dependencies strategy
* Update README: WebSocket compression section with Brotli details
Enhanced 'WebSocket Acceleration and Compression' section:
**Acceleration (Deprecated):**
- Marked 'accelerate' as deprecated
- Explains NVX (Native Vector Extensions) supersedes wsaccel
- Points to NVX section for SIMD-accelerated WebSocket operations
**Compression (Expanded):**
- Comprehensive table of all compression methods:
- permessage-deflate (always available, RFC 7692)
- permessage-brotli (NEW, recommended, RFC 7932)
- permessage-bzip2 (optional)
- permessage-snappy (manual install)
- Detailed Brotli section:
- Platform-optimized: brotli (CPython) / brotlicffi (PyPy)
- Advantages: superior compression, binary wheels, IETF standard
- Full binary wheel coverage for all platforms
- Resources with all relevant links:
- RFC 7932 (Brotli spec)
- Google Brotli GitHub
- brotlicffi GitHub
- PyPI: brotlicffi
- WAMP protocol issue #555
- Note on Snappy explaining manual install requirement
Part of #1760
* Add check-compressors and check-serializers just recipes
- check-compressors: Verifies all WebSocket compression methods are available
- check-serializers: Verifies all WAMP serializers are available
- Both recipes print class mappings for each extension/serializer
- Integrated into main 'check' recipe for CI/CD workflow
Expected output:
- Compressors: permessage-deflate, permessage-bzip2, permessage-brotli
- Serializers: json, msgpack, cbor, ubjson, flatbuffers
Resolves part of batteries-included serializers feature (#1760)
* Add 'expect' parameter to check-compressors and check-serializers recipes
- Both recipes now accept optional 'expect' parameter with comma-separated list
- Validates actual available items match expected list exactly
- Shows clear error message with missing/extra items on mismatch
- Exits with error code 1 if validation fails
Usage examples:
just check-compressors "" "permessage-deflate, permessage-bzip2, permessage-brotli"
just check-serializers "" "json, msgpack, cbor, ubjson, flatbuffers"
Error output example:
Expected: cbor json msgpack
Actual: cbor flatbuffers json msgpack ubjson
Missing:
Extra: flatbuffers ubjson
Enables strict CI/CD validation of batteries-included features (#1760)
* polish check-serializers and check-compressors recipe output
* Add comprehensive dependency analysis section to README
New section documents complete dependency strategy:
Core Dependencies:
- txaio, cryptography, hyperlink - all with excellent wheel coverage
WAMP Serializers (Batteries Included):
- All 5 serializers (json, msgpack, cbor2, ubjson, flatbuffers) documented
- Flatbuffers confirmed as vendored (zero external dependency)
- Platform-optimized: msgpack (CPython) vs u-msgpack-python (PyPy)
WebSocket Compression:
- permessage-deflate (stdlib zlib) - always available
- permessage-brotli (brotli/brotlicffi) - 40+/20+ wheels, RFC 7932
- permessage-bzip2 (stdlib bz2) - always available
- permessage-snappy (optional) - no wheels, manual install
Optional Extras:
- twisted: All pure Python/universal wheels
- encryption: All with excellent coverage including PyPy
- scram: argon2-cffi with CFFI wheels including PyPy
- nvx: Our own CFFI-based SIMD implementation
Platform Coverage:
- Linux (glibc/musl), macOS, Windows
- x86_64, ARM64 (Apple Silicon, AWS Graviton)
- Python 3.11-3.14 (including free-threaded 3.14t)
- CPython and PyPy 3.11+
Verdict: All goals achieved - batteries included, CFFI everywhere,
comprehensive binary wheel coverage, zero system dependencies.
Nothing more to optimize or wish for.
Resolves documentation for #17601 parent be24de7 commit b063660
File tree
31 files changed
+5732
-37
lines changed- autobahn
- websocket
- deps
- flatbuffers
- reflection
31 files changed
+5732
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
287 | 331 | | |
288 | 332 | | |
289 | 333 | | |
| |||
321 | 365 | | |
322 | 366 | | |
323 | 367 | | |
324 | | - | |
325 | | - | |
| 368 | + | |
326 | 369 | | |
327 | | - | |
328 | | - | |
| 370 | + | |
329 | 371 | | |
330 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
331 | 402 | | |
332 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
333 | 409 | | |
334 | | - | |
| 410 | + | |
335 | 411 | | |
336 | | - | |
| 412 | + | |
337 | 413 | | |
338 | | - | |
| 414 | + | |
339 | 415 | | |
340 | | - | |
341 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
342 | 419 | | |
343 | 420 | | |
344 | 421 | | |
345 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
346 | 546 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 547 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
0 commit comments