codecraftai-foundations 1.2.0__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.
- ccai/aspects/__init__.py +0 -0
- ccai/aspects/aspects.py +62 -0
- ccai/aspects/py.typed +0 -0
- ccai/bases/__init__.py +0 -0
- ccai/bases/freezable.py +34 -0
- ccai/bases/py.typed +0 -0
- ccai/errors/__init__.py +11 -0
- ccai/errors/exceptions.py +672 -0
- ccai/errors/py.typed +0 -0
- ccai/errors/raising.py +130 -0
- ccai/errors/xtraceback.py +562 -0
- ccai/interfaces/__init__.py +0 -0
- ccai/interfaces/addressplane.py +199 -0
- ccai/interfaces/cloudacceleratorspec.py +77 -0
- ccai/interfaces/cloudsharedfilesystem.py +124 -0
- ccai/interfaces/ibasiccredential.py +37 -0
- ccai/interfaces/icommandrunner.py +56 -0
- ccai/interfaces/iexcludefilter.py +50 -0
- ccai/interfaces/ifileoperator.py +28 -0
- ccai/interfaces/ihint.py +29 -0
- ccai/interfaces/iincludefilter.py +50 -0
- ccai/interfaces/iserializable.py +41 -0
- ccai/interfaces/itaskhandle.py +129 -0
- ccai/interfaces/itestjob.py +65 -0
- ccai/interfaces/ivpnclient.py +136 -0
- ccai/interfaces/ivpncontrolplane.py +133 -0
- ccai/interfaces/py.typed +0 -0
- ccai/interfaces/pythonenvspec.py +316 -0
- ccai/interfaces/schemafield.py +88 -0
- ccai/interfaces/schemaobject.py +150 -0
- ccai/interfaces/schemasemanticerror.py +29 -0
- ccai/interfaces/schemavalidationerror.py +22 -0
- ccai/interfaces/schemavalidators.py +289 -0
- ccai/interfaces/sharedfsmountspec.py +63 -0
- ccai/interfaces/vpnjoinspec.py +109 -0
- ccai/interfaces/vpnoverlayprofile.py +185 -0
- ccai/interfaces/workloadvenuekind.py +31 -0
- ccai/waiting/__init__.py +45 -0
- ccai/waiting/constants.py +30 -0
- ccai/waiting/py.typed +0 -0
- ccai/waiting/waitfunction.py +96 -0
- ccai/waiting/waitmodel.py +440 -0
- codecraftai_foundations-1.2.0.dist-info/METADATA +66 -0
- codecraftai_foundations-1.2.0.dist-info/RECORD +46 -0
- codecraftai_foundations-1.2.0.dist-info/WHEEL +4 -0
- codecraftai_foundations-1.2.0.dist-info/licenses/LICENSE.md +204 -0
ccai/aspects/__init__.py
ADDED
|
File without changes
|
ccai/aspects/aspects.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: aspects
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: Module that contains the :class:`Aspects` placeholder used by
|
|
5
|
+
contract-layer protocols across the ``codecraftai-*`` suite.
|
|
6
|
+
|
|
7
|
+
The Aspects pattern packages behaviour-modifying parameters (retry counts,
|
|
8
|
+
completion intervals, completion timeouts, logging hooks) into a single
|
|
9
|
+
parameter so behaviour is controlled by callers rather than by decorators.
|
|
10
|
+
|
|
11
|
+
This module declares the minimal :class:`Aspects` carrier required by the
|
|
12
|
+
contract-layer protocols (``IVPNClient``, ``IVPNControlPlane``,
|
|
13
|
+
``ITaskHandle``). Concrete enrichments — ``AspectsRest``, ``AspectsCmd``,
|
|
14
|
+
``AspectsUPnP`` and similar — live in their respective implementation-tier
|
|
15
|
+
packages and subclass :class:`Aspects`.
|
|
16
|
+
|
|
17
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
__author__ = "Myron Walker"
|
|
21
|
+
__copyright__ = "Copyright 2025, Code Craft AI LLC"
|
|
22
|
+
__credits__ = []
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from dataclasses import dataclass
|
|
26
|
+
from typing import Optional
|
|
27
|
+
|
|
28
|
+
from ccai.bases.freezable import Freezable
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass(eq=False)
|
|
32
|
+
class Aspects(Freezable):
|
|
33
|
+
"""
|
|
34
|
+
Minimal carrier for behaviour-modifying parameters.
|
|
35
|
+
|
|
36
|
+
Every aspects class in the suite derives from this one. Instances compare by
|
|
37
|
+
identity and are hashable (``eq=False``), because aspects objects are behaviour
|
|
38
|
+
carriers checked against shared defaults rather than values.
|
|
39
|
+
|
|
40
|
+
The class inherits :class:`Freezable` but does not freeze itself: freezing must
|
|
41
|
+
happen after the most-derived class has set its last field. A leaf aspects class
|
|
42
|
+
calls ``freeze()`` at the end of its ``__init__`` and module-level defaults are
|
|
43
|
+
always frozen, for example ``DEFAULT_ASPECTS = Aspects().freeze()``.
|
|
44
|
+
|
|
45
|
+
:param completion_interval: Seconds between completion-poll iterations
|
|
46
|
+
for callers that drive a synchronous wait loop.
|
|
47
|
+
:param completion_timeout: Maximum seconds to wait for completion before
|
|
48
|
+
the caller raises :class:`TimeoutError`.
|
|
49
|
+
:param connection_timeout: Maximum seconds to wait for a single network
|
|
50
|
+
attempt before reclassifying.
|
|
51
|
+
:param max_attempts: Maximum number of attempts a caller is allowed to
|
|
52
|
+
perform when reconciling against a remote system.
|
|
53
|
+
:param logger_name: Optional logger name a caller can route logs into.
|
|
54
|
+
"""
|
|
55
|
+
completion_interval: float = 10.0
|
|
56
|
+
completion_timeout: float = 600.0
|
|
57
|
+
connection_timeout: float = 60.0
|
|
58
|
+
max_attempts: int = 1
|
|
59
|
+
logger_name: Optional[str] = None
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
__all__ = ["Aspects"]
|
ccai/aspects/py.typed
ADDED
|
File without changes
|
ccai/bases/__init__.py
ADDED
|
File without changes
|
ccai/bases/freezable.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: freezable
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: Module which contains the Freezable base class for blocking attribute changes.
|
|
5
|
+
|
|
6
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__author__ = "Myron Walker"
|
|
10
|
+
__copyright__ = "Copyright 2025, Code Craft AI LLC"
|
|
11
|
+
__credits__ = []
|
|
12
|
+
|
|
13
|
+
class Freezable:
|
|
14
|
+
|
|
15
|
+
def __init__(self):
|
|
16
|
+
object.__setattr__(self, "__frozen__", False)
|
|
17
|
+
return
|
|
18
|
+
|
|
19
|
+
def freeze(self):
|
|
20
|
+
"""
|
|
21
|
+
Blocks further attribute assignment. Returns ``self`` so a frozen constant can be
|
|
22
|
+
built in one expression, for example ``DEFAULT = Settings(retries=3).freeze()``.
|
|
23
|
+
"""
|
|
24
|
+
object.__setattr__(self, "__frozen__", True)
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def __setattr__(self, name, value):
|
|
28
|
+
# If the '__frozen__' flag exists and is True, block all changes
|
|
29
|
+
if getattr(self, "__frozen__", False):
|
|
30
|
+
raise AttributeError(f"Freezable objects cannot be modified after they have been initialized and frozen. name={name}")
|
|
31
|
+
|
|
32
|
+
# Otherwise, allow the assignment
|
|
33
|
+
object.__setattr__(self, name, value)
|
|
34
|
+
return
|
ccai/bases/py.typed
ADDED
|
File without changes
|
ccai/errors/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: errors
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: Package which contains exception types and utilities for error handling.
|
|
5
|
+
|
|
6
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__author__ = "Myron Walker"
|
|
10
|
+
__copyright__ = "Copyright 2025, Code Craft AI LLC"
|
|
11
|
+
__credits__ = []
|