CIRCULAR IMPORT FIX: Avoid conflict with Python built-in logging
Issue:
- aitbc/logging.py conflicts with Python's built-in logging module
- Circular import when pip tries to import logging
- AttributeError: partially initialized module 'logging' has no attribute 'Logger'
Solution:
- Rename aitbc/logging.py to aitbc/aitbc_logging.py
- Update aitbc/__init__.py to import from renamed module
- Maintains same API (get_logger, setup_logger)
- Avoids naming conflict with built-in logging
Expected results:
- No more circular import errors
- pip should work properly
- aitbc.logging imports should still work
- Test workflow should proceed to execution
This resolves the circular import that was blocking pip
and preventing the test workflow from running.
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.