refactor(common): rename package option_mcp_common → mcp_common
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[project]
|
||||
name = "option-mcp-common"
|
||||
name = "mcp-common"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
@@ -20,4 +20,4 @@ requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/option_mcp_common"]
|
||||
packages = ["src/mcp_common"]
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
from option_mcp_common.models import (
|
||||
from mcp_common.models import (
|
||||
Event,
|
||||
EventPriority,
|
||||
EventType,
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Usage al boot di ogni mcp `__main__.py`:
|
||||
|
||||
from option_mcp_common.env_validation import require_env, optional_env, summarize
|
||||
from mcp_common.env_validation import require_env, optional_env, summarize
|
||||
|
||||
creds_file = require_env("CREDENTIALS_FILE", "deribit credentials JSON path")
|
||||
host = optional_env("HOST", default="0.0.0.0")
|
||||
+1
-1
@@ -27,7 +27,7 @@ import httpx
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from option_mcp_common.auth import TokenStore
|
||||
from mcp_common.auth import TokenStore
|
||||
|
||||
MCP_PROTOCOL_VERSION = "2024-11-05"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import JSONResponse, Response
|
||||
from starlette.middleware.base import BaseHTTPMiddleware
|
||||
|
||||
from option_mcp_common.auth import TokenStore
|
||||
from mcp_common.auth import TokenStore
|
||||
|
||||
Lifespan = Callable[[FastAPI], AbstractAsyncContextManager[None]]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from fastapi import Depends, FastAPI
|
||||
from fastapi.testclient import TestClient
|
||||
from option_mcp_common.auth import (
|
||||
from mcp_common.auth import (
|
||||
Principal,
|
||||
TokenStore,
|
||||
acl_requires,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from option_mcp_common.env_validation import (
|
||||
from mcp_common.env_validation import (
|
||||
MissingEnvError,
|
||||
fail_fast_if_missing,
|
||||
optional_env,
|
||||
@@ -63,7 +63,7 @@ def test_summarize_does_not_leak_secrets(monkeypatch, caplog):
|
||||
import logging
|
||||
monkeypatch.setenv("API_KEY_FOO", "super-secret-token-123456")
|
||||
monkeypatch.setenv("PORT", "9000")
|
||||
with caplog.at_level(logging.INFO, logger="option_mcp_common.env_validation"):
|
||||
with caplog.at_level(logging.INFO, logger="mcp_common.env_validation"):
|
||||
summarize(["API_KEY_FOO", "PORT", "NOT_SET_XYZ"])
|
||||
log_text = "\n".join(caplog.messages)
|
||||
assert "super-secret-token-123456" not in log_text
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
from option_mcp_common.indicators import adx, atr, macd, rsi, sma
|
||||
from mcp_common.indicators import adx, atr, macd, rsi, sma
|
||||
|
||||
|
||||
def test_rsi_simple():
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import json
|
||||
import logging
|
||||
|
||||
from option_mcp_common.logging import (
|
||||
from mcp_common.logging import (
|
||||
SecretsFilter,
|
||||
configure_root_logging,
|
||||
get_json_logger,
|
||||
|
||||
@@ -2,9 +2,9 @@ from __future__ import annotations
|
||||
|
||||
from fastapi import Depends, FastAPI
|
||||
from fastapi.testclient import TestClient
|
||||
from option_mcp_common.auth import Principal, TokenStore, require_principal
|
||||
from option_mcp_common.mcp_bridge import _derive_input_schemas, mount_mcp_endpoint
|
||||
from option_mcp_common.server import build_app
|
||||
from mcp_common.auth import Principal, TokenStore, require_principal
|
||||
from mcp_common.mcp_bridge import _derive_input_schemas, mount_mcp_endpoint
|
||||
from mcp_common.server import build_app
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from option_mcp_common.models import EventPriority, EventType, L2Entry
|
||||
from mcp_common.models import EventPriority, EventType, L2Entry
|
||||
|
||||
|
||||
def test_l2_entry_minimal():
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from fastapi import HTTPException
|
||||
from option_mcp_common.risk_guard import (
|
||||
from mcp_common.risk_guard import (
|
||||
enforce_aggregate,
|
||||
enforce_leverage,
|
||||
enforce_single_notional,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from fastapi.testclient import TestClient
|
||||
from option_mcp_common.auth import Principal, TokenStore
|
||||
from option_mcp_common.server import build_app
|
||||
from mcp_common.auth import Principal, TokenStore
|
||||
from mcp_common.server import build_app
|
||||
|
||||
|
||||
def test_build_app_health():
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
from option_mcp_common.storage import Database, run_migrations
|
||||
from mcp_common.storage import Database, run_migrations
|
||||
|
||||
|
||||
def test_database_creates_wal(tmp_path: Path):
|
||||
|
||||
Reference in New Issue
Block a user