exonware-xwsystem 0.0.1.407__py3-none-any.whl → 0.0.1.409__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- exonware/__init__.py +21 -12
- exonware/conf.py +89 -149
- exonware/xwsystem/__init__.py +18 -159
- exonware/xwsystem/caching/__init__.py +1 -1
- exonware/xwsystem/caching/base.py +1 -1
- exonware/xwsystem/caching/bloom_cache.py +1 -1
- exonware/xwsystem/caching/cache_manager.py +1 -1
- exonware/xwsystem/caching/conditional.py +1 -1
- exonware/xwsystem/caching/contracts.py +1 -1
- exonware/xwsystem/caching/decorators.py +1 -1
- exonware/xwsystem/caching/defs.py +1 -1
- exonware/xwsystem/caching/disk_cache.py +1 -1
- exonware/xwsystem/caching/distributed.py +1 -1
- exonware/xwsystem/caching/errors.py +1 -1
- exonware/xwsystem/caching/events.py +1 -1
- exonware/xwsystem/caching/eviction_strategies.py +1 -1
- exonware/xwsystem/caching/fluent.py +1 -1
- exonware/xwsystem/caching/integrity.py +1 -1
- exonware/xwsystem/caching/lfu_cache.py +1 -1
- exonware/xwsystem/caching/lfu_optimized.py +1 -1
- exonware/xwsystem/caching/lru_cache.py +1 -1
- exonware/xwsystem/caching/memory_bounded.py +1 -1
- exonware/xwsystem/caching/metrics_exporter.py +1 -1
- exonware/xwsystem/caching/observable_cache.py +1 -1
- exonware/xwsystem/caching/pluggable_cache.py +1 -1
- exonware/xwsystem/caching/rate_limiter.py +1 -1
- exonware/xwsystem/caching/read_through.py +1 -1
- exonware/xwsystem/caching/secure_cache.py +1 -1
- exonware/xwsystem/caching/serializable.py +1 -1
- exonware/xwsystem/caching/stats.py +1 -1
- exonware/xwsystem/caching/tagging.py +1 -1
- exonware/xwsystem/caching/ttl_cache.py +1 -1
- exonware/xwsystem/caching/two_tier_cache.py +1 -1
- exonware/xwsystem/caching/utils.py +1 -1
- exonware/xwsystem/caching/validation.py +1 -1
- exonware/xwsystem/caching/warming.py +1 -1
- exonware/xwsystem/caching/write_behind.py +1 -1
- exonware/xwsystem/cli/__init__.py +1 -1
- exonware/xwsystem/cli/args.py +1 -1
- exonware/xwsystem/cli/base.py +1 -1
- exonware/xwsystem/cli/colors.py +1 -1
- exonware/xwsystem/cli/console.py +1 -1
- exonware/xwsystem/cli/contracts.py +1 -1
- exonware/xwsystem/cli/defs.py +1 -1
- exonware/xwsystem/cli/errors.py +1 -1
- exonware/xwsystem/cli/progress.py +1 -1
- exonware/xwsystem/cli/prompts.py +1 -1
- exonware/xwsystem/cli/tables.py +1 -1
- exonware/xwsystem/conf.py +1 -21
- exonware/xwsystem/config/__init__.py +1 -1
- exonware/xwsystem/config/base.py +1 -1
- exonware/xwsystem/config/contracts.py +1 -1
- exonware/xwsystem/config/defaults.py +1 -1
- exonware/xwsystem/config/defs.py +1 -1
- exonware/xwsystem/config/errors.py +1 -1
- exonware/xwsystem/config/logging.py +1 -1
- exonware/xwsystem/config/logging_setup.py +1 -1
- exonware/xwsystem/config/performance.py +1 -1
- exonware/xwsystem/http/__init__.py +1 -1
- exonware/xwsystem/http/advanced_client.py +5 -1
- exonware/xwsystem/http/base.py +1 -1
- exonware/xwsystem/http/client.py +5 -1
- exonware/xwsystem/http/contracts.py +1 -1
- exonware/xwsystem/http/defs.py +1 -1
- exonware/xwsystem/http/errors.py +1 -1
- exonware/xwsystem/io/__init__.py +1 -1
- exonware/xwsystem/io/archive/__init__.py +1 -1
- exonware/xwsystem/io/archive/archive.py +1 -1
- exonware/xwsystem/io/archive/archive_files.py +1 -1
- exonware/xwsystem/io/archive/archivers.py +1 -1
- exonware/xwsystem/io/archive/base.py +1 -1
- exonware/xwsystem/io/archive/codec_integration.py +1 -1
- exonware/xwsystem/io/archive/compression.py +1 -1
- exonware/xwsystem/io/archive/formats/__init__.py +1 -1
- exonware/xwsystem/io/archive/formats/brotli_format.py +1 -1
- exonware/xwsystem/io/archive/formats/lz4_format.py +1 -1
- exonware/xwsystem/io/archive/formats/rar.py +1 -1
- exonware/xwsystem/io/archive/formats/sevenzip.py +1 -1
- exonware/xwsystem/io/archive/formats/squashfs_format.py +1 -1
- exonware/xwsystem/io/archive/formats/tar.py +1 -1
- exonware/xwsystem/io/archive/formats/wim_format.py +1 -1
- exonware/xwsystem/io/archive/formats/zip.py +1 -1
- exonware/xwsystem/io/archive/formats/zpaq_format.py +1 -1
- exonware/xwsystem/io/archive/formats/zstandard.py +1 -1
- exonware/xwsystem/io/base.py +1 -1
- exonware/xwsystem/io/codec/__init__.py +1 -1
- exonware/xwsystem/io/codec/base.py +1 -1
- exonware/xwsystem/io/codec/contracts.py +1 -1
- exonware/xwsystem/io/codec/registry.py +1 -1
- exonware/xwsystem/io/common/__init__.py +1 -1
- exonware/xwsystem/io/common/base.py +1 -1
- exonware/xwsystem/io/common/lock.py +1 -1
- exonware/xwsystem/io/common/watcher.py +1 -1
- exonware/xwsystem/io/contracts.py +1 -1
- exonware/xwsystem/io/defs.py +1 -1
- exonware/xwsystem/io/errors.py +1 -1
- exonware/xwsystem/io/facade.py +1 -1
- exonware/xwsystem/io/file/__init__.py +1 -1
- exonware/xwsystem/io/file/base.py +1 -1
- exonware/xwsystem/io/file/conversion.py +1 -1
- exonware/xwsystem/io/file/file.py +1 -1
- exonware/xwsystem/io/file/paged_source.py +1 -1
- exonware/xwsystem/io/file/paging/__init__.py +1 -1
- exonware/xwsystem/io/file/paging/byte_paging.py +1 -1
- exonware/xwsystem/io/file/paging/line_paging.py +1 -1
- exonware/xwsystem/io/file/paging/record_paging.py +1 -1
- exonware/xwsystem/io/file/paging/registry.py +1 -1
- exonware/xwsystem/io/file/source.py +1 -1
- exonware/xwsystem/io/filesystem/__init__.py +1 -1
- exonware/xwsystem/io/filesystem/base.py +1 -1
- exonware/xwsystem/io/filesystem/local.py +1 -1
- exonware/xwsystem/io/folder/__init__.py +1 -1
- exonware/xwsystem/io/folder/base.py +1 -1
- exonware/xwsystem/io/folder/folder.py +1 -1
- exonware/xwsystem/io/serialization/__init__.py +1 -1
- exonware/xwsystem/io/serialization/auto_serializer.py +1 -1
- exonware/xwsystem/io/serialization/base.py +2 -2
- exonware/xwsystem/io/serialization/contracts.py +1 -1
- exonware/xwsystem/io/serialization/defs.py +1 -1
- exonware/xwsystem/io/serialization/errors.py +1 -1
- exonware/xwsystem/io/serialization/flyweight.py +1 -1
- exonware/xwsystem/io/serialization/format_detector.py +1 -1
- exonware/xwsystem/io/serialization/formats/__init__.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/bson.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/cbor.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/marshal.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/msgpack.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/pickle.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/plistlib.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/dbm.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/shelve.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/sqlite3.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/configparser.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/csv.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/formdata.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/json.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/json5.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/jsonlines.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/multipart.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/toml.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/xml.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/yaml.py +1 -1
- exonware/xwsystem/io/serialization/registry.py +1 -1
- exonware/xwsystem/io/serialization/serializer.py +1 -1
- exonware/xwsystem/io/serialization/utils/__init__.py +1 -1
- exonware/xwsystem/io/serialization/utils/path_ops.py +1 -1
- exonware/xwsystem/io/stream/__init__.py +1 -1
- exonware/xwsystem/io/stream/async_operations.py +1 -1
- exonware/xwsystem/io/stream/base.py +1 -1
- exonware/xwsystem/io/stream/codec_io.py +1 -1
- exonware/xwsystem/ipc/async_fabric.py +1 -1
- exonware/xwsystem/ipc/base.py +1 -1
- exonware/xwsystem/ipc/contracts.py +1 -1
- exonware/xwsystem/ipc/defs.py +1 -1
- exonware/xwsystem/ipc/errors.py +1 -1
- exonware/xwsystem/lazy_bootstrap.py +79 -0
- exonware/xwsystem/monitoring/base.py +1 -1
- exonware/xwsystem/monitoring/contracts.py +1 -1
- exonware/xwsystem/monitoring/defs.py +1 -1
- exonware/xwsystem/monitoring/errors.py +1 -1
- exonware/xwsystem/monitoring/performance_manager_generic.py +1 -1
- exonware/xwsystem/monitoring/system_monitor.py +1 -1
- exonware/xwsystem/monitoring/tracing.py +17 -15
- exonware/xwsystem/monitoring/tracker.py +1 -1
- exonware/xwsystem/operations/__init__.py +1 -1
- exonware/xwsystem/operations/base.py +1 -1
- exonware/xwsystem/operations/defs.py +1 -1
- exonware/xwsystem/operations/diff.py +1 -1
- exonware/xwsystem/operations/merge.py +1 -1
- exonware/xwsystem/operations/patch.py +1 -1
- exonware/xwsystem/patterns/base.py +1 -1
- exonware/xwsystem/patterns/contracts.py +1 -1
- exonware/xwsystem/patterns/defs.py +1 -1
- exonware/xwsystem/patterns/errors.py +1 -1
- exonware/xwsystem/patterns/registry.py +1 -1
- exonware/xwsystem/plugins/__init__.py +1 -1
- exonware/xwsystem/plugins/base.py +1 -1
- exonware/xwsystem/plugins/contracts.py +1 -1
- exonware/xwsystem/plugins/defs.py +1 -1
- exonware/xwsystem/plugins/errors.py +1 -1
- exonware/xwsystem/runtime/__init__.py +1 -1
- exonware/xwsystem/runtime/base.py +1 -1
- exonware/xwsystem/runtime/contracts.py +1 -1
- exonware/xwsystem/runtime/defs.py +1 -1
- exonware/xwsystem/runtime/env.py +1 -1
- exonware/xwsystem/runtime/errors.py +1 -1
- exonware/xwsystem/runtime/reflection.py +1 -1
- exonware/xwsystem/security/auth.py +1 -1
- exonware/xwsystem/security/base.py +1 -1
- exonware/xwsystem/security/contracts.py +1 -1
- exonware/xwsystem/security/crypto.py +1 -1
- exonware/xwsystem/security/defs.py +1 -1
- exonware/xwsystem/security/errors.py +1 -1
- exonware/xwsystem/security/hazmat.py +1 -1
- exonware/xwsystem/shared/__init__.py +1 -1
- exonware/xwsystem/shared/base.py +1 -1
- exonware/xwsystem/shared/contracts.py +1 -1
- exonware/xwsystem/shared/defs.py +1 -1
- exonware/xwsystem/shared/errors.py +1 -1
- exonware/xwsystem/structures/base.py +1 -1
- exonware/xwsystem/structures/contracts.py +1 -1
- exonware/xwsystem/structures/defs.py +1 -1
- exonware/xwsystem/structures/errors.py +1 -1
- exonware/xwsystem/threading/async_primitives.py +1 -1
- exonware/xwsystem/threading/base.py +1 -1
- exonware/xwsystem/threading/contracts.py +1 -1
- exonware/xwsystem/threading/defs.py +1 -1
- exonware/xwsystem/threading/errors.py +1 -1
- exonware/xwsystem/utils/base.py +1 -1
- exonware/xwsystem/utils/contracts.py +1 -1
- exonware/xwsystem/utils/dt/__init__.py +1 -1
- exonware/xwsystem/utils/dt/base.py +1 -1
- exonware/xwsystem/utils/dt/contracts.py +1 -1
- exonware/xwsystem/utils/dt/defs.py +1 -1
- exonware/xwsystem/utils/dt/errors.py +1 -1
- exonware/xwsystem/utils/dt/formatting.py +1 -1
- exonware/xwsystem/utils/dt/humanize.py +1 -1
- exonware/xwsystem/utils/dt/parsing.py +1 -1
- exonware/xwsystem/utils/dt/timezone_utils.py +1 -1
- exonware/xwsystem/utils/errors.py +1 -1
- exonware/xwsystem/utils/test_runner.py +1 -1
- exonware/xwsystem/utils/utils_contracts.py +1 -1
- exonware/xwsystem/validation/__init__.py +1 -1
- exonware/xwsystem/validation/base.py +1 -1
- exonware/xwsystem/validation/contracts.py +1 -1
- exonware/xwsystem/validation/declarative.py +1 -1
- exonware/xwsystem/validation/defs.py +1 -1
- exonware/xwsystem/validation/errors.py +1 -1
- exonware/xwsystem/validation/fluent_validator.py +1 -1
- exonware/xwsystem/version.py +2 -2
- {exonware_xwsystem-0.0.1.407.dist-info → exonware_xwsystem-0.0.1.409.dist-info}/METADATA +3 -3
- exonware_xwsystem-0.0.1.409.dist-info/RECORD +274 -0
- exonware/xwsystem/_lazy_bootstrap.py +0 -77
- exonware/xwsystem/utils/lazy_package/ARCHITECTURE.md +0 -820
- exonware/xwsystem/utils/lazy_package/__init__.py +0 -268
- exonware/xwsystem/utils/lazy_package/config.py +0 -163
- exonware/xwsystem/utils/lazy_package/lazy_base.py +0 -465
- exonware/xwsystem/utils/lazy_package/lazy_contracts.py +0 -290
- exonware/xwsystem/utils/lazy_package/lazy_core.py +0 -2248
- exonware/xwsystem/utils/lazy_package/lazy_errors.py +0 -253
- exonware/xwsystem/utils/lazy_package/lazy_state.py +0 -86
- exonware_xwsystem-0.0.1.407.dist-info/RECORD +0 -282
- {exonware_xwsystem-0.0.1.407.dist-info → exonware_xwsystem-0.0.1.409.dist-info}/WHEEL +0 -0
- {exonware_xwsystem-0.0.1.407.dist-info → exonware_xwsystem-0.0.1.409.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
#exonware/xwsystem/src/exonware/xwsystem/utils/lazy_package/lazy_contracts.py
|
|
3
|
-
|
|
4
|
-
Company: eXonware.com
|
|
5
|
-
Author: Eng. Muhammad AlShehri
|
|
6
|
-
Email: connect@exonware.com
|
|
7
|
-
Version: 0.0.1.407
|
|
8
|
-
Generation Date: 10-Oct-2025
|
|
9
|
-
|
|
10
|
-
Contracts for Lazy Loading System
|
|
11
|
-
|
|
12
|
-
This module defines all interfaces, enums, and protocols for the lazy loading
|
|
13
|
-
system following DEV_GUIDELINES.md structure.
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
from enum import Enum
|
|
17
|
-
from typing import Protocol, Dict, List, Optional, Any, Tuple
|
|
18
|
-
from dataclasses import dataclass
|
|
19
|
-
from types import ModuleType
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# =============================================================================
|
|
23
|
-
# ENUMS
|
|
24
|
-
# =============================================================================
|
|
25
|
-
|
|
26
|
-
class LazyInstallMode(Enum):
|
|
27
|
-
"""Lazy installation modes."""
|
|
28
|
-
AUTO = "auto" # Automatically install without asking
|
|
29
|
-
INTERACTIVE = "interactive" # Ask user before installing
|
|
30
|
-
WARN = "warn" # Log warning but don't install (for monitoring)
|
|
31
|
-
DISABLED = "disabled" # Don't install anything
|
|
32
|
-
DRY_RUN = "dry_run" # Show what would be installed but don't install
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class PathType(Enum):
|
|
36
|
-
"""Path types for validation."""
|
|
37
|
-
FILE = "file"
|
|
38
|
-
DIRECTORY = "directory"
|
|
39
|
-
UNKNOWN = "unknown"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# =============================================================================
|
|
43
|
-
# DATACLASSES
|
|
44
|
-
# =============================================================================
|
|
45
|
-
|
|
46
|
-
@dataclass
|
|
47
|
-
class DependencyInfo:
|
|
48
|
-
"""Information about a discovered dependency."""
|
|
49
|
-
import_name: str
|
|
50
|
-
package_name: str
|
|
51
|
-
version: Optional[str] = None
|
|
52
|
-
source: str = "unknown"
|
|
53
|
-
category: str = "general"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# =============================================================================
|
|
57
|
-
# PROTOCOLS / INTERFACES (Following DEV_GUIDELINES.md - Use IClass naming)
|
|
58
|
-
# =============================================================================
|
|
59
|
-
|
|
60
|
-
class IPackageDiscovery(Protocol):
|
|
61
|
-
"""
|
|
62
|
-
Interface for package discovery strategies.
|
|
63
|
-
|
|
64
|
-
Implements Strategy pattern for different discovery sources
|
|
65
|
-
(pyproject.toml, requirements.txt, setup.py, etc.)
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
def discover_all_dependencies(self) -> Dict[str, str]:
|
|
69
|
-
"""
|
|
70
|
-
Discover all dependencies from all available sources.
|
|
71
|
-
|
|
72
|
-
Returns:
|
|
73
|
-
Dict mapping import_name -> package_name
|
|
74
|
-
"""
|
|
75
|
-
...
|
|
76
|
-
|
|
77
|
-
def get_package_for_import(self, import_name: str) -> Optional[str]:
|
|
78
|
-
"""
|
|
79
|
-
Get package name for a given import name.
|
|
80
|
-
|
|
81
|
-
Args:
|
|
82
|
-
import_name: Import name (e.g., 'cv2', 'PIL')
|
|
83
|
-
|
|
84
|
-
Returns:
|
|
85
|
-
Package name (e.g., 'opencv-python', 'Pillow') or None
|
|
86
|
-
"""
|
|
87
|
-
...
|
|
88
|
-
|
|
89
|
-
def get_imports_for_package(self, package_name: str) -> List[str]:
|
|
90
|
-
"""
|
|
91
|
-
Get all possible import names for a package.
|
|
92
|
-
|
|
93
|
-
Args:
|
|
94
|
-
package_name: Package name (e.g., 'opencv-python')
|
|
95
|
-
|
|
96
|
-
Returns:
|
|
97
|
-
List of import names (e.g., ['opencv-python', 'cv2'])
|
|
98
|
-
"""
|
|
99
|
-
...
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
class IPackageInstaller(Protocol):
|
|
103
|
-
"""
|
|
104
|
-
Interface for package installation strategies.
|
|
105
|
-
|
|
106
|
-
Implements Strategy pattern for different installation modes
|
|
107
|
-
(AUTO, INTERACTIVE, WARN, DISABLED, DRY_RUN).
|
|
108
|
-
"""
|
|
109
|
-
|
|
110
|
-
def install_package(self, package_name: str, module_name: str = None) -> bool:
|
|
111
|
-
"""
|
|
112
|
-
Install a package.
|
|
113
|
-
|
|
114
|
-
Args:
|
|
115
|
-
package_name: Name of package to install
|
|
116
|
-
module_name: Name of module being imported (for interactive mode)
|
|
117
|
-
|
|
118
|
-
Returns:
|
|
119
|
-
True if installation successful, False otherwise
|
|
120
|
-
"""
|
|
121
|
-
...
|
|
122
|
-
|
|
123
|
-
def is_package_installed(self, package_name: str) -> bool:
|
|
124
|
-
"""
|
|
125
|
-
Check if a package is already installed.
|
|
126
|
-
|
|
127
|
-
Args:
|
|
128
|
-
package_name: Name of package to check
|
|
129
|
-
|
|
130
|
-
Returns:
|
|
131
|
-
True if installed, False otherwise
|
|
132
|
-
"""
|
|
133
|
-
...
|
|
134
|
-
|
|
135
|
-
def install_and_import(self, module_name: str, package_name: str = None) -> Tuple[Optional[ModuleType], bool]:
|
|
136
|
-
"""
|
|
137
|
-
Install package and import module.
|
|
138
|
-
|
|
139
|
-
Args:
|
|
140
|
-
module_name: Name of module to import
|
|
141
|
-
package_name: Optional package name if different from module name
|
|
142
|
-
|
|
143
|
-
Returns:
|
|
144
|
-
Tuple of (module_object, success_flag)
|
|
145
|
-
"""
|
|
146
|
-
...
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
class IImportHook(Protocol):
|
|
150
|
-
"""
|
|
151
|
-
Interface for import hook strategies.
|
|
152
|
-
|
|
153
|
-
Implements Observer pattern to intercept import failures.
|
|
154
|
-
"""
|
|
155
|
-
|
|
156
|
-
def install_hook(self) -> None:
|
|
157
|
-
"""Install the import hook into sys.meta_path."""
|
|
158
|
-
...
|
|
159
|
-
|
|
160
|
-
def uninstall_hook(self) -> None:
|
|
161
|
-
"""Uninstall the import hook from sys.meta_path."""
|
|
162
|
-
...
|
|
163
|
-
|
|
164
|
-
def is_installed(self) -> bool:
|
|
165
|
-
"""
|
|
166
|
-
Check if hook is installed.
|
|
167
|
-
|
|
168
|
-
Returns:
|
|
169
|
-
True if hook is in sys.meta_path, False otherwise
|
|
170
|
-
"""
|
|
171
|
-
...
|
|
172
|
-
|
|
173
|
-
def handle_import_error(self, module_name: str) -> Optional[Any]:
|
|
174
|
-
"""
|
|
175
|
-
Handle ImportError by attempting to install and re-import.
|
|
176
|
-
|
|
177
|
-
Args:
|
|
178
|
-
module_name: Name of module that failed to import
|
|
179
|
-
|
|
180
|
-
Returns:
|
|
181
|
-
Imported module if successful, None otherwise
|
|
182
|
-
"""
|
|
183
|
-
...
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
class IPackageCache(Protocol):
|
|
187
|
-
"""
|
|
188
|
-
Interface for package caching strategies.
|
|
189
|
-
|
|
190
|
-
Implements Proxy pattern for cached access to packages.
|
|
191
|
-
"""
|
|
192
|
-
|
|
193
|
-
def get_cached(self, key: str) -> Optional[Any]:
|
|
194
|
-
"""
|
|
195
|
-
Get cached value.
|
|
196
|
-
|
|
197
|
-
Args:
|
|
198
|
-
key: Cache key
|
|
199
|
-
|
|
200
|
-
Returns:
|
|
201
|
-
Cached value or None if not found
|
|
202
|
-
"""
|
|
203
|
-
...
|
|
204
|
-
|
|
205
|
-
def set_cached(self, key: str, value: Any) -> None:
|
|
206
|
-
"""
|
|
207
|
-
Set cached value.
|
|
208
|
-
|
|
209
|
-
Args:
|
|
210
|
-
key: Cache key
|
|
211
|
-
value: Value to cache
|
|
212
|
-
"""
|
|
213
|
-
...
|
|
214
|
-
|
|
215
|
-
def clear_cache(self) -> None:
|
|
216
|
-
"""Clear all cached values."""
|
|
217
|
-
...
|
|
218
|
-
|
|
219
|
-
def is_cache_valid(self, key: str) -> bool:
|
|
220
|
-
"""
|
|
221
|
-
Check if cache entry is still valid.
|
|
222
|
-
|
|
223
|
-
Args:
|
|
224
|
-
key: Cache key
|
|
225
|
-
|
|
226
|
-
Returns:
|
|
227
|
-
True if valid, False otherwise
|
|
228
|
-
"""
|
|
229
|
-
...
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
class ILazyLoader(Protocol):
|
|
233
|
-
"""
|
|
234
|
-
Interface for lazy loading strategies.
|
|
235
|
-
|
|
236
|
-
Implements Proxy pattern for deferred module loading.
|
|
237
|
-
"""
|
|
238
|
-
|
|
239
|
-
def load_module(self, module_path: str) -> ModuleType:
|
|
240
|
-
"""
|
|
241
|
-
Load a module lazily.
|
|
242
|
-
|
|
243
|
-
Args:
|
|
244
|
-
module_path: Full module path to load
|
|
245
|
-
|
|
246
|
-
Returns:
|
|
247
|
-
Loaded module
|
|
248
|
-
"""
|
|
249
|
-
...
|
|
250
|
-
|
|
251
|
-
def is_loaded(self, module_path: str) -> bool:
|
|
252
|
-
"""
|
|
253
|
-
Check if module is already loaded.
|
|
254
|
-
|
|
255
|
-
Args:
|
|
256
|
-
module_path: Module path to check
|
|
257
|
-
|
|
258
|
-
Returns:
|
|
259
|
-
True if loaded, False otherwise
|
|
260
|
-
"""
|
|
261
|
-
...
|
|
262
|
-
|
|
263
|
-
def unload_module(self, module_path: str) -> None:
|
|
264
|
-
"""
|
|
265
|
-
Unload a module from cache.
|
|
266
|
-
|
|
267
|
-
Args:
|
|
268
|
-
module_path: Module path to unload
|
|
269
|
-
"""
|
|
270
|
-
...
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
# =============================================================================
|
|
274
|
-
# EXPORT ALL
|
|
275
|
-
# =============================================================================
|
|
276
|
-
|
|
277
|
-
__all__ = [
|
|
278
|
-
# Enums
|
|
279
|
-
'LazyInstallMode',
|
|
280
|
-
'PathType',
|
|
281
|
-
# Dataclasses
|
|
282
|
-
'DependencyInfo',
|
|
283
|
-
# Interfaces/Protocols
|
|
284
|
-
'IPackageDiscovery',
|
|
285
|
-
'IPackageInstaller',
|
|
286
|
-
'IImportHook',
|
|
287
|
-
'IPackageCache',
|
|
288
|
-
'ILazyLoader',
|
|
289
|
-
]
|
|
290
|
-
|