Files
Aether/_deprecated_py_src/services/provider/__init__.py

46 lines
1.4 KiB
Python
Raw Normal View History

2025-12-10 20:52:44 +08:00
"""
Provider 服务模块
包含 Provider 管理格式处理传输层等功能
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from src.services.provider.format import normalize_endpoint_signature
from src.services.provider.service import ProviderService
from src.services.provider.transport import build_provider_url
2025-12-10 20:52:44 +08:00
__all__ = [
"ProviderService",
"normalize_endpoint_signature",
2025-12-10 20:52:44 +08:00
"build_provider_url",
]
def __getattr__(name: str) -> Any:
"""Lazy attribute access to avoid import-time side effects.
Importing `src.services.provider` should not eagerly import the whole provider
service stack (which can create circular imports during test collection).
"""
if name == "ProviderService":
from src.services.provider.service import ProviderService as _ProviderService
return _ProviderService
if name == "normalize_endpoint_signature":
from src.services.provider.format import (
normalize_endpoint_signature as _normalize_endpoint_signature,
)
return _normalize_endpoint_signature
if name == "build_provider_url":
from src.services.provider.transport import build_provider_url as _build_provider_url
return _build_provider_url
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")