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.
- README.md +85 -9
- src/xwlazy_wrapper.py +21 -0
- {xwlazy-0.1.0.11.dist-info → xwlazy-0.1.0.19.dist-info}/METADATA +86 -10
- xwlazy-0.1.0.19.dist-info/RECORD +6 -0
- xwlazy-0.1.0.11.dist-info/RECORD +0 -5
- {xwlazy-0.1.0.11.dist-info → xwlazy-0.1.0.19.dist-info}/WHEEL +0 -0
- {xwlazy-0.1.0.11.dist-info → xwlazy-0.1.0.19.dist-info}/licenses/LICENSE +0 -0
README.md
CHANGED
|
@@ -49,14 +49,40 @@ Built-in tracking of module load times, access counts, memory usage, and cache h
|
|
|
49
49
|
|
|
50
50
|
**Why it matters:** Visibility into lazy loading performance helps identify bottlenecks and optimize import strategies.
|
|
51
51
|
|
|
52
|
-
### 🎨 **
|
|
53
|
-
|
|
54
|
-
- **
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
### 🎨 **Two-Dimensional Mode System**
|
|
53
|
+
|
|
54
|
+
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.
|
|
55
|
+
|
|
56
|
+
#### **Lazy Load Modes** (When modules load)
|
|
57
|
+
- **NONE:** Standard imports (no lazy loading)
|
|
58
|
+
- **AUTO:** Lazy loading enabled (deferred module loading)
|
|
59
|
+
- **PRELOAD:** Preload all modules on start (parallel loading)
|
|
60
|
+
- **BACKGROUND:** Load modules in background threads (non-blocking)
|
|
61
|
+
- **CACHED:** Cache loaded modules but allow unloading
|
|
62
|
+
|
|
63
|
+
#### **Lazy Install Modes** (When packages install)
|
|
64
|
+
- **NONE:** No auto-installation
|
|
65
|
+
- **SMART:** Install on first usage (on-demand)
|
|
66
|
+
- **FULL:** Install all dependencies on start (parallel batch)
|
|
67
|
+
- **CLEAN:** Install on usage + uninstall after completion
|
|
68
|
+
- **TEMPORARY:** Always uninstall after use (aggressive cleanup)
|
|
69
|
+
- **SIZE_AWARE:** Install small packages, skip large ones
|
|
70
|
+
- **INTERACTIVE:** Ask user before installing
|
|
71
|
+
- **WARN:** Log warning but don't install (monitoring mode)
|
|
72
|
+
- **DISABLED:** Don't install anything (explicit)
|
|
57
73
|
- **DRY_RUN:** Show what would be installed
|
|
58
74
|
|
|
59
|
-
**
|
|
75
|
+
#### **Preset Modes** (Quick combinations)
|
|
76
|
+
- **none:** NONE load + NONE install (standard imports)
|
|
77
|
+
- **lite:** AUTO load + NONE install (lazy loading only)
|
|
78
|
+
- **smart:** AUTO load + SMART install (on-demand installation)
|
|
79
|
+
- **full:** AUTO load + FULL install (install all on start)
|
|
80
|
+
- **clean:** AUTO load + CLEAN install (install + cleanup)
|
|
81
|
+
- **temporary:** AUTO load + TEMPORARY install (aggressive cleanup)
|
|
82
|
+
- **size_aware:** AUTO load + SIZE_AWARE install (smart sizing)
|
|
83
|
+
- **auto:** AUTO load + SMART install + auto-uninstall large packages
|
|
84
|
+
|
|
85
|
+
**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`.
|
|
60
86
|
|
|
61
87
|
## 🏆 Performance Benchmarks
|
|
62
88
|
|
|
@@ -188,26 +214,76 @@ import suspicious_package # ❌ Blocked by security policy
|
|
|
188
214
|
|
|
189
215
|
## 🔧 Advanced Configuration
|
|
190
216
|
|
|
191
|
-
###
|
|
217
|
+
### Two-Dimensional Mode Configuration
|
|
218
|
+
|
|
219
|
+
#### Using Preset Modes (Recommended)
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
from xwlazy.lazy import config_package_lazy_install_enabled
|
|
223
|
+
|
|
224
|
+
# Quick preset modes
|
|
225
|
+
config_package_lazy_install_enabled("xwsystem", enabled=True, mode="smart") # On-demand install
|
|
226
|
+
config_package_lazy_install_enabled("xwsystem", enabled=True, mode="full") # Install all on start
|
|
227
|
+
config_package_lazy_install_enabled("xwsystem", enabled=True, mode="clean") # Install + cleanup
|
|
228
|
+
config_package_lazy_install_enabled("xwsystem", enabled=True, mode="lite") # Lazy load only
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
#### Using Explicit Mode Configuration
|
|
192
232
|
|
|
193
233
|
```python
|
|
194
234
|
from xwlazy.lazy import (
|
|
195
235
|
config_package_lazy_install_enabled,
|
|
236
|
+
LazyLoadMode,
|
|
196
237
|
LazyInstallMode,
|
|
238
|
+
LazyModeConfig,
|
|
197
239
|
)
|
|
198
240
|
|
|
241
|
+
# Explicit two-dimensional configuration
|
|
242
|
+
config_package_lazy_install_enabled(
|
|
243
|
+
"xwsystem",
|
|
244
|
+
enabled=True,
|
|
245
|
+
load_mode=LazyLoadMode.PRELOAD, # Preload all modules
|
|
246
|
+
install_mode=LazyInstallMode.SMART # Install on-demand
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
# Or use LazyModeConfig for full control
|
|
250
|
+
config = LazyModeConfig(
|
|
251
|
+
load_mode=LazyLoadMode.BACKGROUND,
|
|
252
|
+
install_mode=LazyInstallMode.SIZE_AWARE,
|
|
253
|
+
large_package_threshold_mb=100.0, # Skip packages > 100MB
|
|
254
|
+
background_workers=4 # 4 background workers
|
|
255
|
+
)
|
|
256
|
+
config_package_lazy_install_enabled(
|
|
257
|
+
"xwsystem",
|
|
258
|
+
enabled=True,
|
|
259
|
+
mode_config=config
|
|
260
|
+
)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### Using exonware.conf (Global Configuration)
|
|
264
|
+
|
|
265
|
+
```python
|
|
266
|
+
import exonware.conf as conf
|
|
267
|
+
|
|
268
|
+
# Set global lazy mode for all packages
|
|
269
|
+
conf.lazy = "smart" # or "lite", "full", "clean", "auto", etc.
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
#### Special Purpose Modes
|
|
273
|
+
|
|
274
|
+
```python
|
|
199
275
|
# Interactive mode: Ask user before installing
|
|
200
276
|
config_package_lazy_install_enabled(
|
|
201
277
|
"xwsystem",
|
|
202
278
|
enabled=True,
|
|
203
|
-
mode=LazyInstallMode.INTERACTIVE
|
|
279
|
+
mode="interactive" # or LazyInstallMode.INTERACTIVE
|
|
204
280
|
)
|
|
205
281
|
|
|
206
282
|
# Warn mode: Log but don't install (monitoring)
|
|
207
283
|
config_package_lazy_install_enabled(
|
|
208
284
|
"xwsystem",
|
|
209
285
|
enabled=True,
|
|
210
|
-
mode=LazyInstallMode.WARN
|
|
286
|
+
mode="warn" # or LazyInstallMode.WARN
|
|
211
287
|
)
|
|
212
288
|
```
|
|
213
289
|
|
src/xwlazy_wrapper.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
xwlazy Wrapper Package
|
|
3
|
+
|
|
4
|
+
This is a convenience wrapper that provides 'import xwlazy' functionality.
|
|
5
|
+
The actual implementation is in the exonware-xwlazy package.
|
|
6
|
+
|
|
7
|
+
Company: eXonware.com
|
|
8
|
+
Author: Eng. Muhammad AlShehri
|
|
9
|
+
Email: connect@exonware.com
|
|
10
|
+
Version: 0.1.0.19
|
|
11
|
+
Generation Date: 10-Oct-2025
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# This wrapper package depends on exonware-xwlazy
|
|
15
|
+
# When you pip install xwlazy, it automatically installs exonware-xwlazy
|
|
16
|
+
# Both import paths then work:
|
|
17
|
+
# - import xwlazy
|
|
18
|
+
# - import exonware.xwlazy
|
|
19
|
+
|
|
20
|
+
__all__ = []
|
|
21
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xwlazy
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.19
|
|
4
4
|
Summary: Convenience wrapper for exonware-xwlazy - provides 'import xwlazy' alias
|
|
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
|
-
### 🎨 **
|
|
80
|
-
|
|
81
|
-
- **
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
**
|
|
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
|
-
###
|
|
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,6 @@
|
|
|
1
|
+
README.md,sha256=d7uDJ3tvKKBtAhWQtHVp6OzrtELNqMwBZ_8BNYF8HHs,15544
|
|
2
|
+
src/xwlazy_wrapper.py,sha256=dfGgZBTeWfJ93ASG2B9FT7fdRV7J-2Xy1xviDo3gQAE,516
|
|
3
|
+
xwlazy-0.1.0.19.dist-info/METADATA,sha256=Lbd66PjJAZ-I1kV92ZNaYPtPkO1a_EVPvl_lvsNEB7c,16696
|
|
4
|
+
xwlazy-0.1.0.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
5
|
+
xwlazy-0.1.0.19.dist-info/licenses/LICENSE,sha256=w42ohoEUfhyT0NgiivAL4fWg2AMRLGnfXPMAR4EO-MU,1094
|
|
6
|
+
xwlazy-0.1.0.19.dist-info/RECORD,,
|
xwlazy-0.1.0.11.dist-info/RECORD
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
README.md,sha256=1IRJekBUKeGQc_v35FNiroU_ztNKFJtMbNgNicgvh50,12572
|
|
2
|
-
xwlazy-0.1.0.11.dist-info/METADATA,sha256=ptw6Ji9QfPCvAnCtBCiUH5D46WbuKxvorduMUQCykGU,13724
|
|
3
|
-
xwlazy-0.1.0.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
4
|
-
xwlazy-0.1.0.11.dist-info/licenses/LICENSE,sha256=w42ohoEUfhyT0NgiivAL4fWg2AMRLGnfXPMAR4EO-MU,1094
|
|
5
|
-
xwlazy-0.1.0.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|