Skip to content

Commit 2f0439a

Browse files
authored
Fix 2164 (#2165)
* add branch audit file * fix: add missing @inlineCallbacks decorators (#2164) Add missing @inlineCallbacks decorator to RouterWebServiceWebhook.create() and MarketMaker.revoke_offer(). Without the decorator, these functions silently return generator objects instead of executing the async code. Note: This work was completed with AI assistance (Claude Code). * chore: bump version to 26.4.1.dev1 * fix: add bump-dev recipe for auto CalVer versioning (#2166) Add bump-dev recipe that auto-computes the next dev version from the current date (YY.M.1.dev1) instead of requiring manual version input. Note: This work was completed with AI assistance (Claude Code). * fix: replace deprecated pkg_resources with importlib.resources (#2167) Replace pkg_resources.resource_filename() calls in test_util.py with importlib.resources.files(). pkg_resources has been removed from recent setuptools versions, breaking CI on environments without it. Note: This work was completed with AI assistance (Claude Code). * fix: correct import ordering in test_util.py Group stdlib import (importlib.resources) with other stdlib imports to satisfy ruff import sorting rules. Note: This work was completed with AI assistance (Claude Code). * add release key for 26.4 * fix: handle ty version differences in check-typing recipe Auto-detect whether ty uses "not-subscriptable" (older) or "non-subscriptable" (newer) rule name to avoid unknown-rule warnings across different ty versions. Note: This work was completed with AI assistance (Claude Code). * docs: add changelog entry for 26.4.1 Note: This work was completed with AI assistance (Claude Code).
1 parent 9939251 commit 2f0439a

10 files changed

Lines changed: 52 additions & 12 deletions

File tree

.audit/oberstet_fix_2164.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 project's AI_POLICY.md when creating code, documentation etc. for this pull request.
4+
5+
Submitted by: @oberstet
6+
Date: 2026-04-02
7+
Related issue(s): #2164
8+
Branch: oberstet:fix_2164

docs/changelog.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
Changelog
66
=========
77

8+
26.4.1
9+
------
10+
11+
* fix: add missing ``@inlineCallbacks`` decorator on ``RouterWebServiceWebhook.create()`` (`#2164 <https://github.com/crossbario/crossbar/issues/2164>`_)
12+
* fix: add missing ``@inlineCallbacks`` decorator on ``MarketMaker.revoke_offer()`` (`#2164 <https://github.com/crossbario/crossbar/issues/2164>`_)
13+
* fix: replace deprecated ``pkg_resources`` with ``importlib.resources`` in test code (`#2167 <https://github.com/crossbario/crossbar/issues/2167>`_)
14+
* new: add ``bump-dev`` justfile recipe for auto CalVer versioning (`#2166 <https://github.com/crossbario/crossbar/issues/2166>`_)
15+
* fix: handle ``ty`` rule name differences across versions in ``check-typing`` recipe
16+
817
25.12.1
918
-------
1019

justfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,14 @@ prep-release:
330330
@echo 'For rel key: this must be done (incl. *.sec key handling) by maintainer!'
331331
@echo ''
332332

333+
# Auto-bump to next dev version based on current date (CalVer: YY.M.1.dev1)
334+
bump-dev:
335+
#!/usr/bin/env bash
336+
set -e
337+
NEXT="$(date +%-y).$(date +%-m).1.dev1"
338+
echo "Auto-computed next dev version: ${NEXT}"
339+
just bump-next "${NEXT}"
340+
333341
# Post-Tag Bump: Set a specific next version (e.g. `just bump-next 26.1.2.dev1`)
334342
bump-next next_version:
335343
@echo "Bumping metadata to {{next_version}}..."
@@ -553,6 +561,15 @@ check-typing venv="":
553561
VENV_PYTHON=$(just --quiet _get-venv-python {{ venv }})
554562
echo "==> Running static type checks with ty..."
555563
echo " Using Python: ${VENV_PYTHON}"
564+
565+
# ty renamed "not-subscriptable" to "non-subscriptable" between versions;
566+
# detect which name this version uses to avoid unknown-rule warnings.
567+
if ty check --ignore non-subscriptable src/crossbar/__init__.py --python "${VENV_PYTHON}" 2>&1 | grep -q 'Unknown rule.*non-subscriptable'; then
568+
SUBSCRIPT_RULE="not-subscriptable"
569+
else
570+
SUBSCRIPT_RULE="non-subscriptable"
571+
fi
572+
556573
ty check \
557574
--python "${VENV_PYTHON}" \
558575
--ignore unresolved-import \
@@ -571,7 +588,7 @@ check-typing venv="":
571588
--ignore too-many-positional-arguments \
572589
--ignore unknown-argument \
573590
--ignore missing-argument \
574-
--ignore not-subscriptable \
591+
--ignore "${SUBSCRIPT_RULE}" \
575592
--ignore not-iterable \
576593
--ignore no-matching-overload \
577594
--ignore conflicting-declarations \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "crossbar"
7-
version = "26.1.1.dev1"
7+
version = "26.4.1.dev1"
88
description = "Crossbar.io multi-protocol (WAMP/WebSocket, REST/HTTP, MQTT) application router for microservices."
99
readme = "README.md"
1010
requires-python = ">=3.11"

src/crossbar/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
#
66
#####################################################################################
77

8-
__version__ = "26.1.1.dev1"
8+
__version__ = "26.4.1.dev1"
99
__build__ = "19000101-0000000"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
untrusted comment: Crossbar.io 26.4 public key
2+
RWT9T8LGH9HFyNBDWe4v7pGHPROuxOxgYMMso5Qy//e4uPLwByd/1S0Q

src/crossbar/edge/worker/xbr/_marketmaker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ def query_offers(
10541054
raise NotImplementedError()
10551055

10561056
@wamp.register(None, check_types=True)
1057+
@inlineCallbacks
10571058
def revoke_offer(self, key_id, details: Optional[CallDetails] = None):
10581059
"""
10591060
Called by XBR Provider to revoke (on-going) sale of a key. The market maker will stop

src/crossbar/test/test_util.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
import copy
99
import json
10+
from importlib.resources import files
1011

11-
import pkg_resources
1212
import pytest
1313

1414
from crossbar._util import _deep_merge_object, merge_config
@@ -22,11 +22,8 @@ def master_personality():
2222

2323
@pytest.fixture(scope="function")
2424
def master_config():
25-
# built-in config
26-
# filename = pkg_resources.resource_filename('crossbar', 'master/node/config.json')
27-
2825
# "copied" built-in config for testing
29-
filename = pkg_resources.resource_filename("crossbar", "test/test_config.json")
26+
filename = str(files("crossbar").joinpath("test/test_config.json"))
3027

3128
with open(filename) as f:
3229
config = json.load(f)
@@ -258,14 +255,14 @@ def test_merge_same(master_personality, master_config):
258255

259256
def make_test_func(cfg_name):
260257
def test_merge_config(master_personality, master_config):
261-
filename = pkg_resources.resource_filename("crossbar", "tests/test_{}.json".format(cfg_name))
258+
filename = str(files("crossbar").joinpath("tests/test_{}.json".format(cfg_name)))
262259
with open(filename) as f:
263260
test_config = json.load(f)
264261

265262
# a mergeable override-config does NOT need to be valid in itself
266263
# MasterPersonality.check_config(MasterPersonality, test_config)
267264

268-
filename = pkg_resources.resource_filename("crossbar", "tests/test_{}_merged.json".format(cfg_name))
265+
filename = str(files("crossbar").joinpath("tests/test_{}_merged.json".format(cfg_name)))
269266
with open(filename) as f:
270267
test_config_merged = json.load(f)
271268
MasterPersonality.check_config(MasterPersonality, test_config_merged)
@@ -288,7 +285,7 @@ def test_merge_config(master_personality, master_config):
288285
sys.setrecursionlimit(10000)
289286

290287
# this is the base config into the test configs will be merged
291-
filename = pkg_resources.resource_filename("crossbar", "tests/test_config.json")
288+
filename = str(files("crossbar").joinpath("tests/test_config.json"))
292289
with open(filename) as f:
293290
_master_config = json.load(f)
294291

src/crossbar/webservice/rest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class RouterWebServiceWebhook(RouterWebService):
137137
"""
138138

139139
@staticmethod
140+
@inlineCallbacks
140141
def create(transport, path: str, config: Dict[str, Any]):
141142
"""
142143
Create a new HTTP/POST Webhook service (part of REST-bridge).

uv.lock

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)