docs: add code quality and type checking workflows to master index
Some checks failed
Documentation Validation / validate-docs (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk]) (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core]) (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto]) (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk]) (push) Has been cancelled
Package Tests / test-javascript-packages (map[name:aitbc-sdk-js path:packages/js/aitbc-sdk]) (push) Has been cancelled
Package Tests / test-javascript-packages (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Systemd Sync / sync-systemd (push) Has been cancelled

- Add Code Quality Module section with pre-commit hooks and quality checks
- Add Type Checking CI/CD Module section with MyPy workflow and coverage
- Update README with code quality achievements and project structure
- Migrate FastAPI apps from deprecated on_event to lifespan context manager
- Update pyproject.toml files to reference consolidated dependencies
- Remove unused app.py import in coordinator-api
- Add type hints to agent
This commit is contained in:
aitbc
2026-03-31 21:45:43 +02:00
parent 26592ddf55
commit 9db720add8
308 changed files with 34194 additions and 34575 deletions

View File

@@ -13,12 +13,21 @@ from sqlalchemy.orm import Session
import hashlib
import time
from typing import Annotated
from contextlib import asynccontextmanager
from database import init_db, get_db_session
from models import User, Order, Trade, Balance
@asynccontextmanager
async def lifespan(app: FastAPI):
# Startup
init_db()
yield
# Shutdown (cleanup if needed)
pass
# Initialize FastAPI app
app = FastAPI(title="AITBC Trade Exchange API", version="1.0.0")
app = FastAPI(title="AITBC Trade Exchange API", version="1.0.0", lifespan=lifespan)
# In-memory session storage (use Redis in production)
user_sessions = {}
@@ -109,10 +118,6 @@ class OrderBookResponse(BaseModel):
buys: List[OrderResponse]
sells: List[OrderResponse]
# Initialize database on startup
@app.on_event("startup")
async def startup_event():
init_db()
# Create mock data if database is empty
db = get_db_session()
@@ -212,9 +217,9 @@ def get_orderbook(db: Session = Depends(get_db_session)):
@app.post("/api/orders", response_model=OrderResponse)
def create_order(
order: OrderCreate,
db: Session = Depends(get_db_session),
user_id: UserDep
order: OrderCreate,
user_id: UserDep,
db: Session = Depends(get_db_session)
):
"""Create a new order"""