exonware-xwlazy 0.1.0.23__py3-none-any.whl → 1.0.1.2__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 +85 -34
  2. exonware/xwlazy/version.py +5 -5
  3. exonware/xwlazy.py +2546 -0
  4. exonware/xwlazy_external_libs.toml +716 -0
  5. {exonware_xwlazy-0.1.0.23.dist-info → exonware_xwlazy-1.0.1.2.dist-info}/METADATA +5 -1
  6. exonware_xwlazy-1.0.1.2.dist-info/RECORD +8 -0
  7. exonware/xwlazy/__init__.py +0 -379
  8. exonware/xwlazy/common/__init__.py +0 -55
  9. exonware/xwlazy/common/base.py +0 -65
  10. exonware/xwlazy/common/cache.py +0 -504
  11. exonware/xwlazy/common/logger.py +0 -257
  12. exonware/xwlazy/common/services/__init__.py +0 -72
  13. exonware/xwlazy/common/services/dependency_mapper.py +0 -250
  14. exonware/xwlazy/common/services/install_async_utils.py +0 -170
  15. exonware/xwlazy/common/services/install_cache_utils.py +0 -245
  16. exonware/xwlazy/common/services/keyword_detection.py +0 -283
  17. exonware/xwlazy/common/services/spec_cache.py +0 -165
  18. exonware/xwlazy/common/services/state_manager.py +0 -84
  19. exonware/xwlazy/common/strategies/__init__.py +0 -28
  20. exonware/xwlazy/common/strategies/caching_dict.py +0 -44
  21. exonware/xwlazy/common/strategies/caching_installation.py +0 -88
  22. exonware/xwlazy/common/strategies/caching_lfu.py +0 -66
  23. exonware/xwlazy/common/strategies/caching_lru.py +0 -63
  24. exonware/xwlazy/common/strategies/caching_multitier.py +0 -59
  25. exonware/xwlazy/common/strategies/caching_ttl.py +0 -59
  26. exonware/xwlazy/common/utils.py +0 -142
  27. exonware/xwlazy/config.py +0 -193
  28. exonware/xwlazy/contracts.py +0 -1533
  29. exonware/xwlazy/defs.py +0 -378
  30. exonware/xwlazy/errors.py +0 -276
  31. exonware/xwlazy/facade.py +0 -1137
  32. exonware/xwlazy/host/__init__.py +0 -8
  33. exonware/xwlazy/host/conf.py +0 -16
  34. exonware/xwlazy/module/__init__.py +0 -18
  35. exonware/xwlazy/module/base.py +0 -622
  36. exonware/xwlazy/module/data.py +0 -17
  37. exonware/xwlazy/module/facade.py +0 -246
  38. exonware/xwlazy/module/importer_engine.py +0 -2964
  39. exonware/xwlazy/module/partial_module_detector.py +0 -275
  40. exonware/xwlazy/module/strategies/__init__.py +0 -22
  41. exonware/xwlazy/module/strategies/module_helper_lazy.py +0 -93
  42. exonware/xwlazy/module/strategies/module_helper_simple.py +0 -65
  43. exonware/xwlazy/module/strategies/module_manager_advanced.py +0 -111
  44. exonware/xwlazy/module/strategies/module_manager_simple.py +0 -95
  45. exonware/xwlazy/package/__init__.py +0 -18
  46. exonware/xwlazy/package/base.py +0 -863
  47. exonware/xwlazy/package/conf.py +0 -324
  48. exonware/xwlazy/package/data.py +0 -17
  49. exonware/xwlazy/package/facade.py +0 -480
  50. exonware/xwlazy/package/services/__init__.py +0 -84
  51. exonware/xwlazy/package/services/async_install_handle.py +0 -87
  52. exonware/xwlazy/package/services/config_manager.py +0 -249
  53. exonware/xwlazy/package/services/discovery.py +0 -435
  54. exonware/xwlazy/package/services/host_packages.py +0 -180
  55. exonware/xwlazy/package/services/install_async.py +0 -291
  56. exonware/xwlazy/package/services/install_cache.py +0 -145
  57. exonware/xwlazy/package/services/install_interactive.py +0 -59
  58. exonware/xwlazy/package/services/install_policy.py +0 -156
  59. exonware/xwlazy/package/services/install_registry.py +0 -54
  60. exonware/xwlazy/package/services/install_result.py +0 -17
  61. exonware/xwlazy/package/services/install_sbom.py +0 -153
  62. exonware/xwlazy/package/services/install_utils.py +0 -79
  63. exonware/xwlazy/package/services/installer_engine.py +0 -406
  64. exonware/xwlazy/package/services/lazy_installer.py +0 -803
  65. exonware/xwlazy/package/services/manifest.py +0 -503
  66. exonware/xwlazy/package/services/strategy_registry.py +0 -324
  67. exonware/xwlazy/package/strategies/__init__.py +0 -57
  68. exonware/xwlazy/package/strategies/package_discovery_file.py +0 -129
  69. exonware/xwlazy/package/strategies/package_discovery_hybrid.py +0 -84
  70. exonware/xwlazy/package/strategies/package_discovery_manifest.py +0 -101
  71. exonware/xwlazy/package/strategies/package_execution_async.py +0 -113
  72. exonware/xwlazy/package/strategies/package_execution_cached.py +0 -90
  73. exonware/xwlazy/package/strategies/package_execution_pip.py +0 -99
  74. exonware/xwlazy/package/strategies/package_execution_wheel.py +0 -106
  75. exonware/xwlazy/package/strategies/package_mapping_discovery_first.py +0 -100
  76. exonware/xwlazy/package/strategies/package_mapping_hybrid.py +0 -105
  77. exonware/xwlazy/package/strategies/package_mapping_manifest_first.py +0 -100
  78. exonware/xwlazy/package/strategies/package_policy_allow_list.py +0 -57
  79. exonware/xwlazy/package/strategies/package_policy_deny_list.py +0 -57
  80. exonware/xwlazy/package/strategies/package_policy_permissive.py +0 -46
  81. exonware/xwlazy/package/strategies/package_timing_clean.py +0 -67
  82. exonware/xwlazy/package/strategies/package_timing_full.py +0 -66
  83. exonware/xwlazy/package/strategies/package_timing_smart.py +0 -68
  84. exonware/xwlazy/package/strategies/package_timing_temporary.py +0 -66
  85. exonware/xwlazy/runtime/__init__.py +0 -18
  86. exonware/xwlazy/runtime/adaptive_learner.py +0 -129
  87. exonware/xwlazy/runtime/base.py +0 -274
  88. exonware/xwlazy/runtime/facade.py +0 -94
  89. exonware/xwlazy/runtime/intelligent_selector.py +0 -170
  90. exonware/xwlazy/runtime/metrics.py +0 -60
  91. exonware/xwlazy/runtime/performance.py +0 -37
  92. exonware_xwlazy-0.1.0.23.dist-info/RECORD +0 -93
  93. xwlazy/__init__.py +0 -14
  94. xwlazy/lazy.py +0 -30
  95. {exonware_xwlazy-0.1.0.23.dist-info → exonware_xwlazy-1.0.1.2.dist-info}/WHEEL +0 -0
  96. {exonware_xwlazy-0.1.0.23.dist-info → exonware_xwlazy-1.0.1.2.dist-info}/licenses/LICENSE +0 -0
