feat: fix missing modules and dependencies for test compatibility
Some checks failed
audit / audit (push) Has been skipped
ci-cd / build (push) Has been skipped
ci / build (push) Has been skipped
autofix / fix (push) Has been skipped
python-tests / test (push) Failing after 5s
python-tests / test-specific (push) Has been skipped
security-scanning / audit (push) Has been skipped
test / test (push) Has been skipped
ci-cd / deploy (push) Has been skipped
ci / deploy (push) Has been skipped
Some checks failed
audit / audit (push) Has been skipped
ci-cd / build (push) Has been skipped
ci / build (push) Has been skipped
autofix / fix (push) Has been skipped
python-tests / test (push) Failing after 5s
python-tests / test-specific (push) Has been skipped
security-scanning / audit (push) Has been skipped
test / test (push) Has been skipped
ci-cd / deploy (push) Has been skipped
ci / deploy (push) Has been skipped
CODEBASE FIXES: Resolve real import and dependency issues Fixed Issues: 1. Missing aitbc.logging module - created aitbc/ package with logging.py 2. Missing src.message_protocol - created agent-protocols/src/message_protocol.py 3. Missing src.task_manager - created agent-protocols/src/task_manager.py 4. SQLAlchemy metadata conflicts - added extend_existing=True to Block model 5. Missing dependencies - added slowapi>=0.1.0 and pynacl>=1.5.0 New Modules Created: - aitbc/__init__.py - AITBC package initialization - aitbc/logging.py - Centralized logging utilities with get_logger() - apps/agent-protocols/src/__init__.py - Agent protocols package - apps/agent-protocols/src/message_protocol.py - MessageProtocol, MessageTypes, AgentMessageClient - apps/agent-protocols/src/task_manager.py - TaskManager, TaskStatus, TaskPriority, Task Database Fixes: - apps/blockchain-node/src/aitbc_chain/models.py - Added extend_existing=True to resolve metadata conflicts Dependencies Added: - slowapi>=0.1.0 - For slowapi.errors import - pynacl>=1.5.0 - For nacl.signing import Expected Results: - aitbc.logging imports should work - src.message_protocol imports should work - src.task_manager imports should work - SQLAlchemy metadata conflicts resolved - Missing dependency imports resolved - More tests should collect and run successfully This addresses the root cause issues in the codebase rather than working around them with test filtering.
This commit is contained in:
8
aitbc/__init__.py
Normal file
8
aitbc/__init__.py
Normal file
@@ -0,0 +1,8 @@
|
||||
"""
|
||||
AITBC Package
|
||||
"""
|
||||
|
||||
from .logging import get_logger, setup_logger
|
||||
|
||||
__version__ = "0.2.0"
|
||||
__all__ = ["get_logger", "setup_logger"]
|
||||
32
aitbc/logging.py
Normal file
32
aitbc/logging.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
AITBC Logging Module
|
||||
Centralized logging utilities for the AITBC project
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
from typing import Optional
|
||||
|
||||
def setup_logger(
|
||||
name: str,
|
||||
level: str = "INFO",
|
||||
format_string: Optional[str] = None
|
||||
) -> logging.Logger:
|
||||
"""Setup a logger with consistent formatting"""
|
||||
if format_string is None:
|
||||
format_string = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||
|
||||
logger = logging.getLogger(name)
|
||||
logger.setLevel(getattr(logging, level.upper()))
|
||||
|
||||
if not logger.handlers:
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
formatter = logging.Formatter(format_string)
|
||||
handler.setFormatter(formatter)
|
||||
logger.addHandler(handler)
|
||||
|
||||
return logger
|
||||
|
||||
def get_logger(name: str) -> logging.Logger:
|
||||
"""Get a logger instance"""
|
||||
return logging.getLogger(name)
|
||||
Reference in New Issue
Block a user