From c1e9ee3301042daec6b9d66edb0c59dabcfca419 Mon Sep 17 00:00:00 2001 From: aitbc Date: Wed, 29 Apr 2026 20:38:48 +0200 Subject: [PATCH] fix: Use lazy import for create_app in __init__.py - Change create_app to lazy import to avoid fastapi dependency - Allows importing from aitbc_chain.cross_chain without triggering fastapi import - Fixes cross-chain tests with minimal dependencies (pytest pytest-asyncio) --- apps/blockchain-node/src/aitbc_chain/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/blockchain-node/src/aitbc_chain/__init__.py b/apps/blockchain-node/src/aitbc_chain/__init__.py index 926cddef..48a0369c 100755 --- a/apps/blockchain-node/src/aitbc_chain/__init__.py +++ b/apps/blockchain-node/src/aitbc_chain/__init__.py @@ -1,5 +1,8 @@ """AITBC blockchain node package.""" -from .app import create_app +# Lazy import to avoid cascading dependencies +def create_app(): + from .app import create_app as _create_app + return _create_app() __all__ = ["create_app"]