exonware/__init__.py CHANGED
@@ -1,42 +1,93 @@
1
1
  """
2
- exonware package - Enterprise-grade Python framework ecosystem
2
+ exonware.xwlazy - Enterprise Lazy Installation System
3
3
 
4
- Company: eXonware.com
5
- Author: Eng. Muhammad AlShehri
6
- Email: connect@exonware.com
7
- Generation Date: 2025-01-03
8
-
9
- This is a namespace package allowing multiple exonware subpackages
10
- to coexist (xwsystem, xwnode, xwdata, xwlazy, etc.)
4
+ Main module for xwlazy auto-installation system.
5
+ Supports both import styles:
6
+ import exonware.xwlazy
7
+ import xwlazy (via convenience import)
11
8
  """
12
9
 
13
- # Make this a namespace package FIRST
14
- # This allows both exonware.xwsystem and exonware.xwlazy to coexist
15
- __path__ = __import__('pkgutil').extend_path(__path__, __name__)
16
-
17
- # Import version from xwlazy - required, no fallback
18
- from exonware.xwlazy.version import __version__
10
+ # Import from xwlazy.py module explicitly using importlib
11
+ # This handles the case where both xwlazy.py and xwlazy/ directory exist
12
+ import sys
13
+ import importlib.util
14
+ from pathlib import Path
19
15
 
20
- __author__ = 'Eng. Muhammad AlShehri'
21
- __email__ = 'connect@exonware.com'
22
- __company__ = 'eXonware.com'
16
+ # Explicitly load xwlazy.py as a module
17
+ _xwlazy_file = Path(__file__).parent / "xwlazy.py"
18
+ if _xwlazy_file.exists():
19
+ # Load the module explicitly from the .py file
20
+ spec = importlib.util.spec_from_file_location("exonware._xwlazy_module", _xwlazy_file)
21
+ _xwlazy = importlib.util.module_from_spec(spec)
22
+ sys.modules["exonware._xwlazy_module"] = _xwlazy
23
+ spec.loader.exec_module(_xwlazy)
24
+
25
+ # Import all exports from the module
26
+ hook = _xwlazy.hook
27
+ auto_enable_lazy = _xwlazy.auto_enable_lazy
28
+ attach = _xwlazy.attach
29
+ XWLazy = _xwlazy.XWLazy
30
+ enable_keyword_detection = _xwlazy.enable_keyword_detection
31
+ is_keyword_detection_enabled = _xwlazy.is_keyword_detection_enabled
32
+ check_package_keywords = _xwlazy.check_package_keywords
33
+ enable_learning = _xwlazy.enable_learning
34
+ predict_next_imports = _xwlazy.predict_next_imports
35
+ get_all_stats = _xwlazy.get_all_stats
36
+ generate_sbom = _xwlazy.generate_sbom
37
+ get_lockfile = _xwlazy.get_lockfile
38
+ save_lockfile = _xwlazy.save_lockfile
39
+ install_global_import_hook = _xwlazy.install_global_import_hook
40
+ uninstall_global_import_hook = _xwlazy.uninstall_global_import_hook
41
+ is_global_import_hook_installed = _xwlazy.is_global_import_hook_installed
42
+ is_externally_managed = _xwlazy.is_externally_managed
43
+ add_watched_prefix = _xwlazy.add_watched_prefix
44
+ remove_watched_prefix = _xwlazy.remove_watched_prefix
45
+ get_watched_prefixes = _xwlazy.get_watched_prefixes
46
+ is_module_watched = _xwlazy.is_module_watched
47
+ get_cache_stats = _xwlazy.get_cache_stats
48
+ clear_cache = _xwlazy.clear_cache
49
+ invalidate_cache = _xwlazy.invalidate_cache
50
+ get_performance_stats = _xwlazy.get_performance_stats
51
+ clear_performance_stats = _xwlazy.clear_performance_stats
52
+ else:
53
+ raise ImportError("xwlazy.py module not found!")
23
54
 
