exonware-xwlazy 0.1.0.11__py3-none-any.whl → 0.1.0.20__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 +26 -0
- exonware/xwlazy/__init__.py +0 -0
- exonware/xwlazy/common/__init__.py +47 -0
- exonware/xwlazy/common/base.py +56 -0
- exonware/xwlazy/common/cache.py +504 -0
- exonware/xwlazy/common/logger.py +257 -0
- exonware/xwlazy/common/services/__init__.py +72 -0
- exonware/xwlazy/common/services/dependency_mapper.py +232 -0
- exonware/xwlazy/common/services/install_async_utils.py +165 -0
- exonware/xwlazy/common/services/install_cache_utils.py +245 -0
- exonware/xwlazy/common/services/keyword_detection.py +283 -0
- exonware/xwlazy/common/services/spec_cache.py +165 -0
- xwlazy/lazy/lazy_state.py → exonware/xwlazy/common/services/state_manager.py +0 -2
- exonware/xwlazy/common/strategies/__init__.py +28 -0
- exonware/xwlazy/common/strategies/caching_dict.py +44 -0
- exonware/xwlazy/common/strategies/caching_installation.py +88 -0
- exonware/xwlazy/common/strategies/caching_lfu.py +66 -0
- exonware/xwlazy/common/strategies/caching_lru.py +63 -0
- exonware/xwlazy/common/strategies/caching_multitier.py +59 -0
- exonware/xwlazy/common/strategies/caching_ttl.py +59 -0
- {xwlazy/lazy → exonware/xwlazy}/config.py +51 -21
- exonware/xwlazy/contracts.py +1396 -0
- exonware/xwlazy/defs.py +378 -0
- xwlazy/lazy/lazy_errors.py → exonware/xwlazy/errors.py +21 -16
- exonware/xwlazy/facade.py +991 -0
- exonware/xwlazy/module/__init__.py +18 -0
- exonware/xwlazy/module/base.py +565 -0
- exonware/xwlazy/module/data.py +17 -0
- exonware/xwlazy/module/facade.py +246 -0
- exonware/xwlazy/module/importer_engine.py +2117 -0
- exonware/xwlazy/module/strategies/__init__.py +22 -0
- exonware/xwlazy/module/strategies/module_helper_lazy.py +93 -0
- exonware/xwlazy/module/strategies/module_helper_simple.py +65 -0
- exonware/xwlazy/module/strategies/module_manager_advanced.py +111 -0
- exonware/xwlazy/module/strategies/module_manager_simple.py +95 -0
- exonware/xwlazy/package/__init__.py +18 -0
- exonware/xwlazy/package/base.py +798 -0
- xwlazy/lazy/host_conf.py → exonware/xwlazy/package/conf.py +61 -16
- exonware/xwlazy/package/data.py +17 -0
- exonware/xwlazy/package/facade.py +480 -0
- exonware/xwlazy/package/services/__init__.py +84 -0
- exonware/xwlazy/package/services/async_install_handle.py +87 -0
- exonware/xwlazy/package/services/config_manager.py +245 -0
- exonware/xwlazy/package/services/discovery.py +370 -0
- {xwlazy/lazy → exonware/xwlazy/package/services}/host_packages.py +43 -20
- exonware/xwlazy/package/services/install_async.py +277 -0
- exonware/xwlazy/package/services/install_cache.py +145 -0
- exonware/xwlazy/package/services/install_interactive.py +59 -0
- exonware/xwlazy/package/services/install_policy.py +156 -0
- exonware/xwlazy/package/services/install_registry.py +54 -0
- exonware/xwlazy/package/services/install_result.py +17 -0
- exonware/xwlazy/package/services/install_sbom.py +153 -0
- exonware/xwlazy/package/services/install_utils.py +79 -0
- exonware/xwlazy/package/services/installer_engine.py +406 -0
- exonware/xwlazy/package/services/lazy_installer.py +718 -0
- {xwlazy/lazy → exonware/xwlazy/package/services}/manifest.py +40 -33
- exonware/xwlazy/package/services/strategy_registry.py +186 -0
- exonware/xwlazy/package/strategies/__init__.py +57 -0
- exonware/xwlazy/package/strategies/package_discovery_file.py +129 -0
- exonware/xwlazy/package/strategies/package_discovery_hybrid.py +84 -0
- exonware/xwlazy/package/strategies/package_discovery_manifest.py +101 -0
- exonware/xwlazy/package/strategies/package_execution_async.py +113 -0
- exonware/xwlazy/package/strategies/package_execution_cached.py +90 -0
- exonware/xwlazy/package/strategies/package_execution_pip.py +99 -0
- exonware/xwlazy/package/strategies/package_execution_wheel.py +106 -0
- exonware/xwlazy/package/strategies/package_mapping_discovery_first.py +100 -0
- exonware/xwlazy/package/strategies/package_mapping_hybrid.py +105 -0
- exonware/xwlazy/package/strategies/package_mapping_manifest_first.py +100 -0
- exonware/xwlazy/package/strategies/package_policy_allow_list.py +57 -0
- exonware/xwlazy/package/strategies/package_policy_deny_list.py +57 -0
- exonware/xwlazy/package/strategies/package_policy_permissive.py +46 -0
- exonware/xwlazy/package/strategies/package_timing_clean.py +67 -0
- exonware/xwlazy/package/strategies/package_timing_full.py +66 -0
- exonware/xwlazy/package/strategies/package_timing_smart.py +68 -0
- exonware/xwlazy/package/strategies/package_timing_temporary.py +66 -0
- exonware/xwlazy/runtime/__init__.py +18 -0
- exonware/xwlazy/runtime/adaptive_learner.py +129 -0
- exonware/xwlazy/runtime/base.py +274 -0
- exonware/xwlazy/runtime/facade.py +94 -0
- exonware/xwlazy/runtime/intelligent_selector.py +170 -0
- exonware/xwlazy/runtime/metrics.py +60 -0
- exonware/xwlazy/runtime/performance.py +37 -0
- exonware/xwlazy/version.py +2 -2
- {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.20.dist-info}/METADATA +89 -11
- exonware_xwlazy-0.1.0.20.dist-info/RECORD +87 -0
- exonware_xwlazy-0.1.0.11.dist-info/RECORD +0 -20
- xwlazy/__init__.py +0 -34
- xwlazy/lazy/__init__.py +0 -301
- xwlazy/lazy/bootstrap.py +0 -106
- xwlazy/lazy/lazy_base.py +0 -465
- xwlazy/lazy/lazy_contracts.py +0 -290
- xwlazy/lazy/lazy_core.py +0 -3727
- xwlazy/lazy/logging_utils.py +0 -194
- xwlazy/version.py +0 -77
- {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.20.dist-info}/WHEEL +0 -0
- {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.20.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
"""
|
|
2
|
+
#exonware/xwlazy/src/exonware/xwlazy/config.py
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Company: eXonware.com
|
|
5
|
+
Author: Eng. Muhammad AlShehri
|
|
6
|
+
Email: connect@exonware.com
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
from typing import Tuple
|
|
8
|
+
Generation Date: 10-Oct-2025
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
config_package_lazy_install_enabled,
|
|
10
|
-
disable_lazy_mode,
|
|
11
|
-
enable_lazy_mode,
|
|
12
|
-
is_import_hook_installed,
|
|
13
|
-
is_lazy_install_enabled,
|
|
14
|
-
is_lazy_mode_enabled,
|
|
15
|
-
install_import_hook,
|
|
16
|
-
)
|
|
10
|
+
Configuration for Lazy Loading System
|
|
17
11
|
|
|
12
|
+
This module defines configuration classes for the lazy loading system
|
|
13
|
+
following GUIDE_ARCH.md structure.
|
|
14
|
+
"""
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from typing import Optional, Any, Dict
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
20
|
+
# Import LazyConfig dataclass from defs.py
|
|
21
|
+
from .defs import LazyConfig as _LazyConfigBase
|
|
26
22
|
|
|
23
|
+
# Extend LazyConfig with methods (dataclass is in defs.py)
|
|
24
|
+
class LazyConfig(_LazyConfigBase):
|
|
25
|
+
"""Bridge configuration settings with the lazy package implementation."""
|
|
26
|
+
|
|
27
27
|
def __post_init__(self) -> None:
|
|
28
|
-
|
|
28
|
+
"""Normalize package names."""
|
|
29
|
+
super().__post_init__()
|
|
29
30
|
|
|
30
31
|
# High-level API -----------------------------------------------------
|
|
31
32
|
@property
|
|
32
33
|
def lazy_import(self) -> bool:
|
|
33
34
|
"""Return whether lazy mode is currently active."""
|
|
35
|
+
# Import from facade
|
|
36
|
+
from .facade import is_lazy_mode_enabled
|
|
34
37
|
return is_lazy_mode_enabled()
|
|
35
38
|
|
|
36
39
|
@lazy_import.setter
|
|
@@ -52,6 +55,15 @@ class LazyConfig:
|
|
|
52
55
|
Includes re-hooking support: If lazy is enabled and install_hook is True,
|
|
53
56
|
ensures the import hook is installed even if it wasn't installed initially.
|
|
54
57
|
"""
|
|
58
|
+
# Import from facade
|
|
59
|
+
from .facade import (
|
|
60
|
+
config_package_lazy_install_enabled,
|
|
61
|
+
disable_lazy_mode,
|
|
62
|
+
enable_lazy_mode,
|
|
63
|
+
is_import_hook_installed,
|
|
64
|
+
install_import_hook,
|
|
65
|
+
)
|
|
66
|
+
|
|
55
67
|
if enabled:
|
|
56
68
|
self._configure_packages(True, mode=mode, install_hook=install_hook)
|
|
57
69
|
enable_lazy_mode(
|
|
@@ -99,6 +111,12 @@ class LazyConfig:
|
|
|
99
111
|
Returns:
|
|
100
112
|
Dictionary with lazy mode status information
|
|
101
113
|
"""
|
|
114
|
+
# Import from facade
|
|
115
|
+
from .facade import (
|
|
116
|
+
is_import_hook_installed,
|
|
117
|
+
is_lazy_install_enabled,
|
|
118
|
+
)
|
|
119
|
+
|
|
102
120
|
try:
|
|
103
121
|
primary_package = self.packages[0] if self.packages else "default"
|
|
104
122
|
return {
|
|
@@ -123,6 +141,9 @@ class LazyConfig:
|
|
|
123
141
|
Returns:
|
|
124
142
|
True if lazy mode is enabled and hook is installed
|
|
125
143
|
"""
|
|
144
|
+
# Import from facade
|
|
145
|
+
from .facade import is_import_hook_installed
|
|
146
|
+
|
|
126
147
|
try:
|
|
127
148
|
primary_package = self.packages[0] if self.packages else "default"
|
|
128
149
|
return self.lazy_import and is_import_hook_installed(primary_package)
|
|
@@ -137,6 +158,9 @@ class LazyConfig:
|
|
|
137
158
|
mode: str = "auto",
|
|
138
159
|
install_hook: bool = True,
|
|
139
160
|
) -> None:
|
|
161
|
+
# Import from facade
|
|
162
|
+
from .facade import config_package_lazy_install_enabled
|
|
163
|
+
|
|
140
164
|
for package in self.packages:
|
|
141
165
|
config_package_lazy_install_enabled(
|
|
142
166
|
package,
|
|
@@ -151,6 +175,12 @@ class LazyConfig:
|
|
|
151
175
|
|
|
152
176
|
Re-hooking support: Install hook if not already installed.
|
|
153
177
|
"""
|
|
178
|
+
# Import from facade
|
|
179
|
+
from .facade import (
|
|
180
|
+
is_import_hook_installed,
|
|
181
|
+
install_import_hook,
|
|
182
|
+
)
|
|
183
|
+
|
|
154
184
|
try:
|
|
155
185
|
primary_package = self.packages[0] if self.packages else "default"
|
|
156
186
|
if not is_import_hook_installed(primary_package):
|
|
@@ -159,5 +189,5 @@ class LazyConfig:
|
|
|
159
189
|
# Fail silently - hook installation failure shouldn't break package
|
|
160
190
|
pass
|
|
161
191
|
|
|
162
|
-
|
|
163
192
|
DEFAULT_LAZY_CONFIG = LazyConfig()
|
|
193
|
+
|