53 lines
1.8 KiB
Python
53 lines
1.8 KiB
Python
|
|
"""
|
||
|
|
Legacy Compatibility System for MarkiTect CLI
|
||
|
|
|
||
|
|
This module provides comprehensive legacy compatibility management allowing
|
||
|
|
deprecated interfaces to be controlled via versioned switches while providing
|
||
|
|
clear migration paths and automated lifecycle management.
|
||
|
|
|
||
|
|
Key Components:
|
||
|
|
- LegacyRegistry: Central registry of legacy interfaces and their versions
|
||
|
|
- LegacySwitch: Version-controlled behavior switches (--legacy-v1, etc.)
|
||
|
|
- DeprecationManager: Graduated deprecation warnings and lifecycle
|
||
|
|
- LegacyAgent: Automated legacy interface management
|
||
|
|
- GitStateTracker: Binding legacy versions to specific git commits
|
||
|
|
|
||
|
|
Architecture:
|
||
|
|
CLI Layer -> LegacySwitch -> LegacyRegistry -> LegacyAgent -> GitStateTracker
|
||
|
|
|
||
|
|
Example Usage:
|
||
|
|
# CLI with legacy support
|
||
|
|
@click.option('--legacy-v1', is_flag=True, help='Use v1.0 legacy behavior')
|
||
|
|
def my_command(legacy_v1):
|
||
|
|
registry = LegacyRegistry()
|
||
|
|
if legacy_v1:
|
||
|
|
return registry.execute_legacy('my_command', 'v1.0', args)
|
||
|
|
return new_implementation(args)
|
||
|
|
"""
|
||
|
|
|
||
|
|
from .registry import LegacyRegistry, LegacyStatus
|
||
|
|
from .switches import LegacySwitch, legacy_option, with_legacy_support
|
||
|
|
from .deprecation import DeprecationManager, DeprecationLevel
|
||
|
|
from .agent import LegacyAgent, AgentConfig
|
||
|
|
from .git_tracker import GitStateTracker
|
||
|
|
from .compatibility import CompatibilityLayer
|
||
|
|
from .exceptions import LegacyError, LegacyVersionNotFoundError, DeprecationError
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
'LegacyRegistry',
|
||
|
|
'LegacyStatus',
|
||
|
|
'LegacySwitch',
|
||
|
|
'legacy_option',
|
||
|
|
'with_legacy_support',
|
||
|
|
'DeprecationManager',
|
||
|
|
'DeprecationLevel',
|
||
|
|
'LegacyAgent',
|
||
|
|
'AgentConfig',
|
||
|
|
'GitStateTracker',
|
||
|
|
'CompatibilityLayer',
|
||
|
|
'LegacyError',
|
||
|
|
'LegacyVersionNotFoundError',
|
||
|
|
'DeprecationError'
|
||
|
|
]
|
||
|
|
|
||
|
|
__version__ = '1.0.0'
|