Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .audit/oberstet_rel25_12_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
- [x] I **did** use AI-assistance tools to *help* create this pull request.
- [x] I have read, understood and followed the project's AI_POLICY.md when creating code, documentation etc. for this pull request.

Submitted by: @oberstet
Date: 2025-12-05
Related issue(s): #1793
Branch: oberstet:rel25_12_1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ docs/_static/websocket/conformance/
docs/_static/flatbuffers/
.coverage.*
examples/benchmarks/serialization/build/

# Vendored flatbuffers - copied from deps/flatbuffers at build time
src/autobahn/flatbuffers/
35 changes: 31 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ link-system-packages venv="" vendors="": (create venv)
# -----------------------------------------------------------------------------

# Install this package and its run-time dependencies in a single environment (usage: `just install cpy314` or `just install`)
install venv="": (create venv)
install venv="": vendor-flatbuffers (create venv)
#!/usr/bin/env bash
set -e
VENV_NAME="{{ venv }}"
Expand All @@ -397,7 +397,7 @@ install venv="": (create venv)
${VENV_PYTHON} -m pip install .[all]

# Install this package in development (editable) mode and its run-time dependencies in a single environment (usage: `just install-dev cpy314` or `just install-dev`)
install-dev venv="": (create venv)
install-dev venv="": vendor-flatbuffers (create venv)
#!/usr/bin/env bash
set -e
VENV_NAME="{{ venv }}"
Expand Down Expand Up @@ -1107,8 +1107,28 @@ docs-clean:
# -- Building and Publishing
# -----------------------------------------------------------------------------

# Vendor flatbuffers Python runtime from git submodule into autobahn namespace.
# This avoids conflicts with the standalone 'flatbuffers' PyPI package.
# The vendored copy is gitignored and must be regenerated before build.
vendor-flatbuffers:
#!/usr/bin/env bash
set -e
SRC_DIR="deps/flatbuffers/python/flatbuffers"
DST_DIR="src/autobahn/flatbuffers"

if [ ! -d "${SRC_DIR}" ]; then
echo "ERROR: Flatbuffers submodule not found at ${SRC_DIR}"
echo "Run: git submodule update --init --recursive"
exit 1
fi

echo "==> Vendoring flatbuffers from ${SRC_DIR} to ${DST_DIR}..."
rm -rf "${DST_DIR}"
cp -r "${SRC_DIR}" "${DST_DIR}"
echo "==> Flatbuffers vendored successfully."

# Build wheel only (usage: `just build cpy314`)
build venv="": (install-build-tools venv)
build venv="": vendor-flatbuffers (install-build-tools venv)
#!/usr/bin/env bash
set -e
VENV_NAME="{{ venv }}"
Expand Down Expand Up @@ -1142,7 +1162,7 @@ build venv="": (install-build-tools venv)
ls -la dist/

# Build source distribution only (no wheels, no NVX flag needed)
build-sourcedist venv="": (install-build-tools venv)
build-sourcedist venv="": vendor-flatbuffers (install-build-tools venv)
#!/usr/bin/env bash
set -e
VENV_NAME="{{ venv }}"
Expand Down Expand Up @@ -1431,6 +1451,13 @@ build-fbs venv="": (install-tools venv)
find ./src/autobahn/wamp/gen/wamp/proto/ -name "*.py" -exec sed -i 's/from wamp\.proto\./from autobahn.wamp.gen.wamp.proto./g' {} +
echo "--> Fixed import paths in generated files"

# Fix flatbuffers imports to use vendored version under autobahn namespace
# Change: import flatbuffers -> from autobahn import flatbuffers
# Change: from flatbuffers.X import Y -> from autobahn.flatbuffers.X import Y
find ./src/autobahn/wamp/gen/ -name "*.py" -exec sed -i 's/^import flatbuffers$/from autobahn import flatbuffers/' {} +
find ./src/autobahn/wamp/gen/ -name "*.py" -exec sed -i 's/from flatbuffers\./from autobahn.flatbuffers./g' {} +
echo "--> Fixed flatbuffers imports to use autobahn.flatbuffers"

echo "Auto-formatting code using ruff after flatc code generation .."
"${VENV_PATH}/bin/ruff" format ./src/autobahn/wamp/gen/
"${VENV_PATH}/bin/ruff" check --fix ./src/autobahn/wamp/gen/
Expand Down
13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=80.9.0", "wheel", "cffi>=1.14.5; platform_python_implementation == 'CPython'"]
requires = ["setuptools>=80.9.0", "wheel", "cffi>=2.0.0"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -43,6 +43,7 @@ classifiers = [
dependencies = [
"txaio>=25.9.2",
"cryptography>=3.4.6",
"cffi>=2.0.0", # Required for NVX native extensions; works on both CPython and PyPy
"hyperlink>=21.0.0",
"importlib-resources>=5.0.0; python_version < '3.10'",
# WAMP serializers - batteries included for optimal WAMP protocol support
Expand Down Expand Up @@ -94,15 +95,13 @@ encryption = [

# Support for WAMP-SCRAM authentication
scram = [
"cffi>=1.14.5",
"argon2-cffi>=20.1.0",
"passlib>=1.7.4",
]

# Support native vector (SIMD) acceleration included with Autobahn
nvx = [
"cffi>=1.14.5",
]
# Note: cffi is now in base dependencies, this extra is kept for backwards compatibility
nvx = []

# WAMP serialization benchmarking (Python 3.11+ only, requires binary wheels)
# vmprof has wheels for CPython 3.11 and PyPy3 on Linux/macOS/Windows
Expand Down Expand Up @@ -176,7 +175,7 @@ wamp = "autobahn.__main__:_main"

[tool.setuptools.packages.find]
where = ["src"]
include = ["autobahn*", "twisted*", "flatbuffers*"]
include = ["autobahn*", "twisted*"]

[tool.setuptools]
include-package-data = true
Expand Down Expand Up @@ -215,7 +214,7 @@ exclude = [
"__pycache__",
"src/autobahn/wamp/message_fbs.py",
"src/autobahn/wamp/gen/*",
"src/flatbuffers/*", # Vendored Flatbuffers Python runtime
"src/autobahn/flatbuffers/*", # Vendored Flatbuffers Python runtime (copied from deps/flatbuffers at build time)
"deps/*", # Git submodules (includes deps/flatbuffers)
]

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/Map.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: wamp

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/Void.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: wamp

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/Abort.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthCraChallenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthCraRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthCraWelcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthCryptosignChallenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthCryptosignRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthCryptosignWelcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthScramChallenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthScramRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthScramWelcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthTicketChallenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthTicketRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/AuthTicketWelcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/Authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/BrokerFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/Call.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/CalleeFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/CallerFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/Cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/Challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
4 changes: 2 additions & 2 deletions src/autobahn/wamp/gen/wamp/proto/ClientRoles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()

Expand Down
Loading
Loading