24
- # NOW enable lazy mode (after namespace package is set up)
25
- import sys
26
- import importlib
55
+ # Import version from version module if it exists
56
+ # Note: version.py is at src/exonware/xwlazy/version.py (for hatch build system)
27
57
  try:
28
- # Use importlib to import after namespace is ready
29
- if 'exonware.xwlazy' not in sys.modules:
30
- xwlazy_module = importlib.import_module('exonware.xwlazy')
31
- auto_enable_lazy = getattr(xwlazy_module, 'auto_enable_lazy', None)
32
- if auto_enable_lazy:
33
- auto_enable_lazy("xwsystem", mode="smart")
34
- print("✅ Lazy mode enabled for xwsystem")
58
+ _version_file = Path(__file__).parent / "xwlazy" / "version.py"
59
+ if _version_file.exists():
60
+ _version_spec = importlib.util.spec_from_file_location("exonware.xwlazy.version", _version_file)
61
+ _version_module = importlib.util.module_from_spec(_version_spec)
62
+ _version_spec.loader.exec_module(_version_module)
63
+ __version__ = _version_module.__version__
35
64
  else:
36
- # Module already loaded, use it directly
37
- from exonware.xwlazy import auto_enable_lazy
38
- auto_enable_lazy("xwsystem", mode="smart")
39
- print("✅ Lazy mode enabled for xwsystem")
40
- except (ImportError, AttributeError):
41
- print("❌ Lazy mode not enabled for xwsystem (xwlazy not installed)")
42
- pass # xwlazy not installed - silently continue
65
+ __version__ = "1.0.1"
66
+ except (ImportError, AttributeError, Exception):
67
+ # Fallback: use default version
68
+ __version__ = "1.0.1"
69
+
70
+ __all__ = [
71
+ # Core activation
72
+ 'hook', 'auto_enable_lazy', 'attach',
73
+ # Main class
74
+ 'XWLazy',
75
+ # Keyword detection
76
+ 'enable_keyword_detection', 'is_keyword_detection_enabled', 'check_package_keywords',
77
+ # Adaptive learning
78
+ 'enable_learning', 'predict_next_imports',
79
+ # Stats & monitoring
80
+ 'get_all_stats', 'generate_sbom',
81
+ # Lockfile
82
+ 'get_lockfile', 'save_lockfile',
83
+ # Global hook
84
+ 'install_global_import_hook', 'uninstall_global_import_hook', 'is_global_import_hook_installed',
85
+ # Utility
86
+ 'is_externally_managed',
87
+ # Watched prefixes
88
+ 'add_watched_prefix', 'remove_watched_prefix', 'get_watched_prefixes', 'is_module_watched',
89
+ # Cache management
90
+ 'get_cache_stats', 'clear_cache', 'invalidate_cache',
91
+ # Performance monitoring
92
+ 'get_performance_stats', 'clear_performance_stats',
93
+ ]
@@ -14,13 +14,13 @@ All version references should import from this module to ensure consistency.
14
14
  # =============================================================================
15
15
 
16
16
  # Main version - update this to change version across entire project
17
- __version__ = "0.1.0.23"
17
+ __version__ = "1.0.1.2"
18
18
 
19
19
  # Version components for programmatic access
20
- VERSION_MAJOR = 0
21
- VERSION_MINOR = 1
22
- VERSION_PATCH = 0
23
- VERSION_BUILD = 23 # Set to None for releases, or build number for dev builds
20
+ VERSION_MAJOR = 1
21
+ VERSION_MINOR = 0
22
+ VERSION_PATCH = 1
23
+ VERSION_BUILD = 2 # Set to None for releases, or build number for dev builds
24
24
 
25
25
  # Version metadata
26
26
  VERSION_SUFFIX = "" # e.g., "dev", "alpha", "beta", "rc1"