exonware-xwsystem 0.0.1.409__py3-none-any.whl → 0.0.1.411__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.
- exonware/__init__.py +2 -2
- exonware/conf.py +10 -20
- exonware/xwsystem/__init__.py +6 -16
- exonware/xwsystem/caching/__init__.py +1 -1
- exonware/xwsystem/caching/base.py +16 -16
- exonware/xwsystem/caching/bloom_cache.py +5 -5
- exonware/xwsystem/caching/cache_manager.py +2 -2
- exonware/xwsystem/caching/conditional.py +4 -4
- exonware/xwsystem/caching/contracts.py +12 -12
- exonware/xwsystem/caching/decorators.py +2 -2
- exonware/xwsystem/caching/defs.py +1 -1
- exonware/xwsystem/caching/disk_cache.py +4 -4
- exonware/xwsystem/caching/distributed.py +1 -1
- exonware/xwsystem/caching/errors.py +1 -1
- exonware/xwsystem/caching/events.py +8 -8
- exonware/xwsystem/caching/eviction_strategies.py +9 -9
- exonware/xwsystem/caching/fluent.py +1 -1
- exonware/xwsystem/caching/integrity.py +1 -1
- exonware/xwsystem/caching/lfu_cache.py +24 -9
- exonware/xwsystem/caching/lfu_optimized.py +21 -21
- exonware/xwsystem/caching/lru_cache.py +14 -7
- exonware/xwsystem/caching/memory_bounded.py +8 -8
- exonware/xwsystem/caching/metrics_exporter.py +6 -6
- exonware/xwsystem/caching/observable_cache.py +1 -1
- exonware/xwsystem/caching/pluggable_cache.py +9 -9
- exonware/xwsystem/caching/rate_limiter.py +1 -1
- exonware/xwsystem/caching/read_through.py +6 -6
- exonware/xwsystem/caching/secure_cache.py +1 -1
- exonware/xwsystem/caching/serializable.py +3 -3
- exonware/xwsystem/caching/stats.py +7 -7
- exonware/xwsystem/caching/tagging.py +11 -11
- exonware/xwsystem/caching/ttl_cache.py +21 -6
- exonware/xwsystem/caching/two_tier_cache.py +5 -5
- exonware/xwsystem/caching/utils.py +3 -3
- exonware/xwsystem/caching/validation.py +1 -1
- exonware/xwsystem/caching/warming.py +9 -9
- exonware/xwsystem/caching/write_behind.py +5 -5
- exonware/xwsystem/cli/__init__.py +1 -1
- exonware/xwsystem/cli/args.py +10 -10
- exonware/xwsystem/cli/base.py +15 -15
- exonware/xwsystem/cli/colors.py +1 -1
- exonware/xwsystem/cli/console.py +1 -1
- exonware/xwsystem/cli/contracts.py +5 -5
- exonware/xwsystem/cli/defs.py +1 -1
- exonware/xwsystem/cli/errors.py +1 -1
- exonware/xwsystem/cli/progress.py +1 -1
- exonware/xwsystem/cli/prompts.py +1 -1
- exonware/xwsystem/cli/tables.py +7 -7
- exonware/xwsystem/config/__init__.py +1 -1
- exonware/xwsystem/config/base.py +14 -14
- exonware/xwsystem/config/contracts.py +22 -22
- exonware/xwsystem/config/defaults.py +2 -2
- exonware/xwsystem/config/defs.py +1 -1
- exonware/xwsystem/config/errors.py +2 -2
- exonware/xwsystem/config/logging.py +1 -1
- exonware/xwsystem/config/logging_setup.py +2 -2
- exonware/xwsystem/config/performance.py +7 -7
- exonware/xwsystem/config/performance_modes.py +20 -20
- exonware/xwsystem/config/version_manager.py +4 -4
- exonware/xwsystem/{http → http_client}/__init__.py +1 -1
- exonware/xwsystem/{http → http_client}/advanced_client.py +20 -20
- exonware/xwsystem/{http → http_client}/base.py +13 -13
- exonware/xwsystem/{http → http_client}/client.py +43 -43
- exonware/xwsystem/{http → http_client}/contracts.py +5 -5
- exonware/xwsystem/{http → http_client}/defs.py +2 -2
- exonware/xwsystem/{http → http_client}/errors.py +2 -2
- exonware/xwsystem/io/__init__.py +1 -1
- exonware/xwsystem/io/archive/__init__.py +1 -1
- exonware/xwsystem/io/archive/archive.py +5 -5
- exonware/xwsystem/io/archive/archive_files.py +8 -8
- exonware/xwsystem/io/archive/archivers.py +3 -3
- exonware/xwsystem/io/archive/base.py +17 -17
- exonware/xwsystem/io/archive/codec_integration.py +1 -1
- exonware/xwsystem/io/archive/compression.py +1 -1
- exonware/xwsystem/io/archive/formats/__init__.py +1 -1
- exonware/xwsystem/io/archive/formats/brotli_format.py +12 -9
- exonware/xwsystem/io/archive/formats/lz4_format.py +12 -9
- exonware/xwsystem/io/archive/formats/rar.py +12 -9
- exonware/xwsystem/io/archive/formats/sevenzip.py +12 -9
- exonware/xwsystem/io/archive/formats/squashfs_format.py +7 -7
- exonware/xwsystem/io/archive/formats/tar.py +8 -8
- exonware/xwsystem/io/archive/formats/wim_format.py +12 -9
- exonware/xwsystem/io/archive/formats/zip.py +8 -8
- exonware/xwsystem/io/archive/formats/zpaq_format.py +7 -7
- exonware/xwsystem/io/archive/formats/zstandard.py +12 -9
- exonware/xwsystem/io/base.py +17 -17
- exonware/xwsystem/io/codec/__init__.py +1 -1
- exonware/xwsystem/io/codec/base.py +261 -14
- exonware/xwsystem/io/codec/contracts.py +3 -6
- exonware/xwsystem/io/codec/registry.py +29 -29
- exonware/xwsystem/io/common/__init__.py +1 -1
- exonware/xwsystem/io/common/atomic.py +2 -2
- exonware/xwsystem/io/common/base.py +1 -1
- exonware/xwsystem/io/common/lock.py +1 -1
- exonware/xwsystem/io/common/watcher.py +4 -4
- exonware/xwsystem/io/contracts.py +34 -39
- exonware/xwsystem/io/data_operations.py +480 -0
- exonware/xwsystem/io/defs.py +2 -2
- exonware/xwsystem/io/errors.py +32 -3
- exonware/xwsystem/io/facade.py +4 -4
- exonware/xwsystem/io/file/__init__.py +1 -1
- exonware/xwsystem/io/file/base.py +2 -2
- exonware/xwsystem/io/file/conversion.py +1 -1
- exonware/xwsystem/io/file/file.py +10 -8
- exonware/xwsystem/io/file/paged_source.py +8 -1
- exonware/xwsystem/io/file/paging/__init__.py +1 -1
- exonware/xwsystem/io/file/paging/byte_paging.py +1 -1
- exonware/xwsystem/io/file/paging/line_paging.py +1 -1
- exonware/xwsystem/io/file/paging/record_paging.py +1 -1
- exonware/xwsystem/io/file/paging/registry.py +5 -5
- exonware/xwsystem/io/file/source.py +22 -11
- exonware/xwsystem/io/filesystem/__init__.py +1 -1
- exonware/xwsystem/io/filesystem/base.py +1 -1
- exonware/xwsystem/io/filesystem/local.py +9 -1
- exonware/xwsystem/io/folder/__init__.py +1 -1
- exonware/xwsystem/io/folder/base.py +2 -2
- exonware/xwsystem/io/folder/folder.py +6 -6
- exonware/xwsystem/io/serialization/__init__.py +1 -1
- exonware/xwsystem/io/serialization/auto_serializer.py +53 -40
- exonware/xwsystem/io/serialization/base.py +248 -35
- exonware/xwsystem/io/serialization/contracts.py +93 -4
- exonware/xwsystem/io/serialization/defs.py +1 -1
- exonware/xwsystem/io/serialization/errors.py +1 -1
- exonware/xwsystem/io/serialization/flyweight.py +22 -22
- exonware/xwsystem/io/serialization/format_detector.py +18 -15
- exonware/xwsystem/io/serialization/formats/__init__.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/bson.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/cbor.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/marshal.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/msgpack.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/pickle.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/plistlib.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/dbm.py +53 -1
- exonware/xwsystem/io/serialization/formats/database/shelve.py +48 -1
- exonware/xwsystem/io/serialization/formats/database/sqlite3.py +85 -1
- exonware/xwsystem/io/serialization/formats/text/configparser.py +2 -2
- exonware/xwsystem/io/serialization/formats/text/csv.py +2 -2
- exonware/xwsystem/io/serialization/formats/text/formdata.py +2 -2
- exonware/xwsystem/io/serialization/formats/text/json.py +23 -5
- exonware/xwsystem/io/serialization/formats/text/json5.py +98 -13
- exonware/xwsystem/io/serialization/formats/text/jsonlines.py +230 -20
- exonware/xwsystem/io/serialization/formats/text/multipart.py +2 -2
- exonware/xwsystem/io/serialization/formats/text/toml.py +65 -4
- exonware/xwsystem/io/serialization/formats/text/xml.py +451 -69
- exonware/xwsystem/io/serialization/formats/text/yaml.py +52 -2
- exonware/xwsystem/io/serialization/registry.py +5 -5
- exonware/xwsystem/io/serialization/serializer.py +184 -12
- exonware/xwsystem/io/serialization/utils/__init__.py +1 -1
- exonware/xwsystem/io/serialization/utils/path_ops.py +3 -3
- exonware/xwsystem/io/stream/__init__.py +1 -1
- exonware/xwsystem/io/stream/async_operations.py +3 -3
- exonware/xwsystem/io/stream/base.py +3 -7
- exonware/xwsystem/io/stream/codec_io.py +4 -7
- exonware/xwsystem/ipc/async_fabric.py +7 -8
- exonware/xwsystem/ipc/base.py +9 -9
- exonware/xwsystem/ipc/contracts.py +5 -5
- exonware/xwsystem/ipc/defs.py +1 -1
- exonware/xwsystem/ipc/errors.py +2 -2
- exonware/xwsystem/ipc/message_queue.py +4 -6
- exonware/xwsystem/ipc/pipes.py +2 -2
- exonware/xwsystem/ipc/process_manager.py +7 -7
- exonware/xwsystem/ipc/process_pool.py +8 -8
- exonware/xwsystem/ipc/shared_memory.py +7 -7
- exonware/xwsystem/monitoring/base.py +33 -33
- exonware/xwsystem/monitoring/contracts.py +27 -27
- exonware/xwsystem/monitoring/defs.py +1 -1
- exonware/xwsystem/monitoring/error_recovery.py +16 -16
- exonware/xwsystem/monitoring/errors.py +2 -2
- exonware/xwsystem/monitoring/memory_monitor.py +12 -12
- exonware/xwsystem/monitoring/metrics.py +8 -8
- exonware/xwsystem/monitoring/performance_manager_generic.py +20 -20
- exonware/xwsystem/monitoring/performance_monitor.py +11 -11
- exonware/xwsystem/monitoring/performance_validator.py +21 -21
- exonware/xwsystem/monitoring/system_monitor.py +17 -17
- exonware/xwsystem/monitoring/tracing.py +20 -20
- exonware/xwsystem/monitoring/tracker.py +7 -7
- exonware/xwsystem/operations/__init__.py +5 -5
- exonware/xwsystem/operations/base.py +3 -3
- exonware/xwsystem/operations/contracts.py +3 -3
- exonware/xwsystem/operations/defs.py +5 -5
- exonware/xwsystem/operations/diff.py +5 -5
- exonware/xwsystem/operations/merge.py +2 -2
- exonware/xwsystem/operations/patch.py +5 -5
- exonware/xwsystem/patterns/base.py +4 -4
- exonware/xwsystem/patterns/context_manager.py +7 -7
- exonware/xwsystem/patterns/contracts.py +29 -31
- exonware/xwsystem/patterns/defs.py +1 -1
- exonware/xwsystem/patterns/dynamic_facade.py +9 -9
- exonware/xwsystem/patterns/errors.py +10 -10
- exonware/xwsystem/patterns/handler_factory.py +15 -14
- exonware/xwsystem/patterns/import_registry.py +22 -22
- exonware/xwsystem/patterns/object_pool.py +14 -13
- exonware/xwsystem/patterns/registry.py +45 -32
- exonware/xwsystem/plugins/__init__.py +1 -1
- exonware/xwsystem/plugins/base.py +25 -25
- exonware/xwsystem/plugins/contracts.py +28 -28
- exonware/xwsystem/plugins/defs.py +1 -1
- exonware/xwsystem/plugins/errors.py +9 -9
- exonware/xwsystem/runtime/__init__.py +1 -1
- exonware/xwsystem/runtime/base.py +42 -42
- exonware/xwsystem/runtime/contracts.py +9 -9
- exonware/xwsystem/runtime/defs.py +1 -1
- exonware/xwsystem/runtime/env.py +9 -9
- exonware/xwsystem/runtime/errors.py +1 -1
- exonware/xwsystem/runtime/reflection.py +15 -15
- exonware/xwsystem/security/auth.py +47 -15
- exonware/xwsystem/security/base.py +17 -17
- exonware/xwsystem/security/contracts.py +30 -30
- exonware/xwsystem/security/crypto.py +8 -8
- exonware/xwsystem/security/defs.py +1 -1
- exonware/xwsystem/security/errors.py +2 -2
- exonware/xwsystem/security/hazmat.py +7 -7
- exonware/xwsystem/security/path_validator.py +1 -1
- exonware/xwsystem/shared/__init__.py +1 -1
- exonware/xwsystem/shared/base.py +14 -14
- exonware/xwsystem/shared/contracts.py +6 -6
- exonware/xwsystem/shared/defs.py +1 -1
- exonware/xwsystem/shared/errors.py +1 -1
- exonware/xwsystem/structures/__init__.py +1 -1
- exonware/xwsystem/structures/base.py +29 -29
- exonware/xwsystem/structures/circular_detector.py +15 -15
- exonware/xwsystem/structures/contracts.py +9 -9
- exonware/xwsystem/structures/defs.py +1 -1
- exonware/xwsystem/structures/errors.py +2 -2
- exonware/xwsystem/structures/tree_walker.py +8 -8
- exonware/xwsystem/threading/async_primitives.py +7 -7
- exonware/xwsystem/threading/base.py +19 -19
- exonware/xwsystem/threading/contracts.py +13 -13
- exonware/xwsystem/threading/defs.py +1 -1
- exonware/xwsystem/threading/errors.py +2 -2
- exonware/xwsystem/threading/safe_factory.py +13 -12
- exonware/xwsystem/utils/base.py +34 -34
- exonware/xwsystem/utils/contracts.py +9 -9
- exonware/xwsystem/utils/dt/__init__.py +1 -1
- exonware/xwsystem/utils/dt/base.py +6 -6
- exonware/xwsystem/utils/dt/contracts.py +2 -2
- exonware/xwsystem/utils/dt/defs.py +1 -1
- exonware/xwsystem/utils/dt/errors.py +2 -2
- exonware/xwsystem/utils/dt/formatting.py +3 -3
- exonware/xwsystem/utils/dt/humanize.py +2 -2
- exonware/xwsystem/utils/dt/parsing.py +2 -2
- exonware/xwsystem/utils/dt/timezone_utils.py +5 -5
- exonware/xwsystem/utils/errors.py +2 -2
- exonware/xwsystem/utils/test_runner.py +6 -6
- exonware/xwsystem/utils/utils_contracts.py +1 -1
- exonware/xwsystem/validation/__init__.py +1 -1
- exonware/xwsystem/validation/base.py +48 -48
- exonware/xwsystem/validation/contracts.py +8 -8
- exonware/xwsystem/validation/data_validator.py +10 -0
- exonware/xwsystem/validation/declarative.py +15 -15
- exonware/xwsystem/validation/defs.py +1 -1
- exonware/xwsystem/validation/errors.py +2 -2
- exonware/xwsystem/validation/fluent_validator.py +10 -10
- exonware/xwsystem/version.py +2 -2
- {exonware_xwsystem-0.0.1.409.dist-info → exonware_xwsystem-0.0.1.411.dist-info}/METADATA +9 -11
- exonware_xwsystem-0.0.1.411.dist-info/RECORD +274 -0
- {exonware_xwsystem-0.0.1.409.dist-info → exonware_xwsystem-0.0.1.411.dist-info}/WHEEL +1 -1
- exonware/xwsystem/lazy_bootstrap.py +0 -79
- exonware_xwsystem-0.0.1.409.dist-info/RECORD +0 -274
- {exonware_xwsystem-0.0.1.409.dist-info → exonware_xwsystem-0.0.1.411.dist-info}/licenses/LICENSE +0 -0
exonware/xwsystem/cli/tables.py
CHANGED
|
@@ -7,12 +7,12 @@ Production-grade table formatting for XWSystem.
|
|
|
7
7
|
Company: eXonware.com
|
|
8
8
|
Author: Eng. Muhammad AlShehri
|
|
9
9
|
Email: connect@exonware.com
|
|
10
|
-
Version: 0.0.1.
|
|
10
|
+
Version: 0.0.1.411
|
|
11
11
|
Generation Date: September 05, 2025
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
import sys
|
|
15
|
-
from typing import
|
|
15
|
+
from typing import Any, Optional, Union, TextIO, Callable
|
|
16
16
|
from dataclasses import dataclass
|
|
17
17
|
# Import colors from our existing color module
|
|
18
18
|
# Explicit import - colors module is part of the same package
|
|
@@ -116,7 +116,7 @@ class TableFormatter:
|
|
|
116
116
|
|
|
117
117
|
return text
|
|
118
118
|
|
|
119
|
-
def calculate_widths(self, columns:
|
|
119
|
+
def calculate_widths(self, columns: list[Column], data: list[list[Any]]) -> list[int]:
|
|
120
120
|
"""Calculate optimal column widths."""
|
|
121
121
|
widths = []
|
|
122
122
|
|
|
@@ -150,7 +150,7 @@ class Table:
|
|
|
150
150
|
"""
|
|
151
151
|
|
|
152
152
|
def __init__(self,
|
|
153
|
-
columns:
|
|
153
|
+
columns: list[Union[str, Column]] = None,
|
|
154
154
|
formatter: TableFormatter = None,
|
|
155
155
|
title: str = ""):
|
|
156
156
|
"""Initialize table."""
|
|
@@ -182,7 +182,7 @@ class Table:
|
|
|
182
182
|
self.rows.append(list(values))
|
|
183
183
|
return self
|
|
184
184
|
|
|
185
|
-
def add_rows(self, rows:
|
|
185
|
+
def add_rows(self, rows: list[list[Any]]) -> 'Table':
|
|
186
186
|
"""Add multiple rows to the table."""
|
|
187
187
|
self.rows.extend(rows)
|
|
188
188
|
return self
|
|
@@ -236,14 +236,14 @@ class Table:
|
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
# Utility functions
|
|
239
|
-
def create_simple_table(headers:
|
|
239
|
+
def create_simple_table(headers: list[str], rows: list[list[Any]]) -> Table:
|
|
240
240
|
"""Create a simple table with basic formatting."""
|
|
241
241
|
table = Table(headers)
|
|
242
242
|
table.add_rows(rows)
|
|
243
243
|
return table
|
|
244
244
|
|
|
245
245
|
|
|
246
|
-
def print_key_value_table(data:
|
|
246
|
+
def print_key_value_table(data: dict[str, Any], title: str = ""):
|
|
247
247
|
"""Print a key-value table."""
|
|
248
248
|
table = Table([
|
|
249
249
|
Column("Property", header_color=Colors.BLUE, header_style=Style.BOLD),
|
exonware/xwsystem/config/base.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#exonware/
|
|
1
|
+
#exonware/xwsystem/config/base.py
|
|
2
2
|
"""
|
|
3
3
|
Company: eXonware.com
|
|
4
4
|
Author: Eng. Muhammad AlShehri
|
|
5
5
|
Email: connect@exonware.com
|
|
6
|
-
Version: 0.0.1.
|
|
6
|
+
Version: 0.0.1.411
|
|
7
7
|
Generation Date: September 04, 2025
|
|
8
8
|
|
|
9
9
|
Config module base classes - abstract classes for configuration functionality.
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
from abc import ABC, abstractmethod
|
|
13
|
-
from typing import Any,
|
|
13
|
+
from typing import Any, Optional, Union
|
|
14
14
|
from .contracts import ConfigType, LogLevel, PerformanceMode
|
|
15
15
|
|
|
16
16
|
|
|
@@ -25,11 +25,11 @@ class AConfigBase(ABC):
|
|
|
25
25
|
config_type: Configuration type
|
|
26
26
|
"""
|
|
27
27
|
self.config_type = config_type
|
|
28
|
-
self._config:
|
|
29
|
-
self._defaults:
|
|
28
|
+
self._config: dict[str, Any] = {}
|
|
29
|
+
self._defaults: dict[str, Any] = {}
|
|
30
30
|
|
|
31
31
|
@abstractmethod
|
|
32
|
-
def load(self, source: Union[str,
|
|
32
|
+
def load(self, source: Union[str, dict[str, Any]]) -> None:
|
|
33
33
|
"""Load configuration from source."""
|
|
34
34
|
pass
|
|
35
35
|
|
|
@@ -59,17 +59,17 @@ class AConfigBase(ABC):
|
|
|
59
59
|
pass
|
|
60
60
|
|
|
61
61
|
@abstractmethod
|
|
62
|
-
def keys(self) ->
|
|
62
|
+
def keys(self) -> list[str]:
|
|
63
63
|
"""Get all configuration keys."""
|
|
64
64
|
pass
|
|
65
65
|
|
|
66
66
|
@abstractmethod
|
|
67
|
-
def values(self) ->
|
|
67
|
+
def values(self) -> list[Any]:
|
|
68
68
|
"""Get all configuration values."""
|
|
69
69
|
pass
|
|
70
70
|
|
|
71
71
|
@abstractmethod
|
|
72
|
-
def items(self) ->
|
|
72
|
+
def items(self) -> list[tuple[str, Any]]:
|
|
73
73
|
"""Get all configuration items."""
|
|
74
74
|
pass
|
|
75
75
|
|
|
@@ -129,7 +129,7 @@ class APerformanceConfigBase(ABC):
|
|
|
129
129
|
mode: Performance mode
|
|
130
130
|
"""
|
|
131
131
|
self.mode = mode
|
|
132
|
-
self._settings:
|
|
132
|
+
self._settings: dict[str, Any] = {}
|
|
133
133
|
|
|
134
134
|
@abstractmethod
|
|
135
135
|
def set_mode(self, mode: PerformanceMode) -> None:
|
|
@@ -152,7 +152,7 @@ class APerformanceConfigBase(ABC):
|
|
|
152
152
|
pass
|
|
153
153
|
|
|
154
154
|
@abstractmethod
|
|
155
|
-
def get_benchmark_config(self) ->
|
|
155
|
+
def get_benchmark_config(self) -> dict[str, Any]:
|
|
156
156
|
"""Get benchmark configuration."""
|
|
157
157
|
pass
|
|
158
158
|
|
|
@@ -166,7 +166,7 @@ class AConfigValidatorBase(ABC):
|
|
|
166
166
|
"""Abstract base class for configuration validation."""
|
|
167
167
|
|
|
168
168
|
@abstractmethod
|
|
169
|
-
def validate_config(self, config:
|
|
169
|
+
def validate_config(self, config: dict[str, Any]) -> bool:
|
|
170
170
|
"""Validate configuration dictionary."""
|
|
171
171
|
pass
|
|
172
172
|
|
|
@@ -176,7 +176,7 @@ class AConfigValidatorBase(ABC):
|
|
|
176
176
|
pass
|
|
177
177
|
|
|
178
178
|
@abstractmethod
|
|
179
|
-
def get_validation_errors(self) ->
|
|
179
|
+
def get_validation_errors(self) -> list[str]:
|
|
180
180
|
"""Get validation errors."""
|
|
181
181
|
pass
|
|
182
182
|
|
|
@@ -215,7 +215,7 @@ class AConfigManagerBase(ABC):
|
|
|
215
215
|
pass
|
|
216
216
|
|
|
217
217
|
@abstractmethod
|
|
218
|
-
def list_configs(self) ->
|
|
218
|
+
def list_configs(self) -> list[str]:
|
|
219
219
|
"""List all configuration names."""
|
|
220
220
|
pass
|
|
221
221
|
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Company: eXonware.com
|
|
4
4
|
Author: Eng. Muhammad AlShehri
|
|
5
5
|
Email: connect@exonware.com
|
|
6
|
-
Version: 0.0.1.
|
|
6
|
+
Version: 0.0.1.411
|
|
7
7
|
Generation Date: September 04, 2025
|
|
8
8
|
|
|
9
9
|
Configuration protocol interfaces for XWSystem.
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
from abc import ABC, abstractmethod
|
|
13
|
-
from typing import Any,
|
|
13
|
+
from typing import Any, Optional, Union, Iterator, Callable, Protocol
|
|
14
14
|
from typing_extensions import runtime_checkable
|
|
15
15
|
from pathlib import Path
|
|
16
16
|
import os
|
|
@@ -50,7 +50,7 @@ class IConfigurable(ABC):
|
|
|
50
50
|
pass
|
|
51
51
|
|
|
52
52
|
@abstractmethod
|
|
53
|
-
def get_config(self) ->
|
|
53
|
+
def get_config(self) -> dict[str, Any]:
|
|
54
54
|
"""
|
|
55
55
|
Get current configuration.
|
|
56
56
|
|
|
@@ -104,7 +104,7 @@ class IConfigurable(ABC):
|
|
|
104
104
|
pass
|
|
105
105
|
|
|
106
106
|
@abstractmethod
|
|
107
|
-
def merge_config(self, config:
|
|
107
|
+
def merge_config(self, config: dict[str, Any], priority: ConfigPriority = ConfigPriority.NORMAL) -> None:
|
|
108
108
|
"""
|
|
109
109
|
Merge configuration with existing.
|
|
110
110
|
|
|
@@ -178,7 +178,7 @@ class ISettings(ABC):
|
|
|
178
178
|
pass
|
|
179
179
|
|
|
180
180
|
@abstractmethod
|
|
181
|
-
def get_all_settings(self) ->
|
|
181
|
+
def get_all_settings(self) -> dict[str, Any]:
|
|
182
182
|
"""
|
|
183
183
|
Get all settings.
|
|
184
184
|
|
|
@@ -195,7 +195,7 @@ class ISettings(ABC):
|
|
|
195
195
|
pass
|
|
196
196
|
|
|
197
197
|
@abstractmethod
|
|
198
|
-
def load_settings(self, source: Union[str, Path,
|
|
198
|
+
def load_settings(self, source: Union[str, Path, dict[str, Any]]) -> None:
|
|
199
199
|
"""
|
|
200
200
|
Load settings from source.
|
|
201
201
|
|
|
@@ -304,7 +304,7 @@ class IEnvironment(ABC):
|
|
|
304
304
|
pass
|
|
305
305
|
|
|
306
306
|
@abstractmethod
|
|
307
|
-
def get_all_env(self) ->
|
|
307
|
+
def get_all_env(self) -> dict[str, str]:
|
|
308
308
|
"""
|
|
309
309
|
Get all environment variables.
|
|
310
310
|
|
|
@@ -333,7 +333,7 @@ class IConfigValidator(ABC):
|
|
|
333
333
|
"""
|
|
334
334
|
|
|
335
335
|
@abstractmethod
|
|
336
|
-
def validate_config(self, config:
|
|
336
|
+
def validate_config(self, config: dict[str, Any]) -> bool:
|
|
337
337
|
"""
|
|
338
338
|
Validate configuration.
|
|
339
339
|
|
|
@@ -346,7 +346,7 @@ class IConfigValidator(ABC):
|
|
|
346
346
|
pass
|
|
347
347
|
|
|
348
348
|
@abstractmethod
|
|
349
|
-
def get_validation_errors(self, config:
|
|
349
|
+
def get_validation_errors(self, config: dict[str, Any]) -> list[str]:
|
|
350
350
|
"""
|
|
351
351
|
Get configuration validation errors.
|
|
352
352
|
|
|
@@ -416,7 +416,7 @@ class IConfigSource(ABC):
|
|
|
416
416
|
"""
|
|
417
417
|
|
|
418
418
|
@abstractmethod
|
|
419
|
-
def load_config(self) ->
|
|
419
|
+
def load_config(self) -> dict[str, Any]:
|
|
420
420
|
"""
|
|
421
421
|
Load configuration from source.
|
|
422
422
|
|
|
@@ -426,7 +426,7 @@ class IConfigSource(ABC):
|
|
|
426
426
|
pass
|
|
427
427
|
|
|
428
428
|
@abstractmethod
|
|
429
|
-
def save_config(self, config:
|
|
429
|
+
def save_config(self, config: dict[str, Any]) -> bool:
|
|
430
430
|
"""
|
|
431
431
|
Save configuration to source.
|
|
432
432
|
|
|
@@ -449,7 +449,7 @@ class IConfigSource(ABC):
|
|
|
449
449
|
pass
|
|
450
450
|
|
|
451
451
|
@abstractmethod
|
|
452
|
-
def get_source_info(self) ->
|
|
452
|
+
def get_source_info(self) -> dict[str, Any]:
|
|
453
453
|
"""
|
|
454
454
|
Get source information.
|
|
455
455
|
|
|
@@ -514,7 +514,7 @@ class IConfigManager(ABC):
|
|
|
514
514
|
pass
|
|
515
515
|
|
|
516
516
|
@abstractmethod
|
|
517
|
-
def load_all_configs(self) ->
|
|
517
|
+
def load_all_configs(self) -> dict[str, Any]:
|
|
518
518
|
"""
|
|
519
519
|
Load configuration from all sources.
|
|
520
520
|
|
|
@@ -524,7 +524,7 @@ class IConfigManager(ABC):
|
|
|
524
524
|
pass
|
|
525
525
|
|
|
526
526
|
@abstractmethod
|
|
527
|
-
def save_all_configs(self, config:
|
|
527
|
+
def save_all_configs(self, config: dict[str, Any]) -> bool:
|
|
528
528
|
"""
|
|
529
529
|
Save configuration to all sources.
|
|
530
530
|
|
|
@@ -569,7 +569,7 @@ class IConfigManager(ABC):
|
|
|
569
569
|
pass
|
|
570
570
|
|
|
571
571
|
@abstractmethod
|
|
572
|
-
def get_sources(self) ->
|
|
572
|
+
def get_sources(self) -> list[IConfigSource]:
|
|
573
573
|
"""
|
|
574
574
|
Get all configuration sources.
|
|
575
575
|
|
|
@@ -638,7 +638,7 @@ class IConfigWatcher(ABC):
|
|
|
638
638
|
pass
|
|
639
639
|
|
|
640
640
|
@abstractmethod
|
|
641
|
-
def get_watched_keys(self) ->
|
|
641
|
+
def get_watched_keys(self) -> list[str]:
|
|
642
642
|
"""
|
|
643
643
|
Get list of watched configuration keys.
|
|
644
644
|
|
|
@@ -680,7 +680,7 @@ class IConfigTemplate(ABC):
|
|
|
680
680
|
"""
|
|
681
681
|
|
|
682
682
|
@abstractmethod
|
|
683
|
-
def create_template(self, config:
|
|
683
|
+
def create_template(self, config: dict[str, Any]) -> str:
|
|
684
684
|
"""
|
|
685
685
|
Create configuration template.
|
|
686
686
|
|
|
@@ -693,7 +693,7 @@ class IConfigTemplate(ABC):
|
|
|
693
693
|
pass
|
|
694
694
|
|
|
695
695
|
@abstractmethod
|
|
696
|
-
def apply_template(self, template: str, values:
|
|
696
|
+
def apply_template(self, template: str, values: dict[str, Any]) -> dict[str, Any]:
|
|
697
697
|
"""
|
|
698
698
|
Apply template with values.
|
|
699
699
|
|
|
@@ -720,7 +720,7 @@ class IConfigTemplate(ABC):
|
|
|
720
720
|
pass
|
|
721
721
|
|
|
722
722
|
@abstractmethod
|
|
723
|
-
def get_template_variables(self, template: str) ->
|
|
723
|
+
def get_template_variables(self, template: str) -> list[str]:
|
|
724
724
|
"""
|
|
725
725
|
Get template variables.
|
|
726
726
|
|
|
@@ -831,7 +831,7 @@ class IConfigSecrets(ABC):
|
|
|
831
831
|
pass
|
|
832
832
|
|
|
833
833
|
@abstractmethod
|
|
834
|
-
def get_secret_keys(self) ->
|
|
834
|
+
def get_secret_keys(self) -> list[str]:
|
|
835
835
|
"""
|
|
836
836
|
Get list of secret configuration keys.
|
|
837
837
|
|
|
@@ -841,7 +841,7 @@ class IConfigSecrets(ABC):
|
|
|
841
841
|
pass
|
|
842
842
|
|
|
843
843
|
@abstractmethod
|
|
844
|
-
def sanitize_config(self, config:
|
|
844
|
+
def sanitize_config(self, config: dict[str, Any]) -> dict[str, Any]:
|
|
845
845
|
"""
|
|
846
846
|
Sanitize configuration by hiding secrets.
|
|
847
847
|
|
|
@@ -866,7 +866,7 @@ class Configurable(Protocol):
|
|
|
866
866
|
"""Configure object with parameters."""
|
|
867
867
|
...
|
|
868
868
|
|
|
869
|
-
def get_config(self) ->
|
|
869
|
+
def get_config(self) -> dict[str, Any]:
|
|
870
870
|
"""Get current configuration."""
|
|
871
871
|
...
|
|
872
872
|
|
|
@@ -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.
|
|
5
|
+
Version: 0.0.1.411
|
|
6
6
|
Generation Date: September 04, 2025
|
|
7
7
|
|
|
8
8
|
Default configuration constants for XSystem framework.
|
|
@@ -11,7 +11,7 @@ These constants provide default values and limits for system operations.
|
|
|
11
11
|
All modules should import from this central location to ensure consistency.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
from typing import Final,
|
|
14
|
+
from typing import Final, Any, Optional
|
|
15
15
|
from .base import AConfigBase
|
|
16
16
|
from .contracts import ConfigType
|
|
17
17
|
|
exonware/xwsystem/config/defs.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#exonware/
|
|
1
|
+
#exonware/xwsystem/config/errors.py
|
|
2
2
|
"""
|
|
3
3
|
Company: eXonware.com
|
|
4
4
|
Author: Eng. Muhammad AlShehri
|
|
5
5
|
Email: connect@exonware.com
|
|
6
|
-
Version: 0.0.1.
|
|
6
|
+
Version: 0.0.1.411
|
|
7
7
|
Generation Date: September 04, 2025
|
|
8
8
|
|
|
9
9
|
Configuration module errors - exception classes for configuration functionality.
|
|
@@ -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.
|
|
5
|
+
Version: 0.0.1.411
|
|
6
6
|
Generation Date: September 05, 2025
|
|
7
7
|
|
|
8
8
|
Logging configuration setup for XSystem.
|
|
@@ -19,7 +19,7 @@ from .defaults import LOGGING_ENABLED, LOGGING_LEVEL
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def setup_logging(
|
|
22
|
-
log_file="logs/
|
|
22
|
+
log_file="logs/xwsystem.log",
|
|
23
23
|
level=logging.INFO,
|
|
24
24
|
max_bytes=10 * 1024 * 1024,
|
|
25
25
|
backup_count=5,
|
|
@@ -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.
|
|
5
|
+
Version: 0.0.1.411
|
|
6
6
|
Generation Date: September 04, 2025
|
|
7
7
|
|
|
8
8
|
Performance Configuration Management
|
|
@@ -10,7 +10,7 @@ Performance Configuration Management
|
|
|
10
10
|
Centralized configuration for XSystem performance limits, timeouts, and optimization settings.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
from typing import Any,
|
|
13
|
+
from typing import Any, Final, Optional
|
|
14
14
|
from dataclasses import dataclass, field
|
|
15
15
|
import os
|
|
16
16
|
from pathlib import Path
|
|
@@ -214,7 +214,7 @@ class PerformanceConfig:
|
|
|
214
214
|
except Exception as e:
|
|
215
215
|
logger.error(f"Failed to load configuration file {config_file}: {e}")
|
|
216
216
|
|
|
217
|
-
def _apply_config_data(self, config_data:
|
|
217
|
+
def _apply_config_data(self, config_data: dict[str, Any]) -> None:
|
|
218
218
|
"""Apply configuration data to limits."""
|
|
219
219
|
|
|
220
220
|
if 'serialization' in config_data:
|
|
@@ -245,7 +245,7 @@ class PerformanceConfig:
|
|
|
245
245
|
"""Get current performance limits."""
|
|
246
246
|
return self._limits
|
|
247
247
|
|
|
248
|
-
def get_serialization_config(self) ->
|
|
248
|
+
def get_serialization_config(self) -> dict[str, Any]:
|
|
249
249
|
"""Get serialization configuration dictionary."""
|
|
250
250
|
return {
|
|
251
251
|
'max_size_mb': self._limits.serialization.max_size_mb,
|
|
@@ -256,7 +256,7 @@ class PerformanceConfig:
|
|
|
256
256
|
'validate_paths': self._limits.serialization.validate_paths,
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
def get_network_config(self) ->
|
|
259
|
+
def get_network_config(self) -> dict[str, Any]:
|
|
260
260
|
"""Get network configuration dictionary."""
|
|
261
261
|
return {
|
|
262
262
|
'connect_timeout': self._limits.network.connect_timeout,
|
|
@@ -266,7 +266,7 @@ class PerformanceConfig:
|
|
|
266
266
|
'max_response_size_mb': self._limits.network.max_response_size_mb,
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
def get_security_config(self) ->
|
|
269
|
+
def get_security_config(self) -> dict[str, Any]:
|
|
270
270
|
"""Get security configuration dictionary."""
|
|
271
271
|
return {
|
|
272
272
|
'allow_absolute_paths': self._limits.security.allow_absolute_paths,
|
|
@@ -323,7 +323,7 @@ class PerformanceConfig:
|
|
|
323
323
|
|
|
324
324
|
logger.info(f"Performance optimized for mode: {self._mode}")
|
|
325
325
|
|
|
326
|
-
def export_config(self, format: str = 'json') ->
|
|
326
|
+
def export_config(self, format: str = 'json') -> dict[str, Any]:
|
|
327
327
|
"""
|
|
328
328
|
Export current configuration.
|
|
329
329
|
|
|
@@ -10,7 +10,7 @@ import statistics
|
|
|
10
10
|
import threading
|
|
11
11
|
import time
|
|
12
12
|
from dataclasses import dataclass, field
|
|
13
|
-
from typing import Any,
|
|
13
|
+
from typing import Any, Optional, Union
|
|
14
14
|
from .defs import AdvancedPerformanceMode
|
|
15
15
|
|
|
16
16
|
import psutil
|
|
@@ -59,7 +59,7 @@ class PerformanceProfile:
|
|
|
59
59
|
max_nodes: int
|
|
60
60
|
max_path_length: int
|
|
61
61
|
|
|
62
|
-
def to_dict(self) ->
|
|
62
|
+
def to_dict(self) -> dict[str, Any]:
|
|
63
63
|
"""Convert profile to dictionary."""
|
|
64
64
|
return {
|
|
65
65
|
"path_cache_size": self.path_cache_size,
|
|
@@ -80,7 +80,7 @@ class PerformanceProfile:
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
@classmethod
|
|
83
|
-
def from_dict(cls, data:
|
|
83
|
+
def from_dict(cls, data: dict[str, Any]) -> "PerformanceProfile":
|
|
84
84
|
"""Create profile from dictionary."""
|
|
85
85
|
return cls(**data)
|
|
86
86
|
|
|
@@ -105,8 +105,8 @@ class AdaptiveProfile(PerformanceProfile):
|
|
|
105
105
|
cooldown_period: float = 5.0 # Seconds between adaptations
|
|
106
106
|
|
|
107
107
|
# Performance tracking
|
|
108
|
-
operation_history:
|
|
109
|
-
mode_performance:
|
|
108
|
+
operation_history: list[dict[str, Any]] = field(default_factory=list)
|
|
109
|
+
mode_performance: dict[str, list[float]] = field(default_factory=dict)
|
|
110
110
|
last_adaptation: float = field(default_factory=time.time)
|
|
111
111
|
|
|
112
112
|
|
|
@@ -138,8 +138,8 @@ class DualAdaptiveProfile(PerformanceProfile):
|
|
|
138
138
|
cooldown_period: float = 10.0 # 10 seconds between adaptations
|
|
139
139
|
|
|
140
140
|
# Performance tracking
|
|
141
|
-
operation_history:
|
|
142
|
-
mode_performance:
|
|
141
|
+
operation_history: list[dict[str, Any]] = field(default_factory=list)
|
|
142
|
+
mode_performance: dict[str, list[float]] = field(default_factory=dict)
|
|
143
143
|
last_adaptation: float = field(default_factory=time.time)
|
|
144
144
|
|
|
145
145
|
# Phase tracking
|
|
@@ -183,9 +183,9 @@ class AdaptiveLearningEngine:
|
|
|
183
183
|
|
|
184
184
|
def __init__(self, profile: AdaptiveProfile):
|
|
185
185
|
self.profile = profile
|
|
186
|
-
self.metrics_history:
|
|
186
|
+
self.metrics_history: list[PerformanceMetrics] = []
|
|
187
187
|
# Initialize mode performance tracking without causing recursion
|
|
188
|
-
self.mode_performance:
|
|
188
|
+
self.mode_performance: dict[str, list[float]] = {
|
|
189
189
|
"AUTO": [],
|
|
190
190
|
"DEFAULT": [],
|
|
191
191
|
"FAST": [],
|
|
@@ -195,7 +195,7 @@ class AdaptiveLearningEngine:
|
|
|
195
195
|
"ADAPTIVE": [],
|
|
196
196
|
"DUAL_ADAPTIVE": [],
|
|
197
197
|
}
|
|
198
|
-
self.system_metrics:
|
|
198
|
+
self.system_metrics: list[dict[str, float]] = []
|
|
199
199
|
self._lock = threading.RLock()
|
|
200
200
|
self._last_system_check = 0.0
|
|
201
201
|
|
|
@@ -218,7 +218,7 @@ class AdaptiveLearningEngine:
|
|
|
218
218
|
if len(self.mode_performance[metrics.mode_used.name]) > 100:
|
|
219
219
|
self.mode_performance[metrics.mode_used.name].pop(0)
|
|
220
220
|
|
|
221
|
-
def get_system_metrics(self) ->
|
|
221
|
+
def get_system_metrics(self) -> dict[str, float]:
|
|
222
222
|
"""Get current system metrics."""
|
|
223
223
|
current_time = time.time()
|
|
224
224
|
|
|
@@ -400,7 +400,7 @@ class AdaptiveLearningEngine:
|
|
|
400
400
|
60, self.profile.lazy_threshold_list * 2
|
|
401
401
|
)
|
|
402
402
|
|
|
403
|
-
def get_adaptive_stats(self) ->
|
|
403
|
+
def get_adaptive_stats(self) -> dict[str, Any]:
|
|
404
404
|
"""Get detailed adaptive learning statistics."""
|
|
405
405
|
return {
|
|
406
406
|
"metrics_count": len(self.metrics_history),
|
|
@@ -422,14 +422,14 @@ class DualPhaseAdaptiveEngine:
|
|
|
422
422
|
|
|
423
423
|
def __init__(self, profile: DualAdaptiveProfile):
|
|
424
424
|
self.profile = profile
|
|
425
|
-
self.metrics_history:
|
|
426
|
-
self.system_metrics:
|
|
425
|
+
self.metrics_history: list[PerformanceMetrics] = []
|
|
426
|
+
self.system_metrics: list[dict[str, float]] = []
|
|
427
427
|
self._lock = threading.RLock()
|
|
428
428
|
self._last_system_check = 0.0
|
|
429
429
|
self._operation_counter = 0
|
|
430
430
|
|
|
431
431
|
# Initialize mode performance tracking
|
|
432
|
-
self.mode_performance:
|
|
432
|
+
self.mode_performance: dict[str, list[float]] = {
|
|
433
433
|
"AUTO": [],
|
|
434
434
|
"DEFAULT": [],
|
|
435
435
|
"FAST": [],
|
|
@@ -631,7 +631,7 @@ class DualPhaseAdaptiveEngine:
|
|
|
631
631
|
1024, self.profile.conversion_cache_size * 2
|
|
632
632
|
)
|
|
633
633
|
|
|
634
|
-
def get_system_metrics(self) ->
|
|
634
|
+
def get_system_metrics(self) -> dict[str, float]:
|
|
635
635
|
"""Get current system metrics (cached for efficiency)."""
|
|
636
636
|
current_time = time.time()
|
|
637
637
|
|
|
@@ -673,7 +673,7 @@ class DualPhaseAdaptiveEngine:
|
|
|
673
673
|
"timestamp": current_time,
|
|
674
674
|
}
|
|
675
675
|
|
|
676
|
-
def get_adaptive_stats(self) ->
|
|
676
|
+
def get_adaptive_stats(self) -> dict[str, Any]:
|
|
677
677
|
"""Get detailed adaptive learning statistics."""
|
|
678
678
|
return {
|
|
679
679
|
"current_phase": self.profile.current_phase,
|
|
@@ -885,7 +885,7 @@ class PerformanceModeManager:
|
|
|
885
885
|
def __init__(self, default_mode: PerformanceMode = PerformanceMode.DEFAULT):
|
|
886
886
|
self._mode = default_mode
|
|
887
887
|
self._parent_mode: Optional[PerformanceMode] = None
|
|
888
|
-
self._manual_overrides:
|
|
888
|
+
self._manual_overrides: dict[str, Any] = {}
|
|
889
889
|
self._adaptive_engine: Optional[AdaptiveLearningEngine] = None
|
|
890
890
|
self._dual_adaptive_engine: Optional[DualPhaseAdaptiveEngine] = None
|
|
891
891
|
self._lock = threading.RLock()
|
|
@@ -985,9 +985,9 @@ class PerformanceModeManager:
|
|
|
985
985
|
)
|
|
986
986
|
self._dual_adaptive_engine.record_operation(metrics)
|
|
987
987
|
|
|
988
|
-
def get_adaptive_stats(self) ->
|
|
988
|
+
def get_adaptive_stats(self) -> dict[str, Any]:
|
|
989
989
|
"""Get adaptive learning statistics."""
|
|
990
|
-
stats:
|
|
990
|
+
stats: dict[str, Any] = {}
|
|
991
991
|
|
|
992
992
|
if self._adaptive_engine:
|
|
993
993
|
stats.update(self._adaptive_engine.get_adaptive_stats())
|
|
@@ -10,7 +10,7 @@ This module provides a centralized VersionManager class that can be used
|
|
|
10
10
|
across all eXonware projects to maintain consistent version management.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
from typing import
|
|
13
|
+
from typing import Any, Optional
|
|
14
14
|
import re
|
|
15
15
|
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@ class VersionManager:
|
|
|
35
35
|
self._version_components = self._parse_version(version)
|
|
36
36
|
self._suffix = ""
|
|
37
37
|
|
|
38
|
-
def _parse_version(self, version: str) ->
|
|
38
|
+
def _parse_version(self, version: str) -> tuple[int, int, int, Optional[str]]:
|
|
39
39
|
"""Parse version string into components."""
|
|
40
40
|
parts = version.split('.')
|
|
41
41
|
|
|
@@ -86,11 +86,11 @@ class VersionManager:
|
|
|
86
86
|
"""Set the version suffix."""
|
|
87
87
|
self._suffix = value
|
|
88
88
|
|
|
89
|
-
def get_version_info(self) ->
|
|
89
|
+
def get_version_info(self) -> tuple[int, int, int, Optional[str]]:
|
|
90
90
|
"""Get version as a tuple (major, minor, patch, build)."""
|
|
91
91
|
return self._version_components
|
|
92
92
|
|
|
93
|
-
def get_version_dict(self) ->
|
|
93
|
+
def get_version_dict(self) -> dict[str, Any]:
|
|
94
94
|
"""Get version information as a dictionary."""
|
|
95
95
|
return {
|
|
96
96
|
"version": self.version_string,
|