exonware-xwlazy 0.1.0.11__py3-none-any.whl → 0.1.0.19__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 +22 -0
  2. exonware/xwlazy/__init__.py +0 -0
  3. exonware/xwlazy/common/__init__.py +47 -0
  4. exonware/xwlazy/common/base.py +58 -0
  5. exonware/xwlazy/common/cache.py +506 -0
  6. exonware/xwlazy/common/logger.py +268 -0
  7. exonware/xwlazy/common/services/__init__.py +72 -0
  8. exonware/xwlazy/common/services/dependency_mapper.py +234 -0
  9. exonware/xwlazy/common/services/install_async_utils.py +169 -0
  10. exonware/xwlazy/common/services/install_cache_utils.py +257 -0
  11. exonware/xwlazy/common/services/keyword_detection.py +292 -0
  12. exonware/xwlazy/common/services/spec_cache.py +173 -0
  13. exonware/xwlazy/common/strategies/__init__.py +28 -0
  14. exonware/xwlazy/common/strategies/caching_dict.py +45 -0
  15. exonware/xwlazy/common/strategies/caching_installation.py +89 -0
  16. exonware/xwlazy/common/strategies/caching_lfu.py +67 -0
  17. exonware/xwlazy/common/strategies/caching_lru.py +64 -0
  18. exonware/xwlazy/common/strategies/caching_multitier.py +60 -0
  19. exonware/xwlazy/common/strategies/caching_ttl.py +60 -0
  20. {xwlazy/lazy → exonware/xwlazy}/config.py +52 -20
  21. exonware/xwlazy/contracts.py +1410 -0
  22. exonware/xwlazy/defs.py +397 -0
  23. xwlazy/lazy/lazy_errors.py → exonware/xwlazy/errors.py +21 -8
  24. exonware/xwlazy/facade.py +1049 -0
  25. exonware/xwlazy/module/__init__.py +18 -0
  26. exonware/xwlazy/module/base.py +569 -0
  27. exonware/xwlazy/module/data.py +17 -0
  28. exonware/xwlazy/module/facade.py +247 -0
  29. exonware/xwlazy/module/importer_engine.py +2161 -0
  30. exonware/xwlazy/module/strategies/__init__.py +22 -0
  31. exonware/xwlazy/module/strategies/module_helper_lazy.py +94 -0
  32. exonware/xwlazy/module/strategies/module_helper_simple.py +66 -0
  33. exonware/xwlazy/module/strategies/module_manager_advanced.py +112 -0
  34. exonware/xwlazy/module/strategies/module_manager_simple.py +96 -0
  35. exonware/xwlazy/package/__init__.py +18 -0
  36. exonware/xwlazy/package/base.py +807 -0
  37. xwlazy/lazy/host_conf.py → exonware/xwlazy/package/conf.py +62 -10
  38. exonware/xwlazy/package/data.py +17 -0
  39. exonware/xwlazy/package/facade.py +481 -0
  40. exonware/xwlazy/package/services/__init__.py +84 -0
  41. exonware/xwlazy/package/services/async_install_handle.py +89 -0
  42. exonware/xwlazy/package/services/config_manager.py +246 -0
  43. exonware/xwlazy/package/services/discovery.py +374 -0
  44. {xwlazy/lazy → exonware/xwlazy/package/services}/host_packages.py +43 -16
  45. exonware/xwlazy/package/services/install_async.py +278 -0
  46. exonware/xwlazy/package/services/install_cache.py +146 -0
  47. exonware/xwlazy/package/services/install_interactive.py +60 -0
  48. exonware/xwlazy/package/services/install_policy.py +158 -0
  49. exonware/xwlazy/package/services/install_registry.py +56 -0
  50. exonware/xwlazy/package/services/install_result.py +17 -0
  51. exonware/xwlazy/package/services/install_sbom.py +154 -0
  52. exonware/xwlazy/package/services/install_utils.py +83 -0
  53. exonware/xwlazy/package/services/installer_engine.py +408 -0
  54. exonware/xwlazy/package/services/lazy_installer.py +720 -0
  55. {xwlazy/lazy → exonware/xwlazy/package/services}/manifest.py +42 -25
  56. exonware/xwlazy/package/services/strategy_registry.py +188 -0
  57. exonware/xwlazy/package/strategies/__init__.py +57 -0
  58. exonware/xwlazy/package/strategies/package_discovery_file.py +130 -0
  59. exonware/xwlazy/package/strategies/package_discovery_hybrid.py +85 -0
  60. exonware/xwlazy/package/strategies/package_discovery_manifest.py +102 -0
  61. exonware/xwlazy/package/strategies/package_execution_async.py +114 -0
  62. exonware/xwlazy/package/strategies/package_execution_cached.py +91 -0
  63. exonware/xwlazy/package/strategies/package_execution_pip.py +100 -0
  64. exonware/xwlazy/package/strategies/package_execution_wheel.py +107 -0
  65. exonware/xwlazy/package/strategies/package_mapping_discovery_first.py +101 -0
  66. exonware/xwlazy/package/strategies/package_mapping_hybrid.py +106 -0
  67. exonware/xwlazy/package/strategies/package_mapping_manifest_first.py +101 -0
  68. exonware/xwlazy/package/strategies/package_policy_allow_list.py +58 -0
  69. exonware/xwlazy/package/strategies/package_policy_deny_list.py +58 -0
  70. exonware/xwlazy/package/strategies/package_policy_permissive.py +47 -0
  71. exonware/xwlazy/package/strategies/package_timing_clean.py +68 -0
  72. exonware/xwlazy/package/strategies/package_timing_full.py +67 -0
  73. exonware/xwlazy/package/strategies/package_timing_smart.py +69 -0
  74. exonware/xwlazy/package/strategies/package_timing_temporary.py +67 -0
  75. exonware/xwlazy/runtime/__init__.py +18 -0
  76. exonware/xwlazy/runtime/adaptive_learner.py +131 -0
  77. exonware/xwlazy/runtime/base.py +276 -0
  78. exonware/xwlazy/runtime/facade.py +95 -0
  79. exonware/xwlazy/runtime/intelligent_selector.py +173 -0
  80. exonware/xwlazy/runtime/metrics.py +64 -0
  81. exonware/xwlazy/runtime/performance.py +39 -0
  82. exonware/xwlazy/version.py +2 -2
  83. {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.19.dist-info}/METADATA +86 -10
  84. exonware_xwlazy-0.1.0.19.dist-info/RECORD +87 -0
  85. exonware_xwlazy-0.1.0.11.dist-info/RECORD +0 -20
  86. xwlazy/__init__.py +0 -34
  87. xwlazy/lazy/__init__.py +0 -301
  88. xwlazy/lazy/bootstrap.py +0 -106
  89. xwlazy/lazy/lazy_base.py +0 -465
  90. xwlazy/lazy/lazy_contracts.py +0 -290
  91. xwlazy/lazy/lazy_core.py +0 -3727
  92. xwlazy/lazy/logging_utils.py +0 -194
  93. xwlazy/version.py +0 -77
  94. /xwlazy/lazy/lazy_state.py → /exonware/xwlazy/common/services/state_manager.py +0 -0
  95. {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.19.dist-info}/WHEEL +0 -0
  96. {exonware_xwlazy-0.1.0.11.dist-info → exonware_xwlazy-0.1.0.19.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exonware-xwlazy
3
- Version: 0.1.0.11
3
+ Version: 0.1.0.19
4
4
  Summary: Marker package that enables lazy install features across the eXonware suite.
5
5
  Project-URL: Homepage, https://exonware.com
6
6
  Project-URL: Repository, https://github.com/exonware/xwlazy
@@ -76,14 +76,40 @@ Built-in tracking of module load times, access counts, memory usage, and cache h
76
76
 
77
77
  **Why it matters:** Visibility into lazy loading performance helps identify bottlenecks and optimize import strategies.
78
78
 
79
- ### 🎨 **5 Installation Modes**
80
- - **AUTO:** Install automatically without asking
81
- - **INTERACTIVE:** Prompt user before each installation
82
- - **WARN:** Log warnings but don't install (monitoring mode)
83
- - **DISABLED:** Don't install anything
79
+ ### 🎨 **Two-Dimensional Mode System**
80
+
81
+ xwlazy uses a powerful two-dimensional mode system that separates **loading behavior** from **installation behavior**, giving you precise control over how modules are loaded and when packages are installed.
82
+
83
+ #### **Lazy Load Modes** (When modules load)
84
+ - **NONE:** Standard imports (no lazy loading)
85
+ - **AUTO:** Lazy loading enabled (deferred module loading)
86
+ - **PRELOAD:** Preload all modules on start (parallel loading)
87
+ - **BACKGROUND:** Load modules in background threads (non-blocking)
88
+ - **CACHED:** Cache loaded modules but allow unloading
89
+
90
+ #### **Lazy Install Modes** (When packages install)
91
+ - **NONE:** No auto-installation
92
+ - **SMART:** Install on first usage (on-demand)
93
+ - **FULL:** Install all dependencies on start (parallel batch)
94
+ - **CLEAN:** Install on usage + uninstall after completion
95
+ - **TEMPORARY:** Always uninstall after use (aggressive cleanup)
96
+ - **SIZE_AWARE:** Install small packages, skip large ones
97
+ - **INTERACTIVE:** Ask user before installing
98
+ - **WARN:** Log warning but don't install (monitoring mode)
99
+ - **DISABLED:** Don't install anything (explicit)
84
100
  - **DRY_RUN:** Show what would be installed
85
101
 
86
- **Why it matters:** Different environments need different policies. Development might use AUTO, production might use WARN or DISABLED.
102
+ #### **Preset Modes** (Quick combinations)
103
+ - **none:** NONE load + NONE install (standard imports)
104
+ - **lite:** AUTO load + NONE install (lazy loading only)
105
+ - **smart:** AUTO load + SMART install (on-demand installation)
106
+ - **full:** AUTO load + FULL install (install all on start)
107
+ - **clean:** AUTO load + CLEAN install (install + cleanup)
108
+ - **temporary:** AUTO load + TEMPORARY install (aggressive cleanup)
109
+ - **size_aware:** AUTO load + SIZE_AWARE install (smart sizing)
110
+ - **auto:** AUTO load + SMART install + auto-uninstall large packages
111
+
112
+ **Why it matters:** Different environments need different policies. Development might use `smart`, production might use `lite` or `warn`, CI/CD might use `clean` or `temporary`.
87
113
 
88
114
  ## 🏆 Performance Benchmarks
89
115
 
@@ -215,26 +241,76 @@ import suspicious_package # ❌ Blocked by security policy
215
241
 
216
242
  ## 🔧 Advanced Configuration
217
243
 
218
- ### Installation Modes
244
+ ### Two-Dimensional Mode Configuration
245
+
246
+ #### Using Preset Modes (Recommended)
247
+
248
+ ```python
249
+ from xwlazy.lazy import config_package_lazy_install_enabled
250
+
251
+ # Quick preset modes
252
+ config_package_lazy_install_enabled("xwsystem", enabled=True, mode="smart") # On-demand install
253
+ config_package_lazy_install_enabled("xwsystem", enabled=True, mode="full") # Install all on start
254
+ config_package_lazy_install_enabled("xwsystem", enabled=True, mode="clean") # Install + cleanup
255
+ config_package_lazy_install_enabled("xwsystem", enabled=True, mode="lite") # Lazy load only
256
+ ```
257
+
258
+ #### Using Explicit Mode Configuration
219
259
 
220
260
  ```python
221
261
  from xwlazy.lazy import (
222
262
  config_package_lazy_install_enabled,
263
+ LazyLoadMode,
223
264
  LazyInstallMode,
265
+ LazyModeConfig,
224
266
  )
225
267
 
268
+ # Explicit two-dimensional configuration
269
+ config_package_lazy_install_enabled(
270
+ "xwsystem",
271
+ enabled=True,
272
+ load_mode=LazyLoadMode.PRELOAD, # Preload all modules
273
+ install_mode=LazyInstallMode.SMART # Install on-demand
274
+ )
275
+
276
+ # Or use LazyModeConfig for full control
277
+ config = LazyModeConfig(
278
+ load_mode=LazyLoadMode.BACKGROUND,
279
+ install_mode=LazyInstallMode.SIZE_AWARE,
280
+ large_package_threshold_mb=100.0, # Skip packages > 100MB
281
+ background_workers=4 # 4 background workers
282
+ )
283
+ config_package_lazy_install_enabled(
284
+ "xwsystem",
285
+ enabled=True,
286
+ mode_config=config
287
+ )
288
+ ```
289
+
290
+ #### Using exonware.conf (Global Configuration)
291
+
292
+ ```python
293
+ import exonware.conf as conf
294
+
295
+ # Set global lazy mode for all packages
296
+ conf.lazy = "smart" # or "lite", "full", "clean", "auto", etc.
297
+ ```
298
+
299
+ #### Special Purpose Modes
300
+
301
+ ```python
226
302
  # Interactive mode: Ask user before installing
227
303
  config_package_lazy_install_enabled(
228
304
  "xwsystem",
229
305
  enabled=True,
230
- mode=LazyInstallMode.INTERACTIVE
306
+ mode="interactive" # or LazyInstallMode.INTERACTIVE
231
307
  )
232
308
 
233
309
  # Warn mode: Log but don't install (monitoring)
234
310
  config_package_lazy_install_enabled(
235
311
  "xwsystem",
236
312
  enabled=True,
237
- mode=LazyInstallMode.WARN
313
+ mode="warn" # or LazyInstallMode.WARN
238
314
  )
239
315
  ```
240
316
 
@@ -0,0 +1,87 @@
1
+ exonware/__init__.py,sha256=DHlz8Eb6ureiKpk7J3qfLtjNhPDPC6JShMl_SMqmBmc,633
2
+ exonware/xwlazy/__init__.py,sha256=r9ZxiW4E7fdF0LDsLO_VVCEidYCtTQpTFVP93QLXugk,10253
3
+ exonware/xwlazy/config.py,sha256=1J6dohfWl64_0LFgJKAJ1C1zTCmw-YSZyL0qF9YoIBw,6260
4
+ exonware/xwlazy/contracts.py,sha256=XX8l9hF5PcB11E2Z2Nw-9W0hUpd01bYDpbDAHM3D6C0,44396
5
+ exonware/xwlazy/defs.py,sha256=wlmMYIondagsXbhDDV7cZGETEBlP-WCJamk1DW3Kgxs,12326
6
+ exonware/xwlazy/errors.py,sha256=9pDrHPiJ-pL75V6e4tDDNTuMgE3PcntVl3mPhVK1ZFE,9213
7
+ exonware/xwlazy/facade.py,sha256=YtqHJzl5aJwMqd4gb2wIzik9aqp0JOn0YqzOW08TkDA,38824
8
+ exonware/xwlazy/version.py,sha256=W4y0sW1T7G7LwhxLSe5k4LYNuQlf80qptyEjD_Yl_hM,2351
9
+ exonware/xwlazy/common/__init__.py,sha256=XIC1ipNH34wGVKe622WH4F-VQdLxqUEHkOJQUlW46Ts,877
10
+ exonware/xwlazy/common/base.py,sha256=n49uWNV5Zm5BYY5jt5fZrsY15RpFKZEW_94nQLDN9wo,1423
11
+ exonware/xwlazy/common/cache.py,sha256=Fm5rGHAPHtXcYJ39pbhv01936mkoRPWkx4ttRHFxqa0,17566
12
+ exonware/xwlazy/common/logger.py,sha256=pwykamPOIiggZGAYxKJ8Lm7FKWeg-cBVb7NnPV1mzmE,8378
13
+ exonware/xwlazy/common/services/__init__.py,sha256=LgoL5PdLdaanKKkw1WghiNirLIFpkSkExlXWBezGZdc,1774
14
+ exonware/xwlazy/common/services/dependency_mapper.py,sha256=_i0q1omkUSCPNAMQaLWf-gWLgOKJi4F1H_c5dg4W6UQ,8557
15
+ exonware/xwlazy/common/services/install_async_utils.py,sha256=KQUX60F3J03Msxw_pP25d3pF0q73ixWfDfmSooWoTdw,4987
16
+ exonware/xwlazy/common/services/install_cache_utils.py,sha256=z5ZKi6tCNI91HS6DlfEiSXCi0SD7cZVAor6O7EryZ5Q,7618
17
+ exonware/xwlazy/common/services/keyword_detection.py,sha256=qmawH1RbENZrMoiym-e_nZ9IMrIXf0Hyw7pQroYEVw4,9785
18
+ exonware/xwlazy/common/services/spec_cache.py,sha256=Lh-PwZvueP4K1QyN69EyFoMKfAtRhxkEpKQ7qWHkf28,5343
19
+ exonware/xwlazy/common/services/state_manager.py,sha256=a_pOIDI6apbpu3xWvnofyM3vReV49CXiZmplkpWATmE,3118
20
+ exonware/xwlazy/common/strategies/__init__.py,sha256=DmMFKUbKge4I76395bGtgaooHB4etD4jdTe1AeEueX8,650
21
+ exonware/xwlazy/common/strategies/caching_dict.py,sha256=MOLbPBX12p4gevFdQg-uQ6qhqRZqLhFN9aMKVriRyhQ,1144
22
+ exonware/xwlazy/common/strategies/caching_installation.py,sha256=Zxl0oC6qABsBmkfGcWxa8EQatAsVwE9_K3DxsQ2FR8U,2541
23
+ exonware/xwlazy/common/strategies/caching_lfu.py,sha256=sddShWMEwOe7adkqxgWiTEKHUtrL5gR9wvbX_VusYuc,1989
24
+ exonware/xwlazy/common/strategies/caching_lru.py,sha256=9CA0-EOF4BX8otReE0MshZalkjOpNdBL1b8bN64xnxQ,1850
25
+ exonware/xwlazy/common/strategies/caching_multitier.py,sha256=oC8f85UJL5EYJ0LaphpJm9VikA8CYs-Du9qnh2cgxco,1928
26
+ exonware/xwlazy/common/strategies/caching_ttl.py,sha256=CWooFDWJk1E09OZ0Ou7SnuwigG9k997xOwQZnvs7VUk,1655
27
+ exonware/xwlazy/module/__init__.py,sha256=sL_G0RvpMfif0e3Yzo0CSj2xAPPF6phlQB367agzqfE,627
28
+ exonware/xwlazy/module/base.py,sha256=4Et6hn7mVjhM7TP9bvQHt5sz1HzRy4Ndg-UvunIS5Co,20703
29
+ exonware/xwlazy/module/data.py,sha256=7wbVc1sqtM4yOWgEa0PK5-FVlXEzMwqqMxbqRJTmmKc,335
30
+ exonware/xwlazy/module/facade.py,sha256=kOUSqlXbd07Q-cPv97m-2X2yaqEZKsKOftatj_rFDJ4,8090
31
+ exonware/xwlazy/module/importer_engine.py,sha256=tRhPOC5PPzXUzYxIoNKXXxv0HAlHIXKx0H5jIMWtEns,91879
32
+ exonware/xwlazy/module/strategies/__init__.py,sha256=YFsS8NqyoC_btPW_0lOjf5Eq4Yd_HBLWvs37viOVnHk,484
33
+ exonware/xwlazy/module/strategies/module_helper_lazy.py,sha256=Od7Fu8xESf_JUjkmY4OgfcbZgytmr8WPbdyjpQ3ijb8,2697
34
+ exonware/xwlazy/module/strategies/module_helper_simple.py,sha256=vzvbEi8EpCOkcAEKv8dRE8LYY6LtpXvy1b65mXwM3cc,1701
35
+ exonware/xwlazy/module/strategies/module_manager_advanced.py,sha256=ofzBD2p2mhMmQE3cF2_JtiZMWsD5cEdYhQ2P5z70QN4,3311
36
+ exonware/xwlazy/module/strategies/module_manager_simple.py,sha256=FvhDJXaLrHfJL0lt6nspnmOnUD1hceeHMjfXz35SBUs,2460
37
+ exonware/xwlazy/package/__init__.py,sha256=UI7xwTbFDURAt7kCr3yRhZzZtFrWRDwhJXakSyJwSCU,640
38
+ exonware/xwlazy/package/base.py,sha256=aPLeRIy2p6PEAj7ozyPBGtt6EzjJXqvF5R4mBcX6D4k,27956
39
+ exonware/xwlazy/package/conf.py,sha256=SXq-VeVBn7Aya2e9z7wGEdlaeQaZm6dfgybI41070Jw,14077
40
+ exonware/xwlazy/package/data.py,sha256=5dJECtE5K-_efdQuKIokxCIhGYYUJd88aohItTVsU5Q,340
41
+ exonware/xwlazy/package/facade.py,sha256=ibrpGwF57Sjc9U4cD_jKTJcsIxoI2FvyERQHZDI1pU0,18744
42
+ exonware/xwlazy/package/services/__init__.py,sha256=ydB2kRzx6I3Kpm-bYyecTwHdkE_544X0CAXHZh7AyZY,2240
43
+ exonware/xwlazy/package/services/async_install_handle.py,sha256=TY2H08TbPt96Nf83xG2PZsCSDBY8d2Ge_-na3dDX_Sg,2822
44
+ exonware/xwlazy/package/services/config_manager.py,sha256=2Q71SY8TblFgRsBQ1b0nf-yyNtCMpNruUHayqoCuMuw,10552
45
+ exonware/xwlazy/package/services/discovery.py,sha256=5cTcpFiQNrJpz3mpEd3oQ0MrHUjgfXEC1Xb6NBRANt8,14658
46
+ exonware/xwlazy/package/services/host_packages.py,sha256=QUZWBNzdYVlHAcuSv9pzvh6-Bqv-bjrcTR1TZzQYaZs,5433
47
+ exonware/xwlazy/package/services/install_async.py,sha256=9Vi3x2wmZihzm_S82j3phcu_6Pu9XIFxqWEGUJLMa3M,13297
48
+ exonware/xwlazy/package/services/install_cache.py,sha256=B6Z12dJotKk86mEwYuv-2m_rlRSEohTQa5PTWBL-rUw,5992
49
+ exonware/xwlazy/package/services/install_interactive.py,sha256=dgUAKoLolF0ne5PornmXIkff5Nwy_JZ7upC4x0pTVDw,2173
50
+ exonware/xwlazy/package/services/install_policy.py,sha256=G8eQAKOpwMYRyI3Wa6m6EHTZJM3LX7Tj0_pCFfnp34A,5895
51
+ exonware/xwlazy/package/services/install_registry.py,sha256=XEABwMaUo7L7d2nodw6TxBW-fLuKnZmvBVNSXX-VfZY,1523
52
+ exonware/xwlazy/package/services/install_result.py,sha256=iroxDlXf9OUAEkEKZVfMzlBh61SBd_XxWBzCjNH-5cY,363
53
+ exonware/xwlazy/package/services/install_sbom.py,sha256=0iFBlBvKi9v5TxulKciBra8jlHlEKKBzQ8tyN48fci8,5589
54
+ exonware/xwlazy/package/services/install_utils.py,sha256=uaUY-ABRobTbLkYCNoeoshZlAr2U65AqMuXml-yXroI,2392
55
+ exonware/xwlazy/package/services/installer_engine.py,sha256=kAyUOoNLBhxyFixtb_xADkpgsUfc8mhTE-Xdn_O08Es,15382
56
+ exonware/xwlazy/package/services/lazy_installer.py,sha256=L2D_1puQQIONkJdWT43E4E-awgKIU2vyLrTbTXrOZyc,32117
57
+ exonware/xwlazy/package/services/manifest.py,sha256=Wvou3vWZoXIAGL-MgEI_QRGNJbFZ_2k8Igv2DDg3grY,19173
58
+ exonware/xwlazy/package/services/strategy_registry.py,sha256=FM7apcEkS85WRQoHdGW7zwkCF7vbsazbyD_F3SXHCPU,6815
59
+ exonware/xwlazy/package/strategies/__init__.py,sha256=r_gpreZ6kcsWfHkGABYlZVx69JdvbMwlftitAKEwbrA,1626
60
+ exonware/xwlazy/package/strategies/package_discovery_file.py,sha256=NNtwHdgwm9biSpFmkTHYPOF4hotwprQJmvTQ5lfOOa0,4412
61
+ exonware/xwlazy/package/strategies/package_discovery_hybrid.py,sha256=2WQwrsBWA_Gi3zQPraBtGSS_43L-9B7FNsGPdctGjSg,2672
62
+ exonware/xwlazy/package/strategies/package_discovery_manifest.py,sha256=B4mGUw-_azpNWE7oNhCNZmr7Ib-zTLWxIXP6c3djrec,3386
63
+ exonware/xwlazy/package/strategies/package_execution_async.py,sha256=WdGJC6WdIW4epZNY3oTmDCXlCQS6-HKuN0UWZrqZKy0,3662
64
+ exonware/xwlazy/package/strategies/package_execution_cached.py,sha256=L1mOv3dgj5xzpUUBuS6d9eS8ghG5Lf_DTl3fSwy1i1k,2698
65
+ exonware/xwlazy/package/strategies/package_execution_pip.py,sha256=370s6RKb0Db_RuXzj4h4FJ0dxLQxHCib7vPc3XFg6Os,2981
66
+ exonware/xwlazy/package/strategies/package_execution_wheel.py,sha256=KumGWMkwSW68rgiY7xmOQQFdyMuPspwe5W7xPF2rqGw,3227
67
+ exonware/xwlazy/package/strategies/package_mapping_discovery_first.py,sha256=rwwf1dVtrAM7pEcQ8AIkTf1HWiDfHdvdqTbKzPEfXtA,3297
68
+ exonware/xwlazy/package/strategies/package_mapping_hybrid.py,sha256=_4ITMsQYt2aDARnjGygczsZTXjOeokf9VRoDBjTeHDU,3417
69
+ exonware/xwlazy/package/strategies/package_mapping_manifest_first.py,sha256=gu7PQ4F94GOkFrpXguH30juXkhtfQ63E7VLaLhcphaU,3322
70
+ exonware/xwlazy/package/strategies/package_policy_allow_list.py,sha256=A6Vnm1pnM_9y1UhyAQOZV-y_8mr3H6hfvAABbDT41gM,1574
71
+ exonware/xwlazy/package/strategies/package_policy_deny_list.py,sha256=31xiRikrVmfzadmyHBe69VVqM7UB6fjpwkYjyoPiAjA,1534
72
+ exonware/xwlazy/package/strategies/package_policy_permissive.py,sha256=UJGDmU78rnLIOSqAEKBHUoLq_XqCo1NgG3ZGhoASXGs,1145
73
+ exonware/xwlazy/package/strategies/package_timing_clean.py,sha256=EikXBD7tIe9vbQhaZwf7U5z5QoCncjzBJHxQBRCSKPM,1844
74
+ exonware/xwlazy/package/strategies/package_timing_full.py,sha256=d3rbxO6z37obh1MaZ67RDDV8qx3Wbtb3hntGPkmk4t4,1754
75
+ exonware/xwlazy/package/strategies/package_timing_smart.py,sha256=DIJeObmLA3dF3zWw7WbiiZdioP-CypVjxgTokcLuk68,1853
76
+ exonware/xwlazy/package/strategies/package_timing_temporary.py,sha256=Ixlnh8jVYx_D3qfZ-9YCP_mbzFIteCluF3036RphjGM,1813
77
+ exonware/xwlazy/runtime/__init__.py,sha256=jbIzemqwtWvKu2LxhYU7pIcihNakQHCON8xZW0orqZA,636
78
+ exonware/xwlazy/runtime/adaptive_learner.py,sha256=rnr9mtW6949t6udjvF-FVTFJEGD5_V6WC6lVA3Zi-Tc,5275
79
+ exonware/xwlazy/runtime/base.py,sha256=-Rqzbx_3L3FaxmIXOC3BiK4UzlTe118C6N9DLRYMv1o,10038
80
+ exonware/xwlazy/runtime/facade.py,sha256=8NpdGiMs0dD0Yfxk-1vkIFtZZuMvYIm9ICmLd3hwlwk,3416
81
+ exonware/xwlazy/runtime/intelligent_selector.py,sha256=7ajDIOLteeFcXOetQvXLu1mmtynePz3ADQB90jRnGtU,6551
82
+ exonware/xwlazy/runtime/metrics.py,sha256=IYR6PQkQOIKWMjH7Mw3yspkLjsvP8JXVnUNjTJ67YyY,1991
83
+ exonware/xwlazy/runtime/performance.py,sha256=6Oiuv_bS6-AyIAKMYLSWRcgfs85BcfwKa0yv2HRE8BA,1200
84
+ exonware_xwlazy-0.1.0.19.dist-info/METADATA,sha256=aNq8i5Y816RKut5Z8f88yZPB21vtm4pCUKlhKhkQoZw,16731
85
+ exonware_xwlazy-0.1.0.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
+ exonware_xwlazy-0.1.0.19.dist-info/licenses/LICENSE,sha256=w42ohoEUfhyT0NgiivAL4fWg2AMRLGnfXPMAR4EO-MU,1094
87
+ exonware_xwlazy-0.1.0.19.dist-info/RECORD,,
@@ -1,20 +0,0 @@
1
- exonware/xwlazy/__init__.py,sha256=uS0FTfM1r1FqcM2C6FrLgFARp-drdMxnJOg5XATAM3U,1674
2
- exonware/xwlazy/version.py,sha256=E5aVPnT4mfjNCGF4IEs45FOFv_vH_RspxZBtW_y8je8,2351
3
- xwlazy/__init__.py,sha256=kMokTnTWqht1Rr4VgPfxpjp6BYQ0Pziu3rpXw93-57k,608
4
- xwlazy/version.py,sha256=HB5UxTEw9CUiCDNVgFLHpMuojbuugXVR7kXQhdJOy9E,2351
5
- xwlazy/lazy/__init__.py,sha256=VhBEqwhR_GUrdn5400KWS28pX7T36kqTz9p2QgxqrXA,7361
6
- xwlazy/lazy/bootstrap.py,sha256=okGe1f30qPXC7uyz7rnY6wzan3Mkt6Z5sukyPfZK4kQ,3721
7
- xwlazy/lazy/config.py,sha256=Wb6YMqYJT4Car79i8tvFptKlDT-15tplWeZZ2IMfZzY,5344
8
- xwlazy/lazy/host_conf.py,sha256=w_bT8VQEOtrf8oR-rY08dxB-k-Y7nMWt2mlOiZcVaxI,11377
9
- xwlazy/lazy/host_packages.py,sha256=7b4XmfcbSHE68aFeXgAp3ELEG0t9poa73MRULzQmtGY,4059
10
- xwlazy/lazy/lazy_base.py,sha256=mtIq3F4LdH7IIxm0Tizma_4nkxwVVJ7IcwAPmLWqYls,13919
11
- xwlazy/lazy/lazy_contracts.py,sha256=6GZj3svH4Tsb74Syjh0hKgkMuNGDfGCTVb4QNI9T7dM,7573
12
- xwlazy/lazy/lazy_core.py,sha256=_FwYz140ueeRgFrQAk0K5xdmKyEcHsfYtBgzytrQ6nI,145139
13
- xwlazy/lazy/lazy_errors.py,sha256=0ttYzcquv0jAd6cfO2be77sRHWuTPjW8KDQFQ-4JQWo,8642
14
- xwlazy/lazy/lazy_state.py,sha256=a_pOIDI6apbpu3xWvnofyM3vReV49CXiZmplkpWATmE,3118
15
- xwlazy/lazy/logging_utils.py,sha256=n2AkfQfFkUxlpAZyRNllwZTFrLfI0HD73ULw-AqQUCo,5830
16
- xwlazy/lazy/manifest.py,sha256=GCExV9EDOQ3HGIwVp-9wUk5MPUnJGYGKGS7CREPHubU,18497
17
- exonware_xwlazy-0.1.0.11.dist-info/METADATA,sha256=i77J_GYb3myTc0VCx_P96up0ZjSSaIQvkYF6RQMGb3U,13759
18
- exonware_xwlazy-0.1.0.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
- exonware_xwlazy-0.1.0.11.dist-info/licenses/LICENSE,sha256=w42ohoEUfhyT0NgiivAL4fWg2AMRLGnfXPMAR4EO-MU,1094
20
- exonware_xwlazy-0.1.0.11.dist-info/RECORD,,
xwlazy/__init__.py DELETED
@@ -1,34 +0,0 @@
1
- """
2
- Top-level xwlazy package exposing lazy runtime utilities.
3
- """
4
-
5
- from .version import (
6
- __version__,
7
- VERSION_MAJOR,
8
- VERSION_MINOR,
9
- VERSION_PATCH,
10
- VERSION_BUILD,
11
- VERSION_SUFFIX,
12
- VERSION_STRING,
13
- get_version,
14
- get_version_info,
15
- get_version_dict,
16
- is_dev_version,
17
- is_release_version,
18
- )
19
-
20
- __all__ = [
21
- "__version__",
22
- "VERSION_MAJOR",
23
- "VERSION_MINOR",
24
- "VERSION_PATCH",
25
- "VERSION_BUILD",
26
- "VERSION_SUFFIX",
27
- "VERSION_STRING",
28
- "get_version",
29
- "get_version_info",
30
- "get_version_dict",
31
- "is_dev_version",
32
- "is_release_version",
33
- ]
34
-
xwlazy/lazy/__init__.py DELETED
@@ -1,301 +0,0 @@
1
- """
2
- #exonware/xwsystem/src/exonware/xwsystem/utils/lazy_package/__init__.py
3
-
4
- Company: eXonware.com
5
- Author: Eng. Muhammad AlShehri
6
- Email: connect@exonware.com
7
- Version: 0.1.0.16
8
- Generation Date: 10-Oct-2025
9
-
10
- Lazy Package - Unified Lazy Loading System
11
-
12
- This package provides per-package lazy loading with automatic installation
13
- of missing dependencies. It consolidates all lazy loading functionality into
14
- a clean, well-structured module following DEV_GUIDELINES.md.
15
-
16
- Design Patterns:
17
- - Facade: Unified API (LazySystemFacade, LazyModeFacade)
18
- - Strategy: Pluggable discovery/installation/caching strategies
19
- - Template Method: Base classes define common workflows
20
- - Singleton: Global instances for system-wide state
21
- - Registry: Per-package isolation (LazyInstallerRegistry)
22
- - Observer: Performance monitoring
23
- - Proxy: Deferred loading (LazyLoader, DeferredImportError)
24
- - Factory: Handler creation
25
-
26
- Core Goal: Per-Package Lazy Loading
27
- Each package (xwsystem, xwnode, xwdata) can independently enable lazy mode.
28
- Only packages installed with [lazy] extra get auto-installation.
29
-
30
- Quick Start:
31
- # In your package's __init__.py
32
- from xwlazy.lazy import config_package_lazy_install_enabled
33
- config_package_lazy_install_enabled("yourpackage") # Auto-detect from pip install
34
-
35
- Usage:
36
- # Then just use normal Python imports!
37
- import fastavro # Missing? Auto-installed! ✨
38
- import pandas # Missing? Auto-installed! ✨
39
- """
40
-
41
- # Import all from submodules
42
- from .lazy_contracts import (
43
- # Enums
44
- LazyInstallMode,
45
- PathType,
46
- # Dataclasses
47
- DependencyInfo,
48
- # Interfaces
49
- IPackageDiscovery,
50
- IPackageInstaller,
51
- IImportHook,
52
- IPackageCache,
53
- ILazyLoader,
54
- )
55
-
56
- from .lazy_errors import (
57
- # Exceptions
58
- LazySystemError,
59
- LazyInstallError,
60
- LazyDiscoveryError,
61
- LazyHookError,
62
- LazySecurityError,
63
- ExternallyManagedError,
64
- DeferredImportError,
65
- )
66
-
67
- from .lazy_base import (
68
- # Abstract base classes
69
- APackageDiscovery,
70
- APackageInstaller,
71
- AImportHook,
72
- APackageCache,
73
- ALazyLoader,
74
- )
75
-
76
- from .lazy_core import (
77
- # Core classes
78
- DependencyMapper,
79
- LazyDiscovery,
80
- LazyInstaller,
81
- LazyInstallPolicy,
82
- LazyInstallerRegistry,
83
- LazyImportHook,
84
- LazyMetaPathFinder,
85
- LazyLoader,
86
- LazyImporter,
87
- LazyModuleRegistry,
88
- LazyPerformanceMonitor,
89
- LazyInstallConfig,
90
- LazyModeFacade,
91
- WatchedPrefixRegistry,
92
- AsyncInstallHandle,
93
-
94
- # Discovery functions
95
- get_lazy_discovery,
96
- discover_dependencies,
97
- export_dependency_mappings,
98
-
99
- # Install functions
100
- enable_lazy_install,
101
- disable_lazy_install,
102
- is_lazy_install_enabled,
103
- set_lazy_install_mode,
104
- get_lazy_install_mode,
105
- install_missing_package,
106
- install_and_import,
107
- get_lazy_install_stats,
108
- get_all_lazy_install_stats,
109
- lazy_import_with_install,
110
- xwimport,
111
-
112
- # Hook functions
113
- install_import_hook,
114
- uninstall_import_hook,
115
- is_import_hook_installed,
116
-
117
- # Lazy loading functions
118
- enable_lazy_imports,
119
- disable_lazy_imports,
120
- is_lazy_import_enabled,
121
- lazy_import,
122
- register_lazy_module,
123
- preload_module,
124
- get_lazy_module,
125
- get_loading_stats,
126
- preload_frequently_used,
127
- get_lazy_import_stats,
128
-
129
- # Lazy mode facade functions
130
- enable_lazy_mode,
131
- disable_lazy_mode,
132
- is_lazy_mode_enabled,
133
- get_lazy_mode_stats,
134
- configure_lazy_mode,
135
- preload_modules,
136
- optimize_lazy_mode,
137
-
138
- # Configuration
139
- config_package_lazy_install_enabled,
140
- sync_manifest_configuration,
141
- refresh_lazy_manifests,
142
-
143
- # Security & Policy
144
- set_package_allow_list,
145
- set_package_deny_list,
146
- add_to_package_allow_list,
147
- add_to_package_deny_list,
148
- set_package_index_url,
149
- set_package_extra_index_urls,
150
- add_package_trusted_host,
151
- set_package_lockfile,
152
- generate_package_sbom,
153
- check_externally_managed_environment,
154
-
155
- # Registration helpers
156
- register_lazy_module_prefix,
157
- register_lazy_module_methods,
158
- )
159
-
160
- from .config import LazyConfig, DEFAULT_LAZY_CONFIG
161
- from .host_conf import get_conf_module
162
- from .host_packages import register_host_package, refresh_host_package
163
- from .logging_utils import (
164
- get_log_categories,
165
- is_log_category_enabled,
166
- set_log_categories,
167
- set_log_category,
168
- )
169
-
170
- # Version info
171
- __version__ = "0.0.1.382"
172
- __author__ = "Eng. Muhammad AlShehri"
173
- __email__ = "connect@exonware.com"
174
- __company__ = "eXonware.com"
175
-
176
- # Export all
177
- __all__ = [
178
- # Enums
179
- 'LazyInstallMode',
180
- 'PathType',
181
-
182
- # Dataclasses
183
- 'DependencyInfo',
184
-
185
- # Interfaces
186
- 'IPackageDiscovery',
187
- 'IPackageInstaller',
188
- 'IImportHook',
189
- 'IPackageCache',
190
- 'ILazyLoader',
191
-
192
- # Exceptions
193
- 'LazySystemError',
194
- 'LazyInstallError',
195
- 'LazyDiscoveryError',
196
- 'LazyHookError',
197
- 'LazySecurityError',
198
- 'ExternallyManagedError',
199
- 'DeferredImportError',
200
-
201
- # Abstract base classes
202
- 'APackageDiscovery',
203
- 'APackageInstaller',
204
- 'AImportHook',
205
- 'APackageCache',
206
- 'ALazyLoader',
207
-
208
- # Core classes
209
- 'DependencyMapper',
210
- 'LazyDiscovery',
211
- 'LazyInstaller',
212
- 'LazyInstallPolicy',
213
- 'LazyInstallerRegistry',
214
- 'LazyImportHook',
215
- 'LazyMetaPathFinder',
216
- 'LazyLoader',
217
- 'LazyImporter',
218
- 'LazyModuleRegistry',
219
- 'LazyPerformanceMonitor',
220
- 'LazyInstallConfig',
221
- 'LazyModeFacade',
222
- 'WatchedPrefixRegistry',
223
- 'AsyncInstallHandle',
224
-
225
- # Discovery functions
226
- 'get_lazy_discovery',
227
- 'discover_dependencies',
228
- 'export_dependency_mappings',
229
-
230
- # Install functions
231
- 'enable_lazy_install',
232
- 'disable_lazy_install',
233
- 'is_lazy_install_enabled',
234
- 'set_lazy_install_mode',
235
- 'get_lazy_install_mode',
236
- 'install_missing_package',
237
- 'install_and_import',
238
- 'get_lazy_install_stats',
239
- 'get_all_lazy_install_stats',
240
- 'lazy_import_with_install',
241
- 'xwimport',
242
-
243
- # Hook functions
244
- 'install_import_hook',
245
- 'uninstall_import_hook',
246
- 'is_import_hook_installed',
247
-
248
- # Lazy loading functions
249
- 'enable_lazy_imports',
250
- 'disable_lazy_imports',
251
- 'is_lazy_import_enabled',
252
- 'lazy_import',
253
- 'register_lazy_module',
254
- 'preload_module',
255
- 'get_lazy_module',
256
- 'get_loading_stats',
257
- 'preload_frequently_used',
258
- 'get_lazy_import_stats',
259
-
260
- # Lazy mode facade functions
261
- 'enable_lazy_mode',
262
- 'disable_lazy_mode',
263
- 'is_lazy_mode_enabled',
264
- 'get_lazy_mode_stats',
265
- 'configure_lazy_mode',
266
- 'preload_modules',
267
- 'optimize_lazy_mode',
268
-
269
- # Configuration
270
- 'config_package_lazy_install_enabled',
271
- 'sync_manifest_configuration',
272
- 'refresh_lazy_manifests',
273
- 'LazyConfig',
274
- 'DEFAULT_LAZY_CONFIG',
275
-
276
- # Security & Policy
277
- 'set_package_allow_list',
278
- 'set_package_deny_list',
279
- 'add_to_package_allow_list',
280
- 'add_to_package_deny_list',
281
- 'set_package_index_url',
282
- 'set_package_extra_index_urls',
283
- 'add_package_trusted_host',
284
- 'set_package_lockfile',
285
- 'generate_package_sbom',
286
- 'check_externally_managed_environment',
287
-
288
- # Registration helpers
289
- 'register_lazy_module_prefix',
290
- 'register_lazy_module_methods',
291
- 'register_host_package',
292
- 'refresh_host_package',
293
- 'get_conf_module',
294
-
295
- # Logging helpers
296
- 'get_log_categories',
297
- 'is_log_category_enabled',
298
- 'set_log_categories',
299
- 'set_log_category',
300
- ]
301
-
xwlazy/lazy/bootstrap.py DELETED
@@ -1,106 +0,0 @@
1
- #exonware/xwlazy/src/exonware/xwlazy/lazy/bootstrap.py
2
- """
3
- Early bootstrap utilities for lazily installing import hooks.
4
- """
5
-
6
- from __future__ import annotations
7
-
8
- import atexit
9
- import logging
10
- import os
11
- import sys
12
- from typing import Optional
13
-
14
-
15
- def _env_enabled(env_value: Optional[str]) -> Optional[bool]:
16
- if not env_value:
17
- return None
18
- normalized = env_value.strip().lower()
19
- if normalized in ('true', '1', 'yes', 'on'):
20
- return True
21
- if normalized in ('false', '0', 'no', 'off'):
22
- return False
23
- return None
24
-
25
-
26
- def bootstrap_lazy_mode(package_name: str) -> None:
27
- """
28
- Detect whether lazy mode should be enabled for ``package_name`` and bootstrap hooks.
29
- """
30
- package_name = package_name.lower()
31
- env_value = os.environ.get(f"{package_name.upper()}_LAZY_INSTALL")
32
- env_enabled = _env_enabled(env_value)
33
- enabled = env_enabled
34
-
35
- if enabled is None:
36
- try:
37
- from xwlazy.lazy.lazy_core import _detect_lazy_installation
38
- enabled = _detect_lazy_installation(package_name)
39
- except Exception as exc: # pragma: no cover
40
- logging.getLogger("xwlazy.lazy.bootstrap").debug(
41
- "Lazy detection failed: %s", exc, exc_info=True
42
- )
43
- enabled = False
44
-
45
- if not enabled:
46
- return
47
-
48
- try:
49
- from xwlazy.lazy.lazy_core import config_package_lazy_install_enabled
50
-
51
- config_package_lazy_install_enabled(
52
- package_name,
53
- enabled=True,
54
- install_hook=True,
55
- )
56
- except Exception as exc: # pragma: no cover
57
- logging.getLogger("xwlazy.lazy.bootstrap").debug(
58
- "Lazy bootstrap failed for %s: %s", package_name, exc, exc_info=True
59
- )
60
-
61
-
62
- def bootstrap_lazy_mode_deferred(package_name: str) -> None:
63
- """
64
- Schedule lazy mode bootstrap to run AFTER the calling package finishes importing.
65
-
66
- This avoids hook interference with the package's own imports (e.g., requests/certifi in xwsystem).
67
- Uses a post-import hook to detect when the package module is fully loaded.
68
- """
69
- package_name_lower = package_name.lower()
70
- package_module_name = f"exonware.{package_name_lower}"
71
-
72
- # Store original __import__ to restore later
73
- original_import = __builtins__.__import__ if hasattr(__builtins__, '__import__') else __import__
74
-
75
- def _import_hook(name, *args, **kwargs):
76
- # Call original import first
77
- result = original_import(name, *args, **kwargs)
78
-
79
- # Check if the target package just finished importing
80
- if name == package_module_name or name.startswith(f"{package_module_name}."):
81
- # Check if package root is now fully in sys.modules
82
- if package_module_name in sys.modules:
83
- # Package is loaded, install hook on next event loop iteration
84
- import threading
85
- def _install_hook():
86
- # Restore original import
87
- if hasattr(__builtins__, '__import__'):
88
- __builtins__.__import__ = original_import
89
- else:
90
- import builtins
91
- builtins.__import__ = original_import
92
- # Now install the lazy hook
93
- bootstrap_lazy_mode(package_name_lower)
94
-
95
- # Schedule for immediate execution after current import completes
96
- threading.Timer(0.0, _install_hook).start()
97
-
98
- return result
99
-
100
- # Install temporary import hook
101
- if hasattr(__builtins__, '__import__'):
102
- __builtins__.__import__ = _import_hook
103
- else:
104
- import builtins
105
- builtins.__import__ = _import_hook
106
-