Skip to content

Fix 1849#1855

Merged
oberstet merged 6 commits into
crossbario:masterfrom
oberstet:fix_1849
Jun 14, 2026
Merged

Fix 1849#1855
oberstet merged 6 commits into
crossbario:masterfrom
oberstet:fix_1849

Conversation

@oberstet

Copy link
Copy Markdown
Contributor

Description

fixes #1849


Related Issue(s)

Closes or relates to #1849


Checklist

  • I have referenced relevant issue numbers above
  • I have performed a self-review of my code and it follows
    the style guidelines of this project
  • I have added new or used existing tests that prove my fix
    is effective or that my feature works
  • I have added necessary documentation (if appropriate) and
    updated the changelog
  • I have added an AI assistance disclosure file (required!)
    in this PR

oberstet added 3 commits June 13, 2026 15:55
Fixes crossbario#1849: py-ubjson is unmaintained and ships no wheels, so
`pip install --only-binary :all:` for autobahn failed. The WAMP "ubjson"
serializer is now backed by bjdata (Binary JData), a maintained,
wheel-shipping successor.

- serializer.py / message.py: import bjdata as the "ubjson" backend
  (serializer id unchanged for transport negotiation).
- pyproject.toml: drop the unconditional py-ubjson dependency; bjdata is an
  OPTIONAL dependency in the `serialization` extra (it pulls in numpy, which
  we keep out of a minimal install). A minimal `pip install autobahn` now
  installs cleanly from wheels only.
- PyPy: set PYBJDATA_NO_EXTENSION=1 in the test recipes and CI (serdes) to use
  bjdata's JIT-friendly pure-Python path (also avoids its numpy-ABI-fragile
  C extension).

WIRE-LEVEL CHANGE: bjdata's octet encoding is NOT identical to the prior
py-ubjson/UBJSON bytes (unsigned-int markers, little-endian). The wamp-proto
UBJSON test vectors will be regenerated in a follow-up wamp-proto PR after the
next autobahn-python release; until then the serdes byte-vector conformance
suite excludes "ubjson" (round-trip + cross-serializer coverage is retained
via test_wamp_serializer.py). See the changelog.

Note: This work was completed with AI assistance (Claude Code).
…son refs (crossbario#1849)

Follow-up wording/doc fixes for the py-ubjson -> bjdata switch:

- README.md / docs/installation.rst: bjdata (like py-ubjson) is published
  sdist-only with no PyPI wheels and builds an optional C extension; document
  the optional `autobahn[serialization]` extra, PYBJDATA_NO_EXTENSION=1, and
  steer wheels-only/cross-arch users to cbor/msgpack. UBJSON is no longer
  described as "included by default".
- docs/changelog.rst: reframe the crossbario#1849 fix as "the binary-JSON dependency is
  now optional, so a base autobahn install is wheel-clean" (bjdata itself
  ships no wheels).
- serializer.py: drop the inaccurate "wheel-shipping" wording and state the
  sdist/C-extension reality.

Note: This work was completed with AI assistance (Claude Code).
oberstet added 3 commits June 13, 2026 19:44
…ossbario#1849)

bjdata's sdist build pulls numpy as an unconditional build dependency
(`oldest-supported-numpy` in build-system.requires, plus a top-level
`from numpy import get_include` in setup.py) even though it skips its C
extension on PyPy. On PyPy that numpy pin (1.23.2) has no wheel and fails to
compile, so `pip install autobahn[serialization]` cannot be installed on PyPy
at all -- this broke the wstest CI jobs. Reported upstream as NeuroJSON/pybj#6.

- pyproject.toml: restrict bjdata to CPython
  (`bjdata>=0.6.0; platform_python_implementation == 'CPython'`). On PyPy the
  UBJSON serializer is unavailable (graceful try/except ImportError); use
  cbor/msgpack instead.
- Remove the now-moot PyPy PYBJDATA_NO_EXTENSION lines from justfile and CI:
  the flag can't help, because the numpy build dependency is installed under
  PEP 517 build isolation before bjdata's setup.py is ever run.
- Update README, docs/installation.rst, docs/changelog.rst and the
  serializer.py comment to document bjdata as CPython-only, linking
  NeuroJSON/pybj#6.

Note: This work was completed with AI assistance (Claude Code).
wamp-proto#557 (the canonical WAMP conformance test-vector suite) was
squash-merged to wamp-proto master as d8389b8. Bump the .proto submodule to
pick it up. This brings in the BJData (bjdata) UBJSON byte vectors, so the
serdes conformance suite can be re-enabled for the "ubjson" serializer
(follow-up commit).

The serdes suite still passes (446) with "ubjson" currently excluded.

Refs: crossbario#1849.

Note: This work was completed with AI assistance (Claude Code).
…tors

With the wamp-proto vectors now carrying both the legacy py-ubjson and the new
bjdata/BJData byte representations for "ubjson" (.proto bumped in the previous
commit), re-enable the serializer in the byte-vector conformance suite:

- conftest: _VECTOR_EXCLUDED_SERIALIZERS is now empty (no serializer excluded).
- utils.require_decodable(): new helper implementing the "at least one must
  match" rule for the deserialize direction. A serializer's variant list may
  hold encodings produced by other implementations/versions that this backend
  cannot decode, or decodes to a valid-but-wrong message (py-ubjson bytes read
  as little-endian bjdata). It keeps variants whose decode re-serializes to a
  canonical variant (cosmetic variants + this backend's own encoding), falling
  back to decode-without-error for serializers whose re-serialization is not
  byte-canonical (flatbuffers). At least one variant must qualify.
- The 25 per-message test files use require_decodable() at their decode sites
  (deserialize-from-bytes, roundtrip, cross-serializer source) instead of
  iterating/indexing the raw variant list.

Serdes suite: 529 passed (up from 446 with ubjson excluded). On PyPy, bjdata
is unavailable so the ubjson serializer is simply not registered and these
tests do not run.

Refs: crossbario#1849.

Note: This work was completed with AI assistance (Claude Code).
@oberstet oberstet merged commit 4514e3e into crossbario:master Jun 14, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unable to install with only wheels due to py-ubjson dependency

1 participant