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.
Files changed (96) hide show
  1. exonware/__init__.py +26 -0
  2. exonware/xwlazy/__init__.py +0 -0
  3. exonware/xwlazy/common/__init__.py +47 -0
  4. exonware/xwlazy/common/base.py +56 -0
  5. exonware/xwlazy/common/cache.py +504 -0
  6. exonware/xwlazy/common/logger.py +257 -0
  7. exonware/xwlazy/common/services/__init__.py +72 -0
  8. exonware/xwlazy/common/services/dependency_mapper.py +232 -0
  9. exonware/xwlazy/common/services/install_async_utils.py +165 -0
  10. exonware/xwlazy/common/services/install_cache_utils.py +245 -0
  11. exonware/xwlazy/common/services/keyword_detection.py +283 -0
  12. exonware/xwlazy/common/services/spec_cache.py +165 -0
  13. xwlazy/lazy/lazy_state.py → exonware/xwlazy/common/services/state_manager.py +0 -2
  14. exonware/xwlazy/common/strategies/__init__.py +28 -0
  15. exonware/xwlazy/common/strategies/caching_dict.py +44 -0
  16. exonware/xwlazy/common/strategies/caching_installation.py +88 -0
  17. exonware/xwlazy/common/strategies/caching_lfu.py +66 -0
  18. exonware/xwlazy/common/strategies/caching_lru.py +63 -0
  19. exonware/xwlazy/common/strategies/caching_multitier.py +59 -0
  20. exonware/xwlazy/common/strategies/caching_ttl.py +59 -0
  21. {xwlazy/lazy → exonware/xwlazy}/config.py +51 -21
  22. exonware/xwlazy/contracts.py +1396 -0
  23. exonware/xwlazy/defs.py +378 -0
  24. xwlazy/lazy/lazy_errors.py → exonware/xwlazy/errors.py +21 -16
  25. exonware/xwlazy/facade.py +991 -0
  26. exonware/xwlazy/module/__init__.py +18 -0
  27. exonware/xwlazy/module/base.py +565 -0
  28. exonware/xwlazy/module/data.py +17 -0
  29. exonware/xwlazy/module/facade.py +246 -0
  30. exonware/xwlazy/module/importer_engine.py +2117 -0
  31. exonware/xwlazy/module/strategies/__init__.py +22 -0
  32. exonware/xwlazy/module/strategies/module_helper_lazy.py +93 -0
  33. exonware/xwlazy/module/strategies/module_helper_simple.py +65 -0
  34. exonware/xwlazy/module/strategies/module_manager_advanced.py +111 -0
  35. exonware/xwlazy/module/strategies/module_manager_simple.py +95 -0
  36. exonware/xwlazy/package/__init__.py +18 -0
  37. exonware/xwlazy/package/base.py +798 -0
  38. xwlazy/lazy/host_conf.py → exonware/xwlazy/package/conf.py +61 -16
  39. exonware/xwlazy/package/data.py +17 -0
  40. exonware/xwlazy/package/facade.py +480 -0
  41. exonware/xwlazy/package/services/__init__.py +84 -0
  42. exonware/xwlazy/package/services/async_install_handle.py +87 -0
  43. exonware/xwlazy/package/services/config_manager.py +245 -0
  44. exonware/xwlazy/package/services/discovery.py +370 -0
  45. {xwlazy/lazy → exonware/xwlazy/package/services}/host_packages.py +43 -20
  46. exonware/xwlazy/package/services/install_async.py +277 -0
  47. exonware/xwlazy/package/services/install_cache.py +145 -0
  48. exonware/xwlazy/package/services/install_interactive.py +59 -0
  49. exonware/xwlazy/package/services/install_policy.py +156 -0
  50. exonware/xwlazy/package/services/install_registry.py +54 -0
  51. exonware/xwlazy/package/services/install_result.py +17 -0
  52. exonware/xwlazy/package/services/install_sbom.py +153 -0
  53. exonware/xwlazy/package/services/install_utils.py +79 -0
  54. exonware/xwlazy/package/services/installer_engine.py +406 -0
  55. exonware/xwlazy/package/services/lazy_installer.py +718 -0
  56. {xwlazy/lazy → exonware/xwlazy/package/services}/manifest.py +40 -33
  57. exonware/xwlazy/package/services/strategy_registry.py +186 -0
  58. exonware/xwlazy/package/strategies/__init__.py +57 -0
  59. exonware/xwlazy/package/strategies/package_discovery_file.py +129 -0
  60. exonware/xwlazy/package/strategies/package_discovery_hybrid.py +84 -0
  61. exonware/xwlazy/package/strategies/package_discovery_manifest.py +101 -0
  62. exonware/xwlazy/package/strategies/package_execution_async.py +113 -0
  63. exonware/xwlazy/package/strategies/package_execution_cached.py +90 -0
  64. exonware/xwlazy/package/strategies/package_execution_pip.py +99 -0
  65. exonware/xwlazy/package/strategies/package_execution_wheel.py +106 -0
  66. exonware/xwlazy/package/strategies/package_mapping_discovery_first.py +100 -0
  67. exonware/xwlazy/package/strategies/package_mapping_hybrid.py +105 -0
  68. exonware/xwlazy/package/strategies/package_mapping_manifest_first.py +100 -0
  69. exonware/xwlazy/package/strategies/package_policy_allow_list.py +57 -0
  70. exonware/xwlazy/package/strategies/package_policy_deny_list.py +57 -0
  71. exonware/xwlazy/package/strategies/package_policy_permissive.py +46 -0
  72. exonware/xwlazy/package/strategies/package_timing_clean.py +67 -0
  73. exonware/xwlazy/package/strategies/package_timing_full.py +66 -0
  74. exonware/xwlazy/package/strategies/package_timing_smart.py +68 -0
  75. exonware/xwlazy/package/strategies/package_timing_temporary.py +66 -0
  76. exonware/xwlazy/runtime/__init__.py +18 -0
  77. exonware/xwlazy/runtime/adaptive_learner.py +129 -0
  78. exonware/xwlazy/runtime/base.py +274 -0
  79. exonware/xwlazy/runtime/facade.py +94 -0
  80. exonware/xwlazy/runtime/intelligent_selector.py +170 -0
  81. exonware/xwlazy/runtime/metrics.py +60 -0
  82. exonware/xwlazy/runtime/performance.py +37 -0
  83. exonware/xwlazy/version.py +2 -2
  84. {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.20.dist-info}/METADATA +89 -11
  85. exonware_xwlazy-0.1.0.20.dist-info/RECORD +87 -0
  86. exonware_xwlazy-0.1.0.11.dist-info/RECORD +0 -20
  87. xwlazy/__init__.py +0 -34
  88. xwlazy/lazy/__init__.py +0 -301
  89. xwlazy/lazy/bootstrap.py +0 -106
  90. xwlazy/lazy/lazy_base.py +0 -465
  91. xwlazy/lazy/lazy_contracts.py +0 -290
  92. xwlazy/lazy/lazy_core.py +0 -3727
  93. xwlazy/lazy/logging_utils.py +0 -194
  94. xwlazy/version.py +0 -77
  95. {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.20.dist-info}/WHEEL +0 -0
  96. {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
- from __future__ import annotations
1
+ """
2
+ #exonware/xwlazy/src/exonware/xwlazy/config.py
2
3
 
3
- """Configuration helpers for the lazy-loading subsystem."""
4
+ Company: eXonware.com
5
+ Author: Eng. Muhammad AlShehri
6
+ Email: connect@exonware.com
4
7
 
5
- from dataclasses import dataclass, field
6
- from typing import Tuple
8
+ Generation Date: 10-Oct-2025
7
9
 
8
- from .lazy_core import (
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
- @dataclass
20
- class LazyConfig:
21
- """Bridge configuration settings with the lazy package implementation."""
16
+ from __future__ import annotations
17
+
18
+ from typing import Optional, Any, Dict
22
19
 
23
- packages: Tuple[str, ...] = field(
24
- default_factory=lambda: ("default",)
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
- self.packages = tuple(package.lower() for package in self.packages)
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
+