Spaces:
Paused

yaz / src /shared /settings.py
anaselamr's picture
fix(collaboration): production-ready collaboration fixes — all 19 engines
0743ddc
Raw History Blame Contribute Delete
1.56 kB
"""
Settings bridge - delegates to core.config.Settings
This module provides backward compatibility for code using shared.settings.
All settings should be accessed via core.config.Settings.
"""
from functools import lru_cache
try:
from core.config import Settings
from core.config import get_settings as _get_settings
@lru_cache
def get_settings() -> Settings:
"""Get application settings (cached)"""
return _get_settings()
except ImportError:
# Fallback for testing/minimal environments
import warnings
warnings.warn("core.config.Settings not available, using stub settings", RuntimeWarning)
class SecurityConfig:
"""Stub security config for testing"""
secret_key: str = "dev-secret-key-change-in-production"
jwt_expire_minutes: int = 30
jwt_refresh_expire_days: int = 7
class AppConfig:
"""Stub app config for testing"""
environment: str = "development"
log_level: str = "INFO"
class Settings: # type: ignore[call-arg, call-overload, no-redef]
"""Fallback stub settings"""
def __init__(self):
self.database_url = "sqlite:///./data/databases/test/test.db"
self.async_database_url = "sqlite+aiosqlite:///./data/databases/test/test.db"
self.redis_url = "redis://localhost:6379"
self.security = SecurityConfig()
self.app = AppConfig()
def get_settings(): # type: ignore[attr-defined, misc, dict-item, abstract, type-var, union-attr]
return Settings()