Autobahn|Python: Twisted import fix for older zope.interface

Contribution to Autobahn|Python , the WebSocket and WAMP (Web Application Messaging Protocol) implementation for Python’s Twisted and asyncio frameworks. The work fixes a regression that broke import autobahn.twisted on CPython 3.11–3.13 when an older zope.interface was installed. It also adds CI coverage so that version floors which are too low get caught before a release. The bug surfaced on a FreeBSD jail, where a freshly installed Buildbot worker would not start.

Since release 26.6.1, importing autobahn.twisted.util failed on CPython 3.11–3.13 when the installed zope.interface was older than 6.2:

TypeError: unsupported operand type(s) for |: 'InterfaceClass' and 'InterfaceClass'

An earlier linter-driven cleanup had rewritten Union[A, B] annotations to the A | B form. Without from __future__ import annotations, Python before 3.14 evaluates annotations when the module loads. Twisted interfaces such as ITransport and IProcessTransport are zope.interface InterfaceClass instances, and these support the | operator only from zope.interface 6.2 on. Autobahn still declared zope.interface>=5.2.0, and CI always installed a recent version, so nothing caught the gap. An earlier audit had looked only at quoted forward references ("X" | None), so it missed this variant.

Reported the issue with a one-line reproduction and the affected lines. The maintainer agreed with the analysis and invited a pull request for the fix:

The maintainer confirmed both points locally: the bug reproduces with zope.interface 5.5.2 on master and is gone with the fix, and 6.1 still fails while 6.2 works, so 6.2 is exactly the right floor.

The root cause was a version floor that nobody tested. To catch this class of bug, the PR adds:

Two packages had to be lifted above their lowest versions in the recipe: pyOpenSSL before 22.1.0 does not cap cryptography and breaks at import against current releases, and Twisted 22.10.0 uses import attrs while declaring an older attrs floor. Both are metadata problems in other projects, not in Autobahn, so the workarounds stay documented in the test recipe instead of raising Autobahn’s own floors. The new tests fail on the old code with zope.interface 5.5.2 and pass with the fix.

The first CI run failed in the combined coverage step: every Twisted module in the new test raised RuntimeError: Explicitly using 'asyncio' already. The asyncio half of the test suite runs with USE_ASYNCIO=1, and the child interpreters inherited it, so autobahn/__init__.py selected the asyncio backend before the Twisted binding could select its own. Following the review, the test now:

The Windows wheel builds also broke during the review. Since cryptography 50.0.2, its Windows PyPy wheel targets PyPy 8 only, while the project’s PyPy environment is pinned to PyPy 7.3. Pip therefore fell back to building cryptography from source and failed with “Could not find directory of OpenSSL installation”. A second commit extends the existing ARM64-only OpenSSL build step via vcpkg to Windows x86_64 too.

The PR was merged on 2026-10-06. The broader cleanup, adding from __future__ import annotations to every typed module and enforcing it with ruff, is tracked as a separate issue .

https://github.com/crossbario/autobahn-python/pull/1959