Skip to content

Fix 1878#1879

Merged
oberstet merged 3 commits into
crossbario:masterfrom
oberstet:fix_1878
Jun 19, 2026
Merged

Fix 1878#1879
oberstet merged 3 commits into
crossbario:masterfrom
oberstet:fix_1878

Conversation

@oberstet

Copy link
Copy Markdown
Contributor

fixes #1878

oberstet added 2 commits June 19, 2026 13:20
Adds a guard for import-time annotation regressions that only surface on
CPython < 3.14 (where annotations are evaluated eagerly; PEP 649 defers it
on 3.14):

- src/autobahn/test/test_import_all.py: imports a curated set of
  framework-agnostic core modules (incl. autobahn.wamp.cryptosign) and
  asserts crypto extras are present so HAS_CRYPTOSIGN paths are exercised.
- justfile: `test-imports` recipe (installs .[all] so PyNaCl is present).
- .github/workflows/main.yml: `import-smoke` matrix job running the smoke
  test on cpy311/cpy312/cpy313/cpy314/pypy311. The main test suite runs on
  cpy314 only, so 3.11-3.13 import regressions were previously invisible.

This commit intentionally does NOT include the cryptosign fix yet: it is
expected to FAIL on CPython 3.11/3.12/3.13 (TypeError importing
autobahn.wamp.cryptosign) and pass on 3.14, demonstrating both the live
26.6.1 regression and that the guard catches it. The fix follows in the
next commit.

Note: This work was completed with AI assistance (Claude Code).
@oberstet

Copy link
Copy Markdown
Contributor Author

true/full TDD up into GH CICD, here is the plan:

image

@oberstet

Copy link
Copy Markdown
Contributor Author

crossbario#1878)

autobahn 26.6.1 regressed: importing autobahn.wamp.cryptosign raised
`TypeError: unsupported operand type(s) for |: 'str' and 'NoneType'` on
CPython 3.11/3.12/3.13 (3.14 unaffected via PEP 649). A ruff UP007 autofix
in crossbario#1843 rewrote `Optional["ISecurityModule"]` -> `"ISecurityModule" | None`
in a module without `from __future__ import annotations`, so the string
forward-reference union was evaluated eagerly at class-definition time. This
broke WAMP-cryptosign and any importer with crypto deps present (xbr,
Crossbar.io) on CPython < 3.14.

Fix: add `from __future__ import annotations` to cryptosign.py to defer
annotation evaluation (audit confirms this was the only affected line).
Bump version 26.6.1 -> 26.6.2 and add the changelog entry.

With this fix the import-smoke job added in the previous commit goes green
across cpy311/cpy312/cpy313/cpy314/pypy311 (it failed on 3.11-3.13 before).

Note: This work was completed with AI assistance (Claude Code).
@oberstet

Copy link
Copy Markdown
Contributor Author

awesome, part 2 turned it green (because it carried the fix, full red/green proven TDD!). merging.

@oberstet oberstet merged commit 522e83b into crossbario:master Jun 19, 2026
40 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] 26.6.1: import autobahn.wamp.cryptosign fails with TypeError on CPython 3.11–3.13 (regression from #1843)

1 participant