Files
markitect-main/capabilities/release-management/src/release_management/registries/base.py
tegwick d0ffdc057c feat: implement modular capability system with automatic discovery
- Move release management to capabilities/release-management/ with complete Makefile
- Create automatic capability discovery system in scripts/capability_discovery.mk
- Add capability-manager subagent for managing modular architecture
- Implement target delegation system enabling capability-name-target patterns
- Create Makefiles for markitect-content, markitect-utils, and issue-facade capabilities
- Remove legacy release management code and documentation from main project
- Update main Makefile to use capability discovery and delegation
- Add comprehensive capability status, help, and management targets

The capability system provides:
- Automatic discovery of capabilities with Makefiles
- Clean target delegation without conflicts
- Modular architecture following established patterns
- Comprehensive help and status reporting
- Zero-conflict capability integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:29:15 +01:00

101 lines
2.7 KiB
Python

"""
Base registry interface and configuration.
This module defines the common interface that all registry implementations must follow.
"""
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict, List, Optional, Any
from dataclasses import dataclass
@dataclass
class RegistryConfig:
"""Base configuration for package registries."""
name: str
type: str
url: str
auth_token_env: Optional[str] = None
def get_auth_token(self) -> Optional[str]:
"""Get authentication token from environment variable."""
if self.auth_token_env:
import os
return os.getenv(self.auth_token_env)
return None
class RegistryInterface(ABC):
"""Abstract interface for package registries."""
def __init__(self, config: RegistryConfig):
"""Initialize the registry with configuration."""
self.config = config
@abstractmethod
def upload_package(self, package_path: Path, dry_run: bool = False) -> bool:
"""Upload a package to the registry.
Args:
package_path: Path to package file (.whl or .tar.gz)
dry_run: If True, show what would be done without uploading
Returns:
True if upload successful, False otherwise
"""
pass
@abstractmethod
def check_auth(self) -> bool:
"""Check if authentication is properly configured.
Returns:
True if authenticated, False otherwise
"""
pass
@abstractmethod
def list_packages(self) -> List[Dict[str, Any]]:
"""List packages in the registry.
Returns:
List of package information dictionaries
"""
pass
@abstractmethod
def get_package_info(self, package_name: str) -> Optional[Dict[str, Any]]:
"""Get information about a specific package.
Args:
package_name: Name of the package
Returns:
Package information dictionary or None if not found
"""
pass
@abstractmethod
def delete_package_version(self, package_name: str, version: str,
dry_run: bool = False) -> bool:
"""Delete a specific version of a package.
Args:
package_name: Name of the package
version: Version to delete
dry_run: If True, show what would be done without deleting
Returns:
True if deletion successful, False otherwise
"""
pass
@abstractmethod
def get_registry_info(self) -> Dict[str, Any]:
"""Get information about the registry configuration.
Returns:
Dictionary with registry information
"""
pass