fix(ci): lazy import logger in predix.py and cli.py to avoid ImportError in test env

Wrapped  in try/except
ImportError with standard logging fallback. The rdagent.log
module chain fails when predix.py is imported as a module
in the CI test environment (kronos CLI tests).
This commit is contained in:
TPTBusiness
2026-05-01 13:57:31 +02:00
parent b53749df7d
commit 44c8af572e
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -18,7 +18,12 @@ load_dotenv(Path(__file__).parent / ".env")
import typer
from rich.console import Console
from rdagent.utils.env import logger
try:
from rdagent.utils.env import logger
except ImportError:
import logging
logger = logging.getLogger(__name__)
app = typer.Typer(help="Predix - AI Quantitative Trading Agent")
console = Console()
+6 -1
View File
@@ -27,7 +27,12 @@ import typer
from rich.console import Console
from typing_extensions import Annotated
from rdagent.utils.env import logger
try:
from rdagent.utils.env import logger
except ImportError:
import logging
logger = logging.getLogger(__name__)
from rdagent.app.data_science.loop import main as data_science
from rdagent.app.finetune.llm.loop import main as llm_finetune