refactor: move version to separate module and improve logging
Some checks failed
CLI Tests / test-cli (push) Failing after 4s
Deploy to Testnet / deploy-testnet (push) Successful in 1m40s
Documentation Validation / validate-docs (push) Failing after 12s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m42s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 34s
Package Tests / Python package - aitbc-core (push) Successful in 27s
Package Tests / Python package - aitbc-crypto (push) Successful in 13s
Package Tests / Python package - aitbc-sdk (push) Successful in 16s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 18s
Python Tests / test-python (push) Failing after 50s
Security Scanning / security-scan (push) Failing after 43s
Multi-Node Stress Testing / stress-test (push) Successful in 12s
Cross-Node Transaction Testing / transaction-test (push) Successful in 9s

- Created aitbc/_version.py with centralized version definition
- Updated aitbc/__init__.py to import __version__ from _version module
- Updated constants.py to use __version__ for PACKAGE_VERSION
- Replaced print() calls with logger in decorators.py, events.py, queue_manager.py, and state.py
- Added logger initialization using get_logger(__name__) in config.py, decorators.py, events.py, queue_manager.py, and state.py
- Added cli/commands
This commit is contained in:
aitbc
2026-05-11 20:12:01 +02:00
parent dc1c563f6e
commit 3897bcbf24
237 changed files with 7469 additions and 33787 deletions

View File

@@ -8,7 +8,7 @@ from aitbc import AITBCHTTPClient, NetworkError
def handle_bridge_health(args):
"""Health check for blockchain event bridge service."""
try:
from commands.blockchain_event_bridge import get_config as get_bridge_config
from commands.legacy.blockchain_event_bridge import get_config as get_bridge_config
config = get_bridge_config()
if args.test_mode:
@@ -33,7 +33,7 @@ def handle_bridge_health(args):
def handle_bridge_metrics(args):
"""Get Prometheus metrics from blockchain event bridge service."""
try:
from commands.blockchain_event_bridge import get_config as get_bridge_config
from commands.legacy.blockchain_event_bridge import get_config as get_bridge_config
config = get_bridge_config()
if args.test_mode:
@@ -57,7 +57,7 @@ def handle_bridge_metrics(args):
def handle_bridge_status(args):
"""Get detailed status of blockchain event bridge service."""
try:
from commands.blockchain_event_bridge import get_config as get_bridge_config
from commands.legacy.blockchain_event_bridge import get_config as get_bridge_config
config = get_bridge_config()
if args.test_mode:
@@ -82,7 +82,7 @@ def handle_bridge_status(args):
def handle_bridge_config(args):
"""Show current configuration of blockchain event bridge service."""
try:
from commands.blockchain_event_bridge import get_config as get_bridge_config
from commands.legacy.blockchain_event_bridge import get_config as get_bridge_config
config = get_bridge_config()
if args.test_mode:

View File

@@ -6,7 +6,7 @@ from aitbc import AITBCHTTPClient, NetworkError
def handle_pool_hub_sla_metrics(args):
"""Get SLA metrics for a miner or all miners."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -37,7 +37,7 @@ def handle_pool_hub_sla_metrics(args):
def handle_pool_hub_sla_violations(args):
"""Get SLA violations across all miners."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -61,7 +61,7 @@ def handle_pool_hub_sla_violations(args):
def handle_pool_hub_capacity_snapshots(args):
"""Get capacity planning snapshots."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -86,7 +86,7 @@ def handle_pool_hub_capacity_snapshots(args):
def handle_pool_hub_capacity_forecast(args):
"""Get capacity forecast."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -111,7 +111,7 @@ def handle_pool_hub_capacity_forecast(args):
def handle_pool_hub_capacity_recommendations(args):
"""Get scaling recommendations."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -136,7 +136,7 @@ def handle_pool_hub_capacity_recommendations(args):
def handle_pool_hub_billing_usage(args):
"""Get billing usage data."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -161,7 +161,7 @@ def handle_pool_hub_billing_usage(args):
def handle_pool_hub_billing_sync(args):
"""Trigger billing sync with coordinator-api."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode:
@@ -184,7 +184,7 @@ def handle_pool_hub_billing_sync(args):
def handle_pool_hub_collect_metrics(args):
"""Trigger SLA metrics collection."""
try:
from commands.pool_hub import get_config as get_pool_hub_config
from commands.legacy.pool_hub import get_config as get_pool_hub_config
config = get_pool_hub_config()
if args.test_mode: