exonware-xwsystem 0.0.1.406__py3-none-any.whl → 0.0.1.408__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 (244) hide show
  1. exonware/__init__.py +21 -12
  2. exonware/conf.py +89 -149
  3. exonware/xwsystem/__init__.py +18 -159
  4. exonware/xwsystem/caching/__init__.py +1 -1
  5. exonware/xwsystem/caching/base.py +1 -1
  6. exonware/xwsystem/caching/bloom_cache.py +1 -1
  7. exonware/xwsystem/caching/cache_manager.py +1 -1
  8. exonware/xwsystem/caching/conditional.py +1 -1
  9. exonware/xwsystem/caching/contracts.py +1 -1
  10. exonware/xwsystem/caching/decorators.py +1 -1
  11. exonware/xwsystem/caching/defs.py +1 -1
  12. exonware/xwsystem/caching/disk_cache.py +1 -1
  13. exonware/xwsystem/caching/distributed.py +1 -1
  14. exonware/xwsystem/caching/errors.py +1 -1
  15. exonware/xwsystem/caching/events.py +1 -1
  16. exonware/xwsystem/caching/eviction_strategies.py +1 -1
  17. exonware/xwsystem/caching/fluent.py +1 -1
  18. exonware/xwsystem/caching/integrity.py +1 -1
  19. exonware/xwsystem/caching/lfu_cache.py +1 -1
  20. exonware/xwsystem/caching/lfu_optimized.py +1 -1
  21. exonware/xwsystem/caching/lru_cache.py +1 -1
  22. exonware/xwsystem/caching/memory_bounded.py +1 -1
  23. exonware/xwsystem/caching/metrics_exporter.py +1 -1
  24. exonware/xwsystem/caching/observable_cache.py +1 -1
  25. exonware/xwsystem/caching/pluggable_cache.py +1 -1
  26. exonware/xwsystem/caching/rate_limiter.py +1 -1
  27. exonware/xwsystem/caching/read_through.py +1 -1
  28. exonware/xwsystem/caching/secure_cache.py +1 -1
  29. exonware/xwsystem/caching/serializable.py +1 -1
  30. exonware/xwsystem/caching/stats.py +1 -1
  31. exonware/xwsystem/caching/tagging.py +1 -1
  32. exonware/xwsystem/caching/ttl_cache.py +1 -1
  33. exonware/xwsystem/caching/two_tier_cache.py +1 -1
  34. exonware/xwsystem/caching/utils.py +1 -1
  35. exonware/xwsystem/caching/validation.py +1 -1
  36. exonware/xwsystem/caching/warming.py +1 -1
  37. exonware/xwsystem/caching/write_behind.py +1 -1
  38. exonware/xwsystem/cli/__init__.py +1 -1
  39. exonware/xwsystem/cli/args.py +1 -1
  40. exonware/xwsystem/cli/base.py +1 -1
  41. exonware/xwsystem/cli/colors.py +1 -1
  42. exonware/xwsystem/cli/console.py +1 -1
  43. exonware/xwsystem/cli/contracts.py +1 -1
  44. exonware/xwsystem/cli/defs.py +1 -1
  45. exonware/xwsystem/cli/errors.py +1 -1
  46. exonware/xwsystem/cli/progress.py +1 -1
  47. exonware/xwsystem/cli/prompts.py +1 -1
  48. exonware/xwsystem/cli/tables.py +1 -1
  49. exonware/xwsystem/conf.py +1 -21
  50. exonware/xwsystem/config/__init__.py +1 -1
  51. exonware/xwsystem/config/base.py +1 -1
  52. exonware/xwsystem/config/contracts.py +1 -1
  53. exonware/xwsystem/config/defaults.py +1 -1
  54. exonware/xwsystem/config/defs.py +1 -1
  55. exonware/xwsystem/config/errors.py +1 -1
  56. exonware/xwsystem/config/logging.py +1 -1
  57. exonware/xwsystem/config/logging_setup.py +1 -1
  58. exonware/xwsystem/config/performance.py +1 -1
  59. exonware/xwsystem/http/__init__.py +1 -1
  60. exonware/xwsystem/http/advanced_client.py +5 -1
  61. exonware/xwsystem/http/base.py +1 -1
  62. exonware/xwsystem/http/client.py +5 -1
  63. exonware/xwsystem/http/contracts.py +1 -1
  64. exonware/xwsystem/http/defs.py +1 -1
  65. exonware/xwsystem/http/errors.py +1 -1
  66. exonware/xwsystem/io/__init__.py +1 -1
  67. exonware/xwsystem/io/archive/__init__.py +1 -1
  68. exonware/xwsystem/io/archive/archive.py +1 -1
  69. exonware/xwsystem/io/archive/archive_files.py +1 -1
  70. exonware/xwsystem/io/archive/archivers.py +1 -1
  71. exonware/xwsystem/io/archive/base.py +1 -1
  72. exonware/xwsystem/io/archive/codec_integration.py +1 -1
  73. exonware/xwsystem/io/archive/compression.py +1 -1
  74. exonware/xwsystem/io/archive/formats/__init__.py +1 -1
  75. exonware/xwsystem/io/archive/formats/brotli_format.py +1 -1
  76. exonware/xwsystem/io/archive/formats/lz4_format.py +1 -1
  77. exonware/xwsystem/io/archive/formats/rar.py +1 -1
  78. exonware/xwsystem/io/archive/formats/sevenzip.py +1 -1
  79. exonware/xwsystem/io/archive/formats/squashfs_format.py +1 -1
  80. exonware/xwsystem/io/archive/formats/tar.py +1 -1
  81. exonware/xwsystem/io/archive/formats/wim_format.py +1 -1
  82. exonware/xwsystem/io/archive/formats/zip.py +1 -1
  83. exonware/xwsystem/io/archive/formats/zpaq_format.py +1 -1
  84. exonware/xwsystem/io/archive/formats/zstandard.py +1 -1
  85. exonware/xwsystem/io/base.py +1 -1
  86. exonware/xwsystem/io/codec/__init__.py +1 -1
  87. exonware/xwsystem/io/codec/base.py +1 -1
  88. exonware/xwsystem/io/codec/contracts.py +1 -1
  89. exonware/xwsystem/io/codec/registry.py +1 -1
  90. exonware/xwsystem/io/common/__init__.py +1 -1
  91. exonware/xwsystem/io/common/base.py +1 -1
  92. exonware/xwsystem/io/common/lock.py +1 -1
  93. exonware/xwsystem/io/common/watcher.py +1 -1
  94. exonware/xwsystem/io/contracts.py +1 -1
  95. exonware/xwsystem/io/defs.py +1 -1
  96. exonware/xwsystem/io/errors.py +1 -1
  97. exonware/xwsystem/io/facade.py +1 -1
  98. exonware/xwsystem/io/file/__init__.py +1 -1
  99. exonware/xwsystem/io/file/base.py +1 -1
  100. exonware/xwsystem/io/file/conversion.py +1 -1
  101. exonware/xwsystem/io/file/file.py +1 -1
  102. exonware/xwsystem/io/file/paged_source.py +1 -1
  103. exonware/xwsystem/io/file/paging/__init__.py +1 -1
  104. exonware/xwsystem/io/file/paging/byte_paging.py +1 -1
  105. exonware/xwsystem/io/file/paging/line_paging.py +1 -1
  106. exonware/xwsystem/io/file/paging/record_paging.py +1 -1
  107. exonware/xwsystem/io/file/paging/registry.py +1 -1
  108. exonware/xwsystem/io/file/source.py +1 -1
  109. exonware/xwsystem/io/filesystem/__init__.py +1 -1
  110. exonware/xwsystem/io/filesystem/base.py +1 -1
  111. exonware/xwsystem/io/filesystem/local.py +1 -1
  112. exonware/xwsystem/io/folder/__init__.py +1 -1
  113. exonware/xwsystem/io/folder/base.py +1 -1
  114. exonware/xwsystem/io/folder/folder.py +1 -1
  115. exonware/xwsystem/io/serialization/__init__.py +1 -1
  116. exonware/xwsystem/io/serialization/auto_serializer.py +1 -1
  117. exonware/xwsystem/io/serialization/base.py +2 -2
  118. exonware/xwsystem/io/serialization/contracts.py +1 -1
  119. exonware/xwsystem/io/serialization/defs.py +1 -1
  120. exonware/xwsystem/io/serialization/errors.py +1 -1
  121. exonware/xwsystem/io/serialization/flyweight.py +1 -1
  122. exonware/xwsystem/io/serialization/format_detector.py +1 -1
  123. exonware/xwsystem/io/serialization/formats/__init__.py +1 -1
  124. exonware/xwsystem/io/serialization/formats/binary/bson.py +1 -1
  125. exonware/xwsystem/io/serialization/formats/binary/cbor.py +1 -1
  126. exonware/xwsystem/io/serialization/formats/binary/marshal.py +1 -1
  127. exonware/xwsystem/io/serialization/formats/binary/msgpack.py +1 -1
  128. exonware/xwsystem/io/serialization/formats/binary/pickle.py +1 -1
  129. exonware/xwsystem/io/serialization/formats/binary/plistlib.py +1 -1
  130. exonware/xwsystem/io/serialization/formats/database/dbm.py +1 -1
  131. exonware/xwsystem/io/serialization/formats/database/shelve.py +1 -1
  132. exonware/xwsystem/io/serialization/formats/database/sqlite3.py +1 -1
  133. exonware/xwsystem/io/serialization/formats/text/configparser.py +1 -1
  134. exonware/xwsystem/io/serialization/formats/text/csv.py +1 -1
  135. exonware/xwsystem/io/serialization/formats/text/formdata.py +1 -1
  136. exonware/xwsystem/io/serialization/formats/text/json.py +1 -1
  137. exonware/xwsystem/io/serialization/formats/text/json5.py +1 -1
  138. exonware/xwsystem/io/serialization/formats/text/jsonlines.py +1 -1
  139. exonware/xwsystem/io/serialization/formats/text/multipart.py +1 -1
  140. exonware/xwsystem/io/serialization/formats/text/toml.py +1 -1
  141. exonware/xwsystem/io/serialization/formats/text/xml.py +1 -1
  142. exonware/xwsystem/io/serialization/formats/text/yaml.py +1 -1
  143. exonware/xwsystem/io/serialization/registry.py +1 -1
  144. exonware/xwsystem/io/serialization/serializer.py +1 -1
  145. exonware/xwsystem/io/serialization/utils/__init__.py +1 -1
  146. exonware/xwsystem/io/serialization/utils/path_ops.py +1 -1
  147. exonware/xwsystem/io/stream/__init__.py +1 -1
  148. exonware/xwsystem/io/stream/async_operations.py +1 -1
  149. exonware/xwsystem/io/stream/base.py +1 -1
  150. exonware/xwsystem/io/stream/codec_io.py +1 -1
  151. exonware/xwsystem/ipc/async_fabric.py +1 -1
  152. exonware/xwsystem/ipc/base.py +1 -1
  153. exonware/xwsystem/ipc/contracts.py +1 -1
  154. exonware/xwsystem/ipc/defs.py +1 -1
  155. exonware/xwsystem/ipc/errors.py +1 -1
  156. exonware/xwsystem/lazy_bootstrap.py +79 -0
  157. exonware/xwsystem/monitoring/base.py +1 -1
  158. exonware/xwsystem/monitoring/contracts.py +1 -1
  159. exonware/xwsystem/monitoring/defs.py +1 -1
  160. exonware/xwsystem/monitoring/errors.py +1 -1
  161. exonware/xwsystem/monitoring/performance_manager_generic.py +1 -1
  162. exonware/xwsystem/monitoring/system_monitor.py +1 -1
  163. exonware/xwsystem/monitoring/tracing.py +17 -15
  164. exonware/xwsystem/monitoring/tracker.py +1 -1
  165. exonware/xwsystem/operations/__init__.py +1 -1
  166. exonware/xwsystem/operations/base.py +1 -1
  167. exonware/xwsystem/operations/defs.py +1 -1
  168. exonware/xwsystem/operations/diff.py +1 -1
  169. exonware/xwsystem/operations/merge.py +1 -1
  170. exonware/xwsystem/operations/patch.py +1 -1
  171. exonware/xwsystem/patterns/base.py +1 -1
  172. exonware/xwsystem/patterns/contracts.py +1 -1
  173. exonware/xwsystem/patterns/defs.py +1 -1
  174. exonware/xwsystem/patterns/errors.py +1 -1
  175. exonware/xwsystem/patterns/registry.py +1 -1
  176. exonware/xwsystem/plugins/__init__.py +1 -1
  177. exonware/xwsystem/plugins/base.py +1 -1
  178. exonware/xwsystem/plugins/contracts.py +1 -1
  179. exonware/xwsystem/plugins/defs.py +1 -1
  180. exonware/xwsystem/plugins/errors.py +1 -1
  181. exonware/xwsystem/runtime/__init__.py +1 -1
  182. exonware/xwsystem/runtime/base.py +1 -1
  183. exonware/xwsystem/runtime/contracts.py +1 -1
  184. exonware/xwsystem/runtime/defs.py +1 -1
  185. exonware/xwsystem/runtime/env.py +1 -1
  186. exonware/xwsystem/runtime/errors.py +1 -1
  187. exonware/xwsystem/runtime/reflection.py +1 -1
  188. exonware/xwsystem/security/auth.py +1 -1
  189. exonware/xwsystem/security/base.py +1 -1
  190. exonware/xwsystem/security/contracts.py +1 -1
  191. exonware/xwsystem/security/crypto.py +1 -1
  192. exonware/xwsystem/security/defs.py +1 -1
  193. exonware/xwsystem/security/errors.py +1 -1
  194. exonware/xwsystem/security/hazmat.py +1 -1
  195. exonware/xwsystem/shared/__init__.py +1 -1
  196. exonware/xwsystem/shared/base.py +1 -1
  197. exonware/xwsystem/shared/contracts.py +1 -1
  198. exonware/xwsystem/shared/defs.py +1 -1
  199. exonware/xwsystem/shared/errors.py +1 -1
  200. exonware/xwsystem/structures/base.py +1 -1
  201. exonware/xwsystem/structures/contracts.py +1 -1
  202. exonware/xwsystem/structures/defs.py +1 -1
  203. exonware/xwsystem/structures/errors.py +1 -1
  204. exonware/xwsystem/threading/async_primitives.py +1 -1
  205. exonware/xwsystem/threading/base.py +1 -1
  206. exonware/xwsystem/threading/contracts.py +1 -1
  207. exonware/xwsystem/threading/defs.py +1 -1
  208. exonware/xwsystem/threading/errors.py +1 -1
  209. exonware/xwsystem/utils/base.py +1 -1
  210. exonware/xwsystem/utils/contracts.py +1 -1
  211. exonware/xwsystem/utils/dt/__init__.py +1 -1
  212. exonware/xwsystem/utils/dt/base.py +1 -1
  213. exonware/xwsystem/utils/dt/contracts.py +1 -1
  214. exonware/xwsystem/utils/dt/defs.py +1 -1
  215. exonware/xwsystem/utils/dt/errors.py +1 -1
  216. exonware/xwsystem/utils/dt/formatting.py +1 -1
  217. exonware/xwsystem/utils/dt/humanize.py +1 -1
  218. exonware/xwsystem/utils/dt/parsing.py +1 -1
  219. exonware/xwsystem/utils/dt/timezone_utils.py +1 -1
  220. exonware/xwsystem/utils/errors.py +1 -1
  221. exonware/xwsystem/utils/test_runner.py +1 -1
  222. exonware/xwsystem/utils/utils_contracts.py +1 -1
  223. exonware/xwsystem/validation/__init__.py +1 -1
  224. exonware/xwsystem/validation/base.py +1 -1
  225. exonware/xwsystem/validation/contracts.py +1 -1
  226. exonware/xwsystem/validation/declarative.py +1 -1
  227. exonware/xwsystem/validation/defs.py +1 -1
  228. exonware/xwsystem/validation/errors.py +1 -1
  229. exonware/xwsystem/validation/fluent_validator.py +1 -1
  230. exonware/xwsystem/version.py +2 -2
  231. {exonware_xwsystem-0.0.1.406.dist-info → exonware_xwsystem-0.0.1.408.dist-info}/METADATA +3 -3
  232. exonware_xwsystem-0.0.1.408.dist-info/RECORD +274 -0
  233. exonware/xwsystem/_lazy_bootstrap.py +0 -77
  234. exonware/xwsystem/utils/lazy_package/ARCHITECTURE.md +0 -820
  235. exonware/xwsystem/utils/lazy_package/__init__.py +0 -268
  236. exonware/xwsystem/utils/lazy_package/config.py +0 -163
  237. exonware/xwsystem/utils/lazy_package/lazy_base.py +0 -465
  238. exonware/xwsystem/utils/lazy_package/lazy_contracts.py +0 -290
  239. exonware/xwsystem/utils/lazy_package/lazy_core.py +0 -2248
  240. exonware/xwsystem/utils/lazy_package/lazy_errors.py +0 -253
  241. exonware/xwsystem/utils/lazy_package/lazy_state.py +0 -86
  242. exonware_xwsystem-0.0.1.406.dist-info/RECORD +0 -282
  243. {exonware_xwsystem-0.0.1.406.dist-info → exonware_xwsystem-0.0.1.408.dist-info}/WHEEL +0 -0
  244. {exonware_xwsystem-0.0.1.406.dist-info → exonware_xwsystem-0.0.1.408.dist-info}/licenses/LICENSE +0 -0
exonware/__init__.py CHANGED
@@ -4,7 +4,7 @@ exonware package - Enterprise-grade Python framework ecosystem
4
4
  Company: eXonware.com
5
5
  Author: Eng. Muhammad AlShehri
6
6
  Email: connect@exonware.com
7
- Version: 0.0.1.406
7
+ Version: 0.0.1.408
8
8
  Generation Date: September 04, 2025
9
9
 
10
10
  This is a namespace package allowing multiple exonware subpackages
@@ -14,17 +14,26 @@ to coexist (xwsystem, xwnode, xwdata, etc.)
14
14
  # Make this a namespace package
15
15
  __path__ = __import__('pkgutil').extend_path(__path__, __name__)
16
16
 
17
- # Only import version if xwsystem is available (lazy import)
18
- # Root cause: Previous implementation used a hardcoded fallback placeholder,
19
- # which violates version centralization (GUIDE_DEV / GUIDE_TEST). Fix by
20
- # requiring the centralized version module to load successfully.
21
- try:
22
- from .xwsystem.version import __version__
23
- except ImportError as exc: # pragma: no cover - ensure failure is explicit
24
- raise ImportError(
25
- "exonware.xwsystem version metadata unavailable. Ensure the package is "
26
- "installed with its source tree intact so that 'xwsystem.version' can be imported."
27
- ) from exc
17
+ import importlib.metadata
18
+ from pathlib import Path
19
+
20
+
21
+ def _load_version() -> str:
22
+ try:
23
+ return importlib.metadata.version("exonware-xwsystem")
24
+ except importlib.metadata.PackageNotFoundError:
25
+ version_path = Path(__file__).parent / "xwsystem" / "version.py"
26
+ ns: dict = {}
27
+ try:
28
+ exec(version_path.read_text(encoding="utf-8"), ns) # noqa: S102
29
+ except FileNotFoundError as exc: # pragma: no cover
30
+ raise ImportError(
31
+ f"Version metadata unavailable at {version_path}."
32
+ ) from exc
33
+ return ns["__version__"]
34
+
35
+
36
+ __version__ = _load_version()
28
37
 
29
38
  __author__ = 'Eng. Muhammad AlShehri'
30
39
  __email__ = 'connect@exonware.com'
exonware/conf.py CHANGED
@@ -9,7 +9,7 @@ works across all exonware packages (xwsystem, xwnode, xwdata, etc.).
9
9
  Company: eXonware.com
10
10
  Author: Eng. Muhammad AlShehri
11
11
  Email: connect@exonware.com
12
- Version: 0.0.1.406
12
+ Version: 0.0.1.408
13
13
  Generation Date: 11-Nov-2025
14
14
  """
15
15
 
@@ -17,163 +17,103 @@ from __future__ import annotations
17
17
 
18
18
  import sys
19
19
  import types
20
- from typing import Dict, Optional, Any
21
20
 
22
- from exonware.xwsystem.utils.lazy_package.lazy_state import LazyStateManager
21
+ # CRITICAL: Set up warning filter BEFORE any other imports to catch early warnings
22
+ # This suppresses the decimal module mpd_setminalloc warning that appears on stderr
23
+ _original_stderr = sys.stderr
23
24
 
24
-
25
- class _PackageConfig:
26
- """Per-package configuration wrapper."""
27
-
28
- def __init__(self, package_name: str, parent_conf):
29
- self._package_name = package_name
30
- self._parent_conf = parent_conf
31
- self._lazy_config = None
32
-
33
- @property
34
- def lazy_install(self) -> bool:
35
- """Get lazy install status for this package."""
36
- return self._get_lazy_config().lazy_import
37
-
38
- @lazy_install.setter
39
- def lazy_install(self, value: bool) -> None:
40
- """Set lazy install for this package."""
41
- self._get_lazy_config().lazy_import = value
25
+ class _FilteredStderr:
26
+ """Stderr wrapper that filters out decimal module warnings."""
27
+ def __init__(self, original_stderr):
28
+ self._original = original_stderr
29
+ # Match various forms of the decimal warning
30
+ self._filter_patterns = [
31
+ "mpd_setminalloc",
32
+ "MPD_MINALLOC",
33
+ "ignoring request to set",
34
+ "libmpdec",
35
+ "context.c:57"
36
+ ]
42
37
 
43
- def lazy_install_status(self) -> dict:
44
- """Get detailed lazy install status for this package."""
45
- return self._get_lazy_config().get_lazy_status()
38
+ def write(self, text: str) -> int:
39
+ """Write to stderr, filtering out unwanted warnings."""
40
+ # Check if this line contains any of our filter patterns
41
+ if any(pattern.lower() in text.lower() for pattern in self._filter_patterns):
42
+ return len(text) # Pretend we wrote it, but don't actually write
43
+ return self._original.write(text)
46
44
 
47
- def is_lazy_active(self) -> bool:
48
- """Check if lazy mode is active for this package."""
49
- return self._get_lazy_config().is_lazy_active()
45
+ def flush(self) -> None:
46
+ """Flush the original stderr."""
47
+ self._original.flush()
50
48
 
51
- def _get_lazy_config(self):
52
- """Lazy import LazyConfig from xwsystem when needed."""
53
- if self._lazy_config is None:
54
- try:
55
- # Try to import - if xwsystem is already loaded, use it
56
- import importlib
57
- config_module = importlib.import_module('exonware.xwsystem.utils.lazy_package.config')
58
- LazyConfig = config_module.LazyConfig
59
- self._lazy_config = LazyConfig(packages=(self._package_name,))
60
- except (ImportError, AttributeError):
61
- # Fallback config that uses environment variables for early hook installation
62
- class _StandaloneConfig:
63
- def __init__(self, pkg, parent):
64
- self._pkg = pkg
65
- self._parent = parent
66
- import os
67
- # Check environment variable for initial state
68
- env_var = f"{pkg.upper()}_LAZY_INSTALL"
69
- self._enabled = os.environ.get(env_var, '').lower() in ('true', '1', 'yes', 'on')
70
-
71
- @property
72
- def lazy_import(self):
73
- return self._enabled
74
-
75
- @lazy_import.setter
76
- def lazy_import(self, value):
77
- import os
78
- self._enabled = value
79
- state_manager = LazyStateManager(self._pkg)
80
- state_manager.set_manual_state(value)
81
- if not value:
82
- state_manager.set_auto_state(False)
83
- # Set environment variable so bootstrap can read it
84
- env_var = f"{self._pkg.upper()}_LAZY_INSTALL"
85
- if value:
86
- os.environ[env_var] = '1'
87
- # Try to install hook if xwsystem is available
88
- self._parent._try_install_hook(self._pkg)
89
- else:
90
- os.environ.pop(env_var, None)
91
-
92
- def get_lazy_status(self):
93
- # Try to get real status if xwsystem is now available
94
- try:
95
- import importlib
96
- config_module = importlib.import_module('exonware.xwsystem.utils.lazy_package.config')
97
- LazyConfig = config_module.LazyConfig
98
- real_config = LazyConfig(packages=(self._pkg,))
99
- return real_config.get_lazy_status()
100
- except (ImportError, AttributeError):
101
- return {
102
- 'enabled': self._enabled,
103
- 'hook_installed': False,
104
- 'lazy_install_enabled': False,
105
- 'active': False,
106
- 'error': 'xwsystem not available'
107
- }
108
-
109
- def is_lazy_active(self):
110
- try:
111
- import importlib
112
- config_module = importlib.import_module('exonware.xwsystem.utils.lazy_package.config')
113
- LazyConfig = config_module.LazyConfig
114
- real_config = LazyConfig(packages=(self._pkg,))
115
- return real_config.is_lazy_active()
116
- except (ImportError, AttributeError):
117
- return False
118
-
119
- self._lazy_config = _StandaloneConfig(self._package_name, self._parent_conf)
120
- return self._lazy_config
49
+ def reconfigure(self, *args, **kwargs):
50
+ """Handle reconfigure calls - update original reference and reapply filter."""
51
+ # Update the original reference after reconfigure
52
+ result = self._original.reconfigure(*args, **kwargs)
53
+ # Ensure filter stays active
54
+ if sys.stderr is not self:
55
+ sys.stderr = self # type: ignore[assignment]
56
+ return result
121
57
 
122
- def _try_install_hook(self, package_name: str):
123
- """Try to install hook if xwsystem is available."""
124
- try:
125
- import importlib
126
- lazy_core = importlib.import_module('exonware.xwsystem.utils.lazy_package.lazy_core')
127
- if hasattr(lazy_core, 'install_import_hook'):
128
- lazy_core.install_import_hook(package_name)
129
- except (ImportError, AttributeError):
130
- # xwsystem not available yet - bootstrap will install hook when it loads
131
- pass
58
+ def __getattr__(self, name: str):
59
+ """Delegate all other attributes to original stderr."""
60
+ return getattr(self._original, name)
132
61
 
62
+ # Set up filter immediately (default: suppress warnings)
63
+ _filtered_stderr = _FilteredStderr(_original_stderr)
64
+ sys.stderr = _filtered_stderr # type: ignore[assignment]
133
65
 
134
- class _ExonwareConfModule(types.ModuleType):
135
- """
136
- Configuration module for all exonware packages.
137
-
138
- Provides per-package lazy mode configuration without requiring
139
- any library to be initialized first.
140
- """
141
-
142
- def __init__(self, name, doc=None):
143
- super().__init__(name, doc)
144
- self._package_configs: Dict[str, _PackageConfig] = {}
145
-
146
- def __getattr__(self, name: str):
147
- # Per-package config access: conf.xwsystem.lazy_install
148
- if name in ('xwsystem', 'xwnode', 'xwdata', 'xwschema', 'xwaction', 'xwentity'):
149
- if name not in self._package_configs:
150
- self._package_configs[name] = _PackageConfig(name, self)
151
- return self._package_configs[name]
152
-
153
- # Global lazy_install (defaults to xwsystem for backward compatibility)
154
- if name == "lazy_install":
155
- return self.xwsystem.lazy_install
156
- elif name == "lazy_install_status":
157
- return self.xwsystem.lazy_install_status
158
- elif name == "is_lazy_active":
159
- return self.xwsystem.is_lazy_active
160
-
161
- raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
162
-
163
- def __setattr__(self, name: str, value) -> None:
164
- # Internal attributes
165
- if name.startswith('_'):
166
- super().__setattr__(name, value)
167
- return
168
-
169
- # Global lazy_install (defaults to xwsystem)
170
- if name == "lazy_install":
171
- self.xwsystem.lazy_install = value
172
- else:
173
- super().__setattr__(name, value)
66
+ # CRITICAL: Configure UTF-8 encoding on Windows for emoji support
67
+ # This ensures emojis work automatically when exonware.conf is imported
68
+ # Root cause: Windows console defaults to cp1252 encoding, which can't encode emojis
69
+ # Trigger: This code runs at import time, before any prints, ensuring UTF-8 is active
70
+ if sys.platform == "win32":
71
+ try:
72
+ # Try to reconfigure stdout/stderr to UTF-8 (Python 3.7+)
73
+ if hasattr(sys.stdout, "reconfigure"):
74
+ try:
75
+ sys.stdout.reconfigure(encoding="utf-8")
76
+ except (ValueError, OSError):
77
+ pass # May fail if already reconfigured or not supported
78
+ if hasattr(sys.stderr, "reconfigure"):
79
+ try:
80
+ sys.stderr.reconfigure(encoding="utf-8")
81
+ except (ValueError, OSError):
82
+ pass # May fail if already reconfigured or not supported
83
+ except Exception:
84
+ # Fallback: wrap stdout/stderr with UTF-8 TextIOWrapper
85
+ import io
86
+ try:
87
+ if hasattr(sys.stdout, "buffer"):
88
+ sys.stdout = io.TextIOWrapper(
89
+ sys.stdout.buffer, encoding="utf-8", errors="replace", line_buffering=True
90
+ )
91
+ if hasattr(_filtered_stderr._original, "buffer"):
92
+ _filtered_stderr._original = io.TextIOWrapper(
93
+ _filtered_stderr._original.buffer, encoding="utf-8", errors="replace", line_buffering=True
94
+ )
95
+ except Exception:
96
+ pass # Silently fail if wrapping is not possible
174
97
 
98
+ try:
99
+ # Try new path first (exonware.xwlazy.host.conf)
100
+ from exonware.xwlazy.host.conf import get_conf_module
101
+ except ImportError:
102
+ try:
103
+ # Fall back to old path (xwlazy.lazy.host_conf) for installed packages
104
+ from xwlazy.lazy.host_conf import get_conf_module
105
+ except ImportError: # xwlazy not installed yet
106
+ class _UnavailableConf(types.ModuleType):
107
+ def __getattr__(self, name: str):
108
+ raise RuntimeError(
109
+ "Lazy configuration requires 'exonware-xwlazy'. "
110
+ "Install it via 'pip install exonware-xwlazy' to enable lazy mode."
111
+ )
112
+ _module_instance = _UnavailableConf(__name__, __doc__)
113
+ else:
114
+ _module_instance = get_conf_module(__name__, __doc__)
115
+ else:
116
+ _module_instance = get_conf_module(__name__, __doc__)
175
117
 
176
- # Replace module with custom class instance
177
- _module_instance = _ExonwareConfModule(__name__, __doc__)
178
118
  sys.modules[__name__] = _module_instance
179
119
 
@@ -3,7 +3,7 @@
3
3
  Company: eXonware.com
4
4
  Author: Eng. Muhammad AlShehri
5
5
  Email: connect@exonware.com
6
- Version: 0.0.1.406
6
+ Version: 0.0.1.408
7
7
  Generation Date: October 10, 2025
8
8
 
9
9
  XWSystem - Enterprise-grade Python framework with AI-powered performance optimization.
@@ -50,6 +50,7 @@ This module provides common utilities that can be used across different
50
50
  components including threading, security, I/O, data structures, and design patterns.
51
51
  """
52
52
 
53
+ import importlib
53
54
  import logging
54
55
  from typing import TYPE_CHECKING
55
56
 
@@ -58,103 +59,15 @@ if TYPE_CHECKING:
58
59
  from typing import Any
59
60
 
60
61
  # =============================================================================
61
- # EARLY LAZY BOOTSTRAP - Install hook before any imports
62
+ # LAZY MODE INTEGRATION
62
63
  # =============================================================================
63
- # Import bootstrap FIRST to install hook if [lazy] extra detected
64
- # This ensures hook is active before serialization modules are imported
65
- from . import _lazy_bootstrap # This installs hook if [lazy] extra detected
66
-
67
- # =============================================================================
68
- # LAZY LOADING SYSTEM - Unified Package
69
- # =============================================================================
70
- # All lazy loading functionality consolidated into lazy_package following DEV_GUIDELINES.md
71
- # Implements per-package lazy loading with automatic installation of missing dependencies.
72
-
73
- from .utils.lazy_package import (
74
- # Core classes
75
- LazyLoader,
76
- LazyModuleRegistry,
77
- LazyModeFacade,
78
- LazyPerformanceMonitor,
79
- LazyInstaller,
80
- LazyInstallerRegistry,
81
- LazyInstallMode,
82
- LazyInstallPolicy,
83
- DependencyMapper,
84
- LazyDiscovery,
85
- LazyInstallConfig,
86
- DeferredImportError,
87
- LazyMetaPathFinder,
88
-
89
- # Dataclasses
90
- DependencyInfo,
91
-
92
- # Lazy mode functions
93
- register_lazy_module,
94
- get_lazy_module,
95
- get_loading_stats,
96
- preload_frequently_used,
97
- enable_lazy_mode,
98
- disable_lazy_mode,
99
- is_lazy_mode_enabled,
100
- get_lazy_mode_stats,
101
- configure_lazy_mode,
102
- preload_modules,
103
- optimize_lazy_mode,
104
-
105
- # Install functions
106
- enable_lazy_install,
107
- disable_lazy_install,
108
- is_lazy_install_enabled,
109
- set_lazy_install_mode,
110
- get_lazy_install_mode,
111
- install_missing_package,
112
- install_and_import,
113
- get_lazy_install_stats,
114
- get_all_lazy_install_stats,
115
- lazy_import_with_install,
116
- xwimport,
117
-
118
- # Discovery functions
119
- discover_dependencies,
120
- get_lazy_discovery,
121
- export_dependency_mappings,
122
- config_package_lazy_install_enabled,
123
-
124
- # Hook functions
125
- install_import_hook,
126
- uninstall_import_hook,
127
- is_import_hook_installed,
128
-
129
- # Security & Policy APIs
130
- set_package_allow_list,
131
- set_package_deny_list,
132
- add_to_package_allow_list,
133
- add_to_package_deny_list,
134
- set_package_index_url,
135
- set_package_extra_index_urls,
136
- add_package_trusted_host,
137
- set_package_lockfile,
138
- generate_package_sbom,
139
- check_externally_managed_environment,
140
- )
141
-
142
- # Auto-detect [lazy] installation mode and install import hook only when enabled
143
- config_package_lazy_install_enabled("xwsystem")
144
-
145
- # =============================================================================
146
- # LAZY INSTALLATION - Simple One-Line Configuration
147
- # =============================================================================
148
- # DISABLED BY DEFAULT - Users can enable manually if needed
149
- # Auto-detects if user installed with [lazy] extra: pip install xwsystem[lazy]
150
- # config_package_lazy_install_enabled("xwsystem", install_hook=False) # Configure lazy mode
151
-
152
- # =============================================================================
153
- # TWO-STAGE LAZY LOADING - Install import hook BEFORE importing serialization
154
- # =============================================================================
155
- # DISABLED BY DEFAULT - Prevents import hook interference
156
- # Install the hook NOW, before serialization imports, so it can intercept them
157
- # install_import_hook("xwsystem") # Install hook to intercept serialization module imports
64
+ # Minimal-intrusion lazy mode bootstrap (one line)
65
+ # Enables optimized lazy mode for xwsystem if xwlazy is installed
66
+ # Uses fastest mode from benchmarks: cached + full (1.482 ms)
67
+ try:
68
+ from .lazy_bootstrap import _bootstrap_lazy_mode # noqa: F401
69
+ except ImportError:
70
+ pass # xwlazy not installed - silently continue
158
71
 
