Fix 1878#1879
Merged
Merged
Conversation
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).
Contributor
Author
Contributor
Author
|
awesome, part 1 (https://github.com/crossbario/autobahn-python/actions/runs/27823532749/job/82342211697?pr=1879) failed as expected:
|
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).
Contributor
Author
|
awesome, part 2 turned it green (because it carried the fix, full red/green proven TDD!). merging. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


fixes #1878