Skip to content

Commit 9fbd478

Browse files
authored
Fix 218 (#219)
* start new dev branch; add audit file * Sync wamp-ai/wamp-cicd submodules + bump version to 26.6.1 (#218) Coordinated WAMP 26.6.1 release-train sync: - Bump .ai submodule bfb4804 -> 4669dc8 (docs: README/justfile). - Bump .cicd submodule 08c9305 -> f77ca2b: picks up the GHSA-6658 shell-injection hardening in the shared identifiers.yml reusable workflow (untrusted event fields passed via env: with a fail-closed branch-name allowlist), plus release-notes/changelog scripts and the verified-artifact actions used by #212. identifiers.yml is consumed via @main, so the fix is already live at runtime; this aligns the pinned pointer and the local .cicd scripts for reproducibility. - Bump version 25.12.2 -> 26.6.1 (pyproject.toml, src/txaio/_version.py). - Add 26.6.1 changelog section. No caller changes required: the identifiers.yml interface is unchanged and the workflow structure already matches zlmdb/autobahn-python. Note: This work was completed with AI assistance (Claude Code). * Exclude .ai/.cicd submodules from ruff linting (#218) The .cicd submodule bump (08c9305 -> f77ca2b) added shared scripts, including .cicd/scripts/git_version.py, which uses a substituted __git_version__ placeholder that trips ruff F821 ("undefined name"). The check-format recipe runs `ruff check .`, which traversed into the submodule and failed CI. These submodules carry their own source with their own linting/CI and are not txaio source, so exclude them via a top-level [tool.ruff] extend-exclude (file-discovery exclude; the [tool.ruff.lint] exclude does not affect traversal). This keeps F821 and the other checks active for txaio's own code, rather than globally suppressing F821 as a workaround. Note: This work was completed with AI assistance (Claude Code). * Follow latest ty (venv dep) + fix ty invalid-argument-type in tx.py (#218) The newer ty on CI (0.0.50 vs a stale local 0.0.44) flagged tx.py:297: globalLogBeginner.beginLoggingTo(_observers) — `list[_LogObserver]` not assignable to `Iterable[ILogObserver]`. _LogObserver provides ILogObserver via zope.interface's @Provider, which static checkers cannot follow. Tooling (mirrors zlmdb so local and CI track the same latest ty): - Declare `ty>=0.0.44` in the [dev] extra ("follow latest", unpinned) and run it from the venv (`${VENV_PATH}/bin/ty`) instead of a global install. - check-typing now depends on install-tools (which provides ty) + install (which provides twisted stubs). - Drop the global `uv tool install ty` step (and the `ty --version` check) from the quality job in main.yml. Fix: - Localized `cast(ILogObserver, _observer)` in tx.py, keeping ty's invalid-argument-type rule active elsewhere (txaio keeps a tighter ignore set than autobahn/zlmdb, which blanket-ignore this rule). Verified locally with ty 0.0.50 on cpy311 (twisted installed): `just check-typing cpy311` -> All checks passed; `ruff check .` clean. Note: This work was completed with AI assistance (Claude Code).
1 parent 6205af2 commit 9fbd478

9 files changed

Lines changed: 46 additions & 14 deletions

File tree

.ai

Submodule .ai updated 1 file

.audit/oberstet_fix_218.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
2+
- [x] I **did** use AI-assistance tools to *help* create this pull request.
3+
- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request.
4+
5+
Submitted by: @oberstet
6+
Date: 2026-06-18
7+
Related issue(s): #218
8+
Branch: oberstet:fix_218

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ jobs:
6161
-LsSf https://astral.sh/uv/install.sh | sh
6262
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
6363
64-
- name: Install ty (Astral type checker)
65-
run: uv tool install ty
64+
# ty (Astral type checker) is declared in the [dev] extra and installed
65+
# into the venv via `just install-tools` below; no separate global
66+
# `uv tool install ty` step is needed. This keeps local and CI on the
67+
# same (latest) ty resolved from the pyproject constraint.
6668

6769
- name: Verify toolchain installation
6870
run: |
6971
just --version
7072
uv --version
71-
ty --version
7273
7374
- name: Setup uv cache
7475
uses: actions/cache@v4

docs/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ This document contains a reverse-chronological list of changes to txaio.
88
For detailed release information including wheels and artifacts,
99
see :doc:`releases`.
1010

11+
26.6.1
12+
------
13+
14+
**Other**
15+
16+
* Bumped the shared ``wamp-ai`` and ``wamp-cicd`` Git submodules to match the rest of the WAMP project group (zlmdb / autobahn-python 26.6.1) for the coordinated release. The ``wamp-cicd`` bump picks up the GHSA-6658 shell-injection hardening in the shared ``identifiers.yml`` reusable workflow (untrusted GitHub event fields are now passed via ``env:`` as quoted data with a fail-closed branch-name allowlist) (`#218 <https://github.com/crossbario/txaio/issues/218>`_)
17+
* Declare the ``ty`` type checker in the ``dev`` extra and run it from the project venv (dropping the separate global ``uv tool install ty`` step), so local and CI resolve the same latest ``ty``. Fixed a newly-reported ``ty`` ``invalid-argument-type`` diagnostic in ``tx.py`` (the Twisted ``ILogObserver`` is provided via ``zope.interface`` ``@provider``, which static checkers cannot follow) with a localized ``cast`` rather than a blanket rule ignore. Excluded the ``.ai`` / ``.cicd`` submodules from ``ruff`` (they carry their own linting/CI) (`#218 <https://github.com/crossbario/txaio/issues/218>`_)
18+
1119
25.12.2
1220
-------
1321

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ check-format venv="": (install-tools venv)
524524
"${VENV_PATH}/bin/ruff" check .
525525
526526
# Run static type checking with ty (Astral's Rust-based type checker)
527-
# ty is installed as a standalone tool via `uv tool install ty`, not as a Python package
528-
check-typing venv="": (install venv)
527+
# ty is declared in the [dev] extra and installed into the venv by install-tools
528+
check-typing venv="": (install-tools venv) (install venv)
529529
#!/usr/bin/env bash
530530
set -e
531531
VENV_NAME="{{ venv }}"
@@ -542,7 +542,7 @@ check-typing venv="": (install venv)
542542
# - possibly-missing-attribute: sys._getframe() returns FrameType | None
543543
# - call-non-callable: callback type inference edge cases
544544
# - deprecated: abc.abstractproperty usage (fix later)
545-
ty check \
545+
"${VENV_PATH}/bin/ty" check \
546546
--python "${VENV_PATH}/bin/python" \
547547
--ignore unresolved-attribute \
548548
--ignore possibly-missing-attribute \

pyproject.toml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "txaio"
7-
version = "25.12.2"
7+
version = "26.6.1"
88
description = "Compatibility API between asyncio/Twisted/Trollius"
99
readme = {file = "README.md", content-type = "text/markdown"}
1010
license = "MIT"
@@ -87,8 +87,10 @@ dev = [
8787

8888
# Code quality
8989
"ruff>=0.4.0",
90-
# Note: ty (Astral type checker) is installed via `uv tool install ty`
91-
# It's a standalone Rust binary, not a Python package dependency
90+
# ty: Astral's type checker (standalone Rust binary, shipped as a wheel).
91+
# Pre-1.0 and fast-moving: we deliberately follow latest upstream releases
92+
# rather than pinning, so local and CI resolve the same (newest) ty.
93+
"ty>=0.0.44",
9294
]
9395

9496
all = [
@@ -127,6 +129,15 @@ line-length = 88
127129
indent-width = 4
128130
target-version = "py311"
129131

132+
# File-discovery excludes (top-level, in addition to ruff's built-in defaults).
133+
# The shared wamp-ai / wamp-cicd submodules carry their own source with their own
134+
# linting/CI (e.g. .cicd/scripts/git_version.py uses a substituted __git_version__
135+
# placeholder) and must not be linted as part of txaio.
136+
extend-exclude = [
137+
".ai",
138+
".cicd",
139+
]
140+
130141
[tool.ruff.lint]
131142
# Enable Pyflakes (`F`) and a subset of pycodestyle (`E`) codes by default.
132143
select = ["E4", "E7", "E9", "F"]

src/txaio/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
#
2525
###############################################################################
2626

27-
__version__ = "25.12.2"
27+
__version__ = "26.6.1"

src/txaio/tx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import inspect
3232

3333
from functools import partial
34+
from typing import cast
3435

3536
from twisted.python.failure import Failure
3637
from twisted.internet.defer import maybeDeferred, Deferred, DeferredList
@@ -291,9 +292,12 @@ def start_logging(out=_stdout, level="info"):
291292
if out:
292293
_observer = _LogObserver(out)
293294

294-
_observers = []
295+
# _LogObserver provides ILogObserver via zope.interface's @provider, which
296+
# static type checkers (ty) cannot follow; cast so the observer list matches
297+
# globalLogBeginner.beginLoggingTo(observers: Iterable[ILogObserver]).
298+
_observers: list[ILogObserver] = []
295299
if _observer:
296-
_observers.append(_observer)
300+
_observers.append(cast(ILogObserver, _observer))
297301
globalLogBeginner.beginLoggingTo(_observers)
298302

299303

0 commit comments

Comments
 (0)