159
72
  # Logging utilities
160
73
  from .config.logging_setup import get_logger, setup_logging
@@ -446,6 +359,14 @@ from .shared.contracts import IStringable
446
359
  # Import version from centralized location
447
360
  from .version import __version__
448
361
 
362
+ try:
363
+ import sys as _sys
364
+ _parent_pkg = _sys.modules.get("exonware")
365
+ if _parent_pkg is not None:
366
+ _parent_pkg.__version__ = __version__
367
+ except Exception: # pragma: no cover
368
+ pass
369
+
449
370
  # =============================================================================
450
371
  # CONVENIENCE FUNCTIONS - Quick access to common operations
451
372
  # =============================================================================
@@ -932,68 +853,6 @@ __all__ = [
932
853
  "Pipe",
933
854
  "AsyncPipe",
934
855
 
935
- # Lazy Mode - Performance optimization
936
- "LazyLoader",
937
- "LazyModuleRegistry",
938
- "LazyModeFacade",
939
- "LazyPerformanceMonitor",
940
- "register_lazy_module",
941
- "get_lazy_module",
942
- "get_loading_stats",
943
- "preload_frequently_used",
944
- "enable_lazy_mode",
945
- "disable_lazy_mode",
946
- "is_lazy_mode_enabled",
947
- "get_lazy_mode_stats",
948
- "configure_lazy_mode",
949
- "preload_modules",
950
- "optimize_lazy_mode",
951
-
952
- # Lazy Install - Auto-install missing packages (per-package isolation)
953
- "LazyInstaller",
954
- "LazyInstallerRegistry",
955
- "LazyInstallMode",
956
- "LazyInstallPolicy",
957
- "DependencyMapper",
958
- "enable_lazy_install",
959
- "disable_lazy_install",
960
- "is_lazy_install_enabled",
961
- "set_lazy_install_mode",
962
- "get_lazy_install_mode",
963
- "install_missing_package",
964
- "install_and_import",
965
- "get_lazy_install_stats",
966
- "get_all_lazy_install_stats",
967
- "lazy_import_with_install",
968
- "xwimport",
969
- # Security & Policy APIs
970
- "set_package_allow_list",
971
- "set_package_deny_list",
972
- "add_to_package_allow_list",
973
- "add_to_package_deny_list",
974
- "set_package_index_url",
975
- "set_package_extra_index_urls",
976
- "add_package_trusted_host",
977
- "set_package_lockfile",
978
- "generate_package_sbom",
979
- "check_externally_managed_environment",
980
-
981
- # Lazy Discovery - Package-agnostic dependency discovery with auto-detection
982
- "LazyDiscovery",
983
- "LazyInstallConfig",
984
- "DependencyInfo",
985
- "discover_dependencies",
986
- "get_lazy_discovery",
987
- "export_dependency_mappings",
988
- "config_package_lazy_install_enabled",
989
-
990
- # Lazy Import Hook - Performance optimized automatic import interception
991
- "DeferredImportError",
992
- "LazyMetaPathFinder",
993
- "install_import_hook",
994
- "uninstall_import_hook",
995
- "is_import_hook_installed",
996
-
997
856
  # Convenience Functions - Quick access patterns
998
857
  "quick_serialize",
999
858
  "quick_deserialize",
@@ -2,7 +2,7 @@
2
2
  Company: eXonware.com
3
3
  Author: Eng. Muhammad AlShehri
4
4
  Email: connect@exonware.com
5
- Version: 0.0.1.406
5
+ Version: 0.0.1.408
6
6
  Generation Date: 01-Nov-2025
7
7
 
8
8
  XSystem Caching Package
@@ -3,7 +3,7 @@
3
3
  Company: eXonware.com
4
4
  Author: Eng. Muhammad AlShehri
5
5
  Email: connect@exonware.com
6
- Version: 0.0.1.406
6
+ Version: 0.0.1.408
7
7
  Generation Date: September 04, 2025
8
8
 
9
9
  Caching module base classes - abstract classes for caching functionality.
@@ -3,7 +3,7 @@
3
3
  Company: eXonware.com
4
4
  Author: Eng. Muhammad AlShehri
5
5
  Email: connect@exonware.com
6
- Version: 0.0.1.406
6
+ Version: 0.0.1.408
7
7
  Generation Date: 01-Nov-2025
8
8
 
9
9
  Bloom filter-enhanced cache for faster negative lookups.
@@ -2,7 +2,7 @@
2
2
  Company: eXonware.com
3
3
  Author: Eng. Muhammad AlShehri
4
4
  Email: connect@exonware.com
5
- Version: 0.0.1.406
5
+ Version: 0.0.1.408
6
6
  Generation Date: September 04, 2025
7
7
 
8
8
  Cache Manager implementation - Placeholder.
@@ -3,7 +3,7 @@
3
3
  Company: eXonware.com
4
4
  Author: Eng. Muhammad AlShehri
5
5
  Email: connect@exonware.com
6
- Version: 0.0.1.406
6
+ Version: 0.0.1.408
7
7
  Generation Date: 01-Nov-2025
8
8
 
9
9
  Conditional eviction policies for caching.
@@ -3,7 +3,7 @@
3
3
  Company: eXonware.com
4
4
  Author: Eng. Muhammad AlShehri
5
5
  Email: connect@exonware.com
6
- Version: 0.0.1.406
6
+ Version: 0.0.1.408
7
7
  Generation Date: September 04, 2025
8
8
 
9
9
  Caching protocol interfaces for XWSystem.
@@ -4,7 +4,7 @@
4
4
  Company: eXonware.com
5
5
  Author: Eng. Muhammad AlShehri
6
6
  Email: connect@exonware.com
7
- Version: 0.0.1.406
7
+ Version: 0.0.1.408
8
8
  Generation Date: 01-Nov-2025
9
9
 
10
10
  Advanced cache decorators with hooks and customization.
@@ -4,7 +4,7 @@
4
4
  Company: eXonware.com
5
5
  Author: Eng. Muhammad AlShehri
6
6
  Email: connect@exonware.com
7
- Version: 0.0.1.406
7
+ Version: 0.0.1.408
8
8
  Generation Date: 07-Sep-2025
9
9
 
10
10
  Caching types and enums for XWSystem.
@@ -3,7 +3,7 @@
3
3
  Company: eXonware.com
4
4
  Author: Eng. Muhammad AlShehri
5
5
  Email: connect@exonware.com
6
- Version: 0.0.1.406
6
+ Version: 0.0.1.408
7
7
  Generation Date: October 26, 2025
8
8
 
9
9
  Disk cache implementation with pickle-based persistence.
@@ -2,7 +2,7 @@
2
2
  Company: eXonware.com
3
3
  Author: Eng. Muhammad AlShehri
4
4
  Email: connect@exonware.com
5
- Version: 0.0.1.406
5
+ Version: 0.0.1.408
6
6
  Generation Date: 01-Nov-2025
7
7
 
8
8
  Distributed cache implementations - Coming in v1.0.
@@ -2,7 +2,7 @@
2
2
  Company: eXonware.com
3
3
  Author: Eng. Muhammad AlShehri
4
4
  Email: connect@exonware.com
5
- Version: 0.0.1.406
5
+ Version: 0.0.1.408
6
6
  Generation Date: September 04, 2025
7
7
 
8
8
  Caching module errors - exception classes for caching functionality.
@@ -4,7 +4,7 @@
4
4
  Company: eXonware.com
5
5
  Author: Eng. Muhammad AlShehri
6
6
  Email: connect@exonware.com
7
- Version: 0.0.1.406
7
+ Version: 0.0.1.408
8
8
  Generation Date: 01-Nov-2025
9
9
 
10
10
  Event system for caching module.
@@ -4,7 +4,7 @@
4
4
  Company: eXonware.com
5
5
  Author: Eng. Muhammad AlShehri
6
6
  Email: connect@exonware.com
7
- Version: 0.0.1.406
7
+ Version: 0.0.1.408
8
8
  Generation Date: 01-Nov-2025
9
9
 
10
10
  Pluggable eviction strategies for caching module.
@@ -4,7 +4,7 @@
4
4
  Company: eXonware.com
5
5
  Author: Eng. Muhammad AlShehri
6
6
  Email: connect@exonware.com
7
- Version: 0.0.1.406
7
+ Version: 0.0.1.408
8
8
  Generation Date: 01-Nov-2025
9
9
 
10
10
  Fluent API wrappers for caching module.