orionis 0.418.0__py3-none-any.whl → 0.420.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.
- orionis/metadata/framework.py +1 -1
- {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/METADATA +1 -1
- {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/RECORD +58 -133
- {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/top_level.txt +0 -1
- tests/foundation/config/app/test_foundation_config_app.py +262 -0
- {foundation → tests/foundation}/config/cache/test_foundation_config_cache_file.py +8 -8
- {foundation → tests/foundation}/config/cache/test_foundation_config_cache_stores.py +11 -3
- {foundation → tests/foundation}/config/database/test_foundation_config_database_pgsql.py +5 -5
- {foundation → tests/foundation}/config/queue/test_foundation_config_queue.py +0 -20
- {foundation → tests/foundation}/config/queue/test_foundation_config_queue_brokers.py +0 -13
- tests/foundation/config/root/test_foundation_config_root_paths.py +116 -0
- tests/foundation/config/startup/test_foundation_config_startup.py +199 -0
- foundation/config/app/test_foundation_config_app.py +0 -150
- foundation/config/root/test_foundation_config_root_paths.py +0 -201
- foundation/config/startup/test_foundation_config_startup.py +0 -205
- foundation/exceptions/__init__.py +0 -0
- foundation/exceptions/test_foundation_config_exceptions.py +0 -117
- orionis/_contracts/__init__.py +0 -0
- orionis/_contracts/application.py +0 -41
- orionis/_contracts/config/__init__.py +0 -0
- orionis/_contracts/config/config.py +0 -27
- orionis/_contracts/console/__init__.py +0 -0
- orionis/_contracts/console/base/__init__.py +0 -0
- orionis/_contracts/console/base/command.py +0 -437
- orionis/_contracts/console/command_filter.py +0 -32
- orionis/_contracts/console/kernel.py +0 -32
- orionis/_contracts/console/output/__init__.py +0 -0
- orionis/_contracts/console/output/console.py +0 -421
- orionis/_contracts/console/output/executor.py +0 -51
- orionis/_contracts/console/parser.py +0 -75
- orionis/_contracts/console/task_manager.py +0 -37
- orionis/_contracts/facades/__init__.py +0 -0
- orionis/_contracts/facades/commands/__init__.py +0 -0
- orionis/_contracts/facades/commands/commands_facade.py +0 -40
- orionis/_contracts/facades/commands/scheduler_facade.py +0 -28
- orionis/_contracts/facades/config/__init__.py +0 -0
- orionis/_contracts/facades/config/config_facade.py +0 -37
- orionis/_contracts/facades/environment/__init__.py +0 -0
- orionis/_contracts/facades/environment/environment_facade.py +0 -74
- orionis/_contracts/facades/facade.py +0 -38
- orionis/_contracts/facades/files/__init__.py +0 -0
- orionis/_contracts/facades/files/path_facade.py +0 -148
- orionis/_contracts/facades/log/__init__.py +0 -0
- orionis/_contracts/facades/log/log_facade.py +0 -83
- orionis/_contracts/facades/tests/__init__.py +0 -0
- orionis/_contracts/facades/tests/tests_facade.py +0 -30
- orionis/_contracts/foundation/__init__.py +0 -0
- orionis/_contracts/foundation/bootstraper.py +0 -41
- orionis/_contracts/foundation/config/__init__.py +0 -0
- orionis/_contracts/foundation/config/config_bootstrapper.py +0 -140
- orionis/_contracts/foundation/console/__init__.py +0 -0
- orionis/_contracts/foundation/console/command_bootstrapper.py +0 -81
- orionis/_contracts/foundation/environment/__init__.py +0 -0
- orionis/_contracts/foundation/environment/environment_bootstrapper.py +0 -33
- orionis/_contracts/foundation/providers/__init__.py +0 -0
- orionis/_contracts/foundation/providers/service_providers_bootstrapper.py +0 -47
- orionis/_contracts/providers/__init__.py +0 -0
- orionis/_contracts/providers/service_provider.py +0 -14
- orionis/_contracts/services/__init__.py +0 -0
- orionis/_contracts/services/commands/__init__.py +0 -0
- orionis/_contracts/services/commands/reactor_commands_service.py +0 -23
- orionis/_contracts/services/commands/schedule_service.py +0 -317
- orionis/_contracts/services/config/__init__.py +0 -0
- orionis/_contracts/services/config/config_service.py +0 -37
- orionis/_contracts/services/environment/__init__.py +0 -0
- orionis/_contracts/services/environment/environment_service.py +0 -74
- orionis/_contracts/services/files/__init__.py +0 -0
- orionis/_contracts/services/files/path_resolver_service.py +0 -29
- orionis/_contracts/services/log/__init__.py +0 -0
- orionis/_contracts/services/log/log_service.py +0 -89
- orionis/_contracts/support/exception_parse.py +0 -26
- orionis/_contracts/support/reflection.py +0 -352
- orionis/_foundation/__init__.py +0 -0
- orionis/_foundation/console/__init__.py +0 -0
- orionis/_foundation/console/command_bootstrapper.py +0 -175
- orionis/_foundation/environment/__init__.py +0 -0
- orionis/_foundation/environment/environment_bootstrapper.py +0 -76
- orionis/_foundation/exceptions/__init__.py +0 -0
- orionis/_foundation/exceptions/exception_bootstrapper.py +0 -54
- orionis/_foundation/exceptions/exception_providers.py +0 -54
- orionis/_foundation/foundation/config/__init__.py +0 -0
- orionis/_foundation/foundation/config/config_bootstrapper.py +0 -209
- orionis/_foundation/providers/__init__.py +0 -0
- orionis/_foundation/providers/service_providers_bootstrapper.py +0 -107
- orionis/_services/__init__.py +0 -0
- orionis/_services/commands/__init__.py +0 -0
- orionis/_services/commands/reactor_commands_service.py +0 -148
- orionis/_services/commands/scheduler_service.py +0 -611
- orionis/_services/config/__init__.py +0 -0
- orionis/_services/config/config_service.py +0 -72
- {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/WHEEL +0 -0
- {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/zip-safe +0 -0
- {foundation → tests/foundation}/__init__.py +0 -0
- {foundation → tests/foundation}/config/__init__.py +0 -0
- {foundation → tests/foundation}/config/app/__init__.py +0 -0
- {foundation → tests/foundation}/config/auth/__init__.py +0 -0
- {foundation → tests/foundation}/config/auth/test_foundation_config_auth.py +0 -0
- {foundation → tests/foundation}/config/cache/__init__.py +0 -0
- {foundation → tests/foundation}/config/cache/test_foundation_config_cache.py +0 -0
- {foundation → tests/foundation}/config/cors/__init__.py +0 -0
- {foundation → tests/foundation}/config/cors/test_foundation_config_cors.py +0 -0
- {foundation → tests/foundation}/config/database/__init__.py +0 -0
- {foundation → tests/foundation}/config/database/test_foundation_config_database.py +0 -0
- {foundation → tests/foundation}/config/database/test_foundation_config_database_connections.py +0 -0
- {foundation → tests/foundation}/config/database/test_foundation_config_database_mysql.py +0 -0
- {foundation → tests/foundation}/config/database/test_foundation_config_database_oracle.py +0 -0
- {foundation → tests/foundation}/config/database/test_foundation_config_database_sqlite.py +0 -0
- {foundation → tests/foundation}/config/filesystems/__init__.py +0 -0
- {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems.py +0 -0
- {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_aws.py +0 -0
- {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_disks.py +0 -0
- {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_local.py +0 -0
- {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_public.py +0 -0
- {foundation → tests/foundation}/config/logging/__init__.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_channels.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_chunked.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_daily.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_hourly.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_monthly.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_stack.py +0 -0
- {foundation → tests/foundation}/config/logging/test_foundation_config_logging_weekly.py +0 -0
- {foundation → tests/foundation}/config/mail/__init__.py +0 -0
- {foundation → tests/foundation}/config/mail/test_foundation_config_mail.py +0 -0
- {foundation → tests/foundation}/config/mail/test_foundation_config_mail_file.py +0 -0
- {foundation → tests/foundation}/config/mail/test_foundation_config_mail_mailers.py +0 -0
- {foundation → tests/foundation}/config/mail/test_foundation_config_mail_smtp.py +0 -0
- {foundation → tests/foundation}/config/queue/__init__.py +0 -0
- {foundation → tests/foundation}/config/queue/test_foundation_config_queue_database.py +0 -0
- {foundation → tests/foundation}/config/root/__init__.py +0 -0
- {foundation → tests/foundation}/config/session/__init__.py +0 -0
- {foundation → tests/foundation}/config/session/test_foundation_config_session.py +0 -0
- {foundation → tests/foundation}/config/startup/__init__.py +0 -0
- {foundation → tests/foundation}/config/testing/__init__.py +0 -0
- {foundation → tests/foundation}/config/testing/test_foundation_config_testing.py +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
|
|
3
|
-
class IEnv(ABC):
|
|
4
|
-
|
|
5
|
-
@abstractmethod
|
|
6
|
-
def _initialize(self, path: str = None):
|
|
7
|
-
"""
|
|
8
|
-
Initializes the instance by setting the path to the .env file.
|
|
9
|
-
If no path is provided, defaults to a `.env` file in the current directory.
|
|
10
|
-
|
|
11
|
-
Parameters
|
|
12
|
-
----------
|
|
13
|
-
path : str, optional
|
|
14
|
-
Path to the .env file. Defaults to None.
|
|
15
|
-
"""
|
|
16
|
-
pass
|
|
17
|
-
|
|
18
|
-
@abstractmethod
|
|
19
|
-
def get(self, key: str, default=None) -> str:
|
|
20
|
-
"""
|
|
21
|
-
Retrieves the value of an environment variable from the .env file
|
|
22
|
-
or from system environment variables if not found.
|
|
23
|
-
|
|
24
|
-
Parameters
|
|
25
|
-
----------
|
|
26
|
-
key : str
|
|
27
|
-
The key of the environment variable.
|
|
28
|
-
default : optional
|
|
29
|
-
Default value if the key does not exist. Defaults to None.
|
|
30
|
-
|
|
31
|
-
Returns
|
|
32
|
-
-------
|
|
33
|
-
str
|
|
34
|
-
The value of the environment variable or the default value.
|
|
35
|
-
"""
|
|
36
|
-
pass
|
|
37
|
-
|
|
38
|
-
@abstractmethod
|
|
39
|
-
def set(self, key: str, value: str) -> None:
|
|
40
|
-
"""
|
|
41
|
-
Sets the value of an environment variable in the .env file.
|
|
42
|
-
|
|
43
|
-
Parameters
|
|
44
|
-
----------
|
|
45
|
-
key : str
|
|
46
|
-
The key of the environment variable.
|
|
47
|
-
value : str
|
|
48
|
-
The value to set.
|
|
49
|
-
"""
|
|
50
|
-
pass
|
|
51
|
-
|
|
52
|
-
@abstractmethod
|
|
53
|
-
def unset(self, key: str) -> None:
|
|
54
|
-
"""
|
|
55
|
-
Removes an environment variable from the .env file.
|
|
56
|
-
|
|
57
|
-
Parameters
|
|
58
|
-
----------
|
|
59
|
-
key : str
|
|
60
|
-
The key of the environment variable to remove.
|
|
61
|
-
"""
|
|
62
|
-
pass
|
|
63
|
-
|
|
64
|
-
@abstractmethod
|
|
65
|
-
def all(self) -> dict:
|
|
66
|
-
"""
|
|
67
|
-
Retrieves all environment variable values from the .env file.
|
|
68
|
-
|
|
69
|
-
Returns
|
|
70
|
-
-------
|
|
71
|
-
dict
|
|
72
|
-
A dictionary of all environment variables and their values.
|
|
73
|
-
"""
|
|
74
|
-
pass
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
from orionis._container.container import Container
|
|
2
|
-
# from orionis.support.async.async_io import AsyncExecutor
|
|
3
|
-
|
|
4
|
-
class FacadeMeta(type):
|
|
5
|
-
"""
|
|
6
|
-
Metaclass for Facade pattern. It intercepts attribute access to dynamically resolve and delegate calls
|
|
7
|
-
to the underlying service. This is where the magic happens, folks!
|
|
8
|
-
"""
|
|
9
|
-
def __getattr__(cls, name: str):
|
|
10
|
-
"""
|
|
11
|
-
When an undefined attribute is accessed, this method resolves the service and delegates the call.
|
|
12
|
-
It's like having a genie in a bottle, but for services.
|
|
13
|
-
"""
|
|
14
|
-
service = cls.resolve()
|
|
15
|
-
return getattr(service, name)
|
|
16
|
-
|
|
17
|
-
class Facade(metaclass=FacadeMeta):
|
|
18
|
-
"""
|
|
19
|
-
Base Facade class. It provides a clean and simple interface to interact with complex services.
|
|
20
|
-
Think of it as the friendly face of a very complicated machine.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
@classmethod
|
|
24
|
-
def getFacadeAccessor(cls):
|
|
25
|
-
"""
|
|
26
|
-
This method must be overridden by subclasses to return the name of the service to be resolved.
|
|
27
|
-
If not, it throws a tantrum (NotImplementedError).
|
|
28
|
-
"""
|
|
29
|
-
raise NotImplementedError("You must define the service name")
|
|
30
|
-
|
|
31
|
-
@classmethod
|
|
32
|
-
def resolve(cls):
|
|
33
|
-
"""
|
|
34
|
-
Resolves the service by using the AsyncExecutor to make it from the Container.
|
|
35
|
-
It's like calling the butler to fetch something from the pantry.
|
|
36
|
-
"""
|
|
37
|
-
pass
|
|
38
|
-
# return AsyncExecutor.run(Container().make(cls.getFacadeAccessor()))
|
|
File without changes
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
|
|
3
|
-
class IPath(ABC):
|
|
4
|
-
"""
|
|
5
|
-
A facade class for resolving absolute paths to various application directories.
|
|
6
|
-
|
|
7
|
-
This class provides static methods to resolve paths to common directories such as
|
|
8
|
-
'app', 'config', 'database', 'resources', 'routes', 'storage', and 'tests'.
|
|
9
|
-
It uses the `PathService` to resolve and validate paths.
|
|
10
|
-
|
|
11
|
-
Methods
|
|
12
|
-
-------
|
|
13
|
-
_resolve_directory(directory: str, file: str = None) -> SkeletonPath
|
|
14
|
-
Resolves the absolute path for a given directory and optional file.
|
|
15
|
-
app(file: str = None) -> SkeletonPath
|
|
16
|
-
Returns the absolute path for a file inside the 'app' directory.
|
|
17
|
-
config(file: str = None) -> SkeletonPath
|
|
18
|
-
Returns the absolute path for a file inside the 'config' directory.
|
|
19
|
-
database(file: str = None) -> SkeletonPath
|
|
20
|
-
Returns the absolute path for a file inside the 'database' directory.
|
|
21
|
-
resource(file: str = None) -> SkeletonPath
|
|
22
|
-
Returns the absolute path for a file inside the 'resource' directory.
|
|
23
|
-
routes(file: str = None) -> SkeletonPath
|
|
24
|
-
Returns the absolute path for a file inside the 'routes' directory.
|
|
25
|
-
storage(file: str = None) -> SkeletonPath
|
|
26
|
-
Returns the absolute path for a file inside the 'storage' directory.
|
|
27
|
-
tests(file: str = None) -> SkeletonPath
|
|
28
|
-
Returns the absolute path for a file inside the 'tests' directory.
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
@abstractmethod
|
|
32
|
-
def app(file: str = None):
|
|
33
|
-
"""
|
|
34
|
-
Returns the absolute path for a file inside the 'app' directory.
|
|
35
|
-
|
|
36
|
-
Parameters
|
|
37
|
-
----------
|
|
38
|
-
file : str, optional
|
|
39
|
-
The relative file path inside the 'app' directory.
|
|
40
|
-
|
|
41
|
-
Returns
|
|
42
|
-
-------
|
|
43
|
-
SkeletonPath
|
|
44
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
45
|
-
"""
|
|
46
|
-
pass
|
|
47
|
-
|
|
48
|
-
@abstractmethod
|
|
49
|
-
def config(file: str = None):
|
|
50
|
-
"""
|
|
51
|
-
Returns the absolute path for a file inside the 'config' directory.
|
|
52
|
-
|
|
53
|
-
Parameters
|
|
54
|
-
----------
|
|
55
|
-
file : str, optional
|
|
56
|
-
The relative file path inside the 'config' directory.
|
|
57
|
-
|
|
58
|
-
Returns
|
|
59
|
-
-------
|
|
60
|
-
SkeletonPath
|
|
61
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
62
|
-
"""
|
|
63
|
-
pass
|
|
64
|
-
|
|
65
|
-
@abstractmethod
|
|
66
|
-
def database(file: str = None):
|
|
67
|
-
"""
|
|
68
|
-
Returns the absolute path for a file inside the 'database' directory.
|
|
69
|
-
|
|
70
|
-
Parameters
|
|
71
|
-
----------
|
|
72
|
-
file : str, optional
|
|
73
|
-
The relative file path inside the 'database' directory.
|
|
74
|
-
|
|
75
|
-
Returns
|
|
76
|
-
-------
|
|
77
|
-
SkeletonPath
|
|
78
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
79
|
-
"""
|
|
80
|
-
pass
|
|
81
|
-
|
|
82
|
-
@abstractmethod
|
|
83
|
-
def resource(file: str = None):
|
|
84
|
-
"""
|
|
85
|
-
Returns the absolute path for a file inside the 'resource' directory.
|
|
86
|
-
|
|
87
|
-
Parameters
|
|
88
|
-
----------
|
|
89
|
-
file : str, optional
|
|
90
|
-
The relative file path inside the 'resource' directory.
|
|
91
|
-
|
|
92
|
-
Returns
|
|
93
|
-
-------
|
|
94
|
-
SkeletonPath
|
|
95
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
96
|
-
"""
|
|
97
|
-
pass
|
|
98
|
-
|
|
99
|
-
@abstractmethod
|
|
100
|
-
def routes(file: str = None):
|
|
101
|
-
"""
|
|
102
|
-
Returns the absolute path for a file inside the 'routes' directory.
|
|
103
|
-
|
|
104
|
-
Parameters
|
|
105
|
-
----------
|
|
106
|
-
file : str, optional
|
|
107
|
-
The relative file path inside the 'routes' directory.
|
|
108
|
-
|
|
109
|
-
Returns
|
|
110
|
-
-------
|
|
111
|
-
SkeletonPath
|
|
112
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
113
|
-
"""
|
|
114
|
-
pass
|
|
115
|
-
|
|
116
|
-
@abstractmethod
|
|
117
|
-
def storage(file: str = None):
|
|
118
|
-
"""
|
|
119
|
-
Returns the absolute path for a file inside the 'storage' directory.
|
|
120
|
-
|
|
121
|
-
Parameters
|
|
122
|
-
----------
|
|
123
|
-
file : str, optional
|
|
124
|
-
The relative file path inside the 'storage' directory.
|
|
125
|
-
|
|
126
|
-
Returns
|
|
127
|
-
-------
|
|
128
|
-
SkeletonPath
|
|
129
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
130
|
-
"""
|
|
131
|
-
pass
|
|
132
|
-
|
|
133
|
-
@abstractmethod
|
|
134
|
-
def tests(file: str = None):
|
|
135
|
-
"""
|
|
136
|
-
Returns the absolute path for a file inside the 'tests' directory.
|
|
137
|
-
|
|
138
|
-
Parameters
|
|
139
|
-
----------
|
|
140
|
-
file : str, optional
|
|
141
|
-
The relative file path inside the 'tests' directory.
|
|
142
|
-
|
|
143
|
-
Returns
|
|
144
|
-
-------
|
|
145
|
-
SkeletonPath
|
|
146
|
-
The resolved path wrapped in a SkeletonPath object.
|
|
147
|
-
"""
|
|
148
|
-
pass
|
|
File without changes
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
|
|
3
|
-
class ILog(ABC):
|
|
4
|
-
"""
|
|
5
|
-
A facade class for logging messages with different severity levels.
|
|
6
|
-
|
|
7
|
-
This class provides static methods to log messages using the `LogguerService`.
|
|
8
|
-
It simplifies the process of logging by abstracting the service resolution
|
|
9
|
-
and providing a clean interface for logging.
|
|
10
|
-
|
|
11
|
-
Methods
|
|
12
|
-
-------
|
|
13
|
-
info(message: str) -> None
|
|
14
|
-
Logs an informational message.
|
|
15
|
-
error(message: str) -> None
|
|
16
|
-
Logs an error message.
|
|
17
|
-
success(message: str) -> None
|
|
18
|
-
Logs a success message.
|
|
19
|
-
warning(message: str) -> None
|
|
20
|
-
Logs a warning message.
|
|
21
|
-
debug(message: str) -> None
|
|
22
|
-
Logs a debug message.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
@abstractmethod
|
|
26
|
-
def info(message: str) -> None:
|
|
27
|
-
"""
|
|
28
|
-
Logs an informational message.
|
|
29
|
-
|
|
30
|
-
Parameters
|
|
31
|
-
----------
|
|
32
|
-
message : str
|
|
33
|
-
The message to log.
|
|
34
|
-
"""
|
|
35
|
-
pass
|
|
36
|
-
|
|
37
|
-
@abstractmethod
|
|
38
|
-
def error(message: str) -> None:
|
|
39
|
-
"""
|
|
40
|
-
Logs an error message.
|
|
41
|
-
|
|
42
|
-
Parameters
|
|
43
|
-
----------
|
|
44
|
-
message : str
|
|
45
|
-
The message to log.
|
|
46
|
-
"""
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
@abstractmethod
|
|
50
|
-
def success(message: str) -> None:
|
|
51
|
-
"""
|
|
52
|
-
Logs a success message.
|
|
53
|
-
|
|
54
|
-
Parameters
|
|
55
|
-
----------
|
|
56
|
-
message : str
|
|
57
|
-
The message to log.
|
|
58
|
-
"""
|
|
59
|
-
pass
|
|
60
|
-
|
|
61
|
-
@abstractmethod
|
|
62
|
-
def warning(message: str) -> None:
|
|
63
|
-
"""
|
|
64
|
-
Logs a warning message.
|
|
65
|
-
|
|
66
|
-
Parameters
|
|
67
|
-
----------
|
|
68
|
-
message : str
|
|
69
|
-
The message to log.
|
|
70
|
-
"""
|
|
71
|
-
pass
|
|
72
|
-
|
|
73
|
-
@abstractmethod
|
|
74
|
-
def debug(message: str) -> None:
|
|
75
|
-
"""
|
|
76
|
-
Logs a debug message.
|
|
77
|
-
|
|
78
|
-
Parameters
|
|
79
|
-
----------
|
|
80
|
-
message : str
|
|
81
|
-
The message to log.
|
|
82
|
-
"""
|
|
83
|
-
pass
|
|
File without changes
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
|
|
3
|
-
class IUnitTests(ABC):
|
|
4
|
-
"""
|
|
5
|
-
Interface for executing unit tests based on a specified pattern.
|
|
6
|
-
|
|
7
|
-
Methods
|
|
8
|
-
-------
|
|
9
|
-
execute(pattern: str) -> dict
|
|
10
|
-
Executes unit tests by iterating over the 'tests' directory and its subdirectories,
|
|
11
|
-
matching test files based on the provided pattern.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
@abstractmethod
|
|
15
|
-
def execute(pattern='test_*.py') -> dict:
|
|
16
|
-
"""
|
|
17
|
-
Executes the unit tests in the 'tests' directory and its subdirectories
|
|
18
|
-
by filtering test files based on a specified pattern.
|
|
19
|
-
|
|
20
|
-
Parameters
|
|
21
|
-
----------
|
|
22
|
-
pattern : str, optional
|
|
23
|
-
The pattern to filter test files (default is 'test_*.py').
|
|
24
|
-
|
|
25
|
-
Returns
|
|
26
|
-
-------
|
|
27
|
-
dict
|
|
28
|
-
A dictionary containing the results of the executed tests.
|
|
29
|
-
"""
|
|
30
|
-
pass
|
|
File without changes
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
class IBootstrapper(ABC):
|
|
5
|
-
|
|
6
|
-
@abstractmethod
|
|
7
|
-
def _autoload(self) -> None:
|
|
8
|
-
"""
|
|
9
|
-
Loads environment variables from the `.env` file or creates the file if it does not exist.
|
|
10
|
-
|
|
11
|
-
This method checks if the `.env` file exists in the current working directory.
|
|
12
|
-
If the file does not exist, it creates an empty `.env` file. If the file exists,
|
|
13
|
-
it loads the environment variables into the `_environment_vars` dictionary.
|
|
14
|
-
|
|
15
|
-
Raises
|
|
16
|
-
------
|
|
17
|
-
PermissionError
|
|
18
|
-
If the `.env` file cannot be created or read due to insufficient permissions.
|
|
19
|
-
"""
|
|
20
|
-
pass
|
|
21
|
-
|
|
22
|
-
def get(self, *args, **kwargs) -> Any:
|
|
23
|
-
"""
|
|
24
|
-
Retrieves the value of an environment variable.
|
|
25
|
-
|
|
26
|
-
Parameters
|
|
27
|
-
----------
|
|
28
|
-
key : str
|
|
29
|
-
The name of the environment variable.
|
|
30
|
-
|
|
31
|
-
Returns
|
|
32
|
-
-------
|
|
33
|
-
str
|
|
34
|
-
The value of the environment variable.
|
|
35
|
-
|
|
36
|
-
Raises
|
|
37
|
-
------
|
|
38
|
-
KeyError
|
|
39
|
-
If the environment variable does not exist.
|
|
40
|
-
"""
|
|
41
|
-
pass
|
|
File without changes
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Any, Dict
|
|
3
|
-
|
|
4
|
-
class IConfigBootstrapper(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Attributes
|
|
7
|
-
----------
|
|
8
|
-
_config : Dict[str, Any]
|
|
9
|
-
A dictionary to store registered configuration sections and their data.
|
|
10
|
-
|
|
11
|
-
Methods
|
|
12
|
-
-------
|
|
13
|
-
__init__()
|
|
14
|
-
Initializes the `ConfigBootstrapper` and triggers the autoload process.
|
|
15
|
-
_autoload()
|
|
16
|
-
Scans the configuration directory and loads configuration classes.
|
|
17
|
-
_set(concrete: Any, section: str)
|
|
18
|
-
Validates and registers a configuration class.
|
|
19
|
-
_parse(data: Any) -> Dict[str, Any]
|
|
20
|
-
Converts the 'config' attribute of a class into a dictionary.
|
|
21
|
-
_register(section: str, data: Dict[str, Any])
|
|
22
|
-
Registers a configuration section.
|
|
23
|
-
set(key: str, value: Any)
|
|
24
|
-
Dynamically sets a configuration value using dot notation.
|
|
25
|
-
get(key: str, default: Optional[Any] = None) -> Any
|
|
26
|
-
Retrieves a configuration value using dot notation.
|
|
27
|
-
"""
|
|
28
|
-
|
|
29
|
-
@abstractmethod
|
|
30
|
-
def _autoload(self) -> None:
|
|
31
|
-
"""
|
|
32
|
-
Scans the configuration directory and loads configuration classes.
|
|
33
|
-
|
|
34
|
-
This method searches for Python files in the specified directory, imports them,
|
|
35
|
-
and registers any class named `Config` that inherits from `IConfig`.
|
|
36
|
-
|
|
37
|
-
Raises
|
|
38
|
-
------
|
|
39
|
-
FileNotFoundError
|
|
40
|
-
If the configuration directory does not exist.
|
|
41
|
-
BootstrapRuntimeError
|
|
42
|
-
If there is an error loading a module.
|
|
43
|
-
"""
|
|
44
|
-
pass
|
|
45
|
-
|
|
46
|
-
@abstractmethod
|
|
47
|
-
def _set(self, concrete: Any, section: str) -> None:
|
|
48
|
-
"""
|
|
49
|
-
Validates and registers a configuration class.
|
|
50
|
-
|
|
51
|
-
This method ensures that the provided class is valid (inherits from `IConfig`
|
|
52
|
-
and has a `config` attribute) and registers it in the `_config` dictionary.
|
|
53
|
-
|
|
54
|
-
Parameters
|
|
55
|
-
----------
|
|
56
|
-
concrete : Any
|
|
57
|
-
The configuration class to register.
|
|
58
|
-
section : str
|
|
59
|
-
The section name under which the configuration will be registered.
|
|
60
|
-
|
|
61
|
-
Raises
|
|
62
|
-
------
|
|
63
|
-
TypeError
|
|
64
|
-
If the input is not a class or does not inherit from `IConfig`.
|
|
65
|
-
ValueError
|
|
66
|
-
If the class does not have a `config` attribute.
|
|
67
|
-
"""
|
|
68
|
-
pass
|
|
69
|
-
|
|
70
|
-
@abstractmethod
|
|
71
|
-
def _parse(data: Any) -> Dict[str, Any]:
|
|
72
|
-
"""
|
|
73
|
-
Converts the 'config' attribute of a class into a dictionary.
|
|
74
|
-
|
|
75
|
-
If the input is already a dictionary, it is returned as-is. If the input is a
|
|
76
|
-
dataclass, it is converted to a dictionary using `asdict`.
|
|
77
|
-
|
|
78
|
-
Parameters
|
|
79
|
-
----------
|
|
80
|
-
data : Any
|
|
81
|
-
The data to convert into a dictionary.
|
|
82
|
-
|
|
83
|
-
Returns
|
|
84
|
-
-------
|
|
85
|
-
Dict[str, Any]
|
|
86
|
-
The converted dictionary.
|
|
87
|
-
|
|
88
|
-
Raises
|
|
89
|
-
------
|
|
90
|
-
TypeError
|
|
91
|
-
If the data cannot be converted to a dictionary.
|
|
92
|
-
"""
|
|
93
|
-
pass
|
|
94
|
-
|
|
95
|
-
@abstractmethod
|
|
96
|
-
def _register(self, section: str, data: Dict[str, Any]) -> None:
|
|
97
|
-
"""
|
|
98
|
-
Registers a configuration section.
|
|
99
|
-
|
|
100
|
-
Parameters
|
|
101
|
-
----------
|
|
102
|
-
section : str
|
|
103
|
-
The name of the configuration section.
|
|
104
|
-
data : Dict[str, Any]
|
|
105
|
-
The configuration data to register.
|
|
106
|
-
|
|
107
|
-
Raises
|
|
108
|
-
------
|
|
109
|
-
ValueError
|
|
110
|
-
If the section is already registered.
|
|
111
|
-
"""
|
|
112
|
-
pass
|
|
113
|
-
|
|
114
|
-
@abstractmethod
|
|
115
|
-
def get(self, key: str = None, default: Any = None) -> Any:
|
|
116
|
-
"""
|
|
117
|
-
Retrieves configuration data.
|
|
118
|
-
|
|
119
|
-
If a key is provided, it retrieves the value associated with the key using dot notation.
|
|
120
|
-
If no key is provided, it returns the entire configuration dictionary.
|
|
121
|
-
|
|
122
|
-
Parameters
|
|
123
|
-
----------
|
|
124
|
-
key : str, optional
|
|
125
|
-
The key to retrieve the value for, using dot notation (default is None).
|
|
126
|
-
default : Any, optional
|
|
127
|
-
The default value to return if the key is not found (default is None).
|
|
128
|
-
|
|
129
|
-
Returns
|
|
130
|
-
-------
|
|
131
|
-
Any
|
|
132
|
-
The configuration value associated with the key, or the entire configuration dictionary
|
|
133
|
-
if no key is provided. If the key is not found, returns the default value.
|
|
134
|
-
|
|
135
|
-
Raises
|
|
136
|
-
------
|
|
137
|
-
KeyError
|
|
138
|
-
If the key is not found and no default value is provided.
|
|
139
|
-
"""
|
|
140
|
-
pass
|
|
File without changes
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Any, Callable, Dict
|
|
3
|
-
|
|
4
|
-
class ICommandsBootstrapper(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Attributes
|
|
7
|
-
----------
|
|
8
|
-
_commands : Dict[str, Dict[str, Any]]
|
|
9
|
-
A dictionary to store registered commands, where the key is the command signature
|
|
10
|
-
and the value is a dictionary containing the command class, arguments, description,
|
|
11
|
-
and signature.
|
|
12
|
-
|
|
13
|
-
Methods
|
|
14
|
-
-------
|
|
15
|
-
__init__()
|
|
16
|
-
Initializes the `CommandsBootstrapper` and triggers the autoload process.
|
|
17
|
-
_autoload()
|
|
18
|
-
Scans the command directories and loads command classes.
|
|
19
|
-
_register(concrete: Callable[..., Any])
|
|
20
|
-
Validates and registers a command class.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
@abstractmethod
|
|
24
|
-
def _autoload(self) -> None:
|
|
25
|
-
"""
|
|
26
|
-
Scans the command directories and loads command classes.
|
|
27
|
-
|
|
28
|
-
This method searches for Python files in the specified directories, imports them,
|
|
29
|
-
and registers any class that inherits from `BaseCommand`.
|
|
30
|
-
|
|
31
|
-
Raises
|
|
32
|
-
------
|
|
33
|
-
BootstrapRuntimeError
|
|
34
|
-
If there is an error loading a module.
|
|
35
|
-
"""
|
|
36
|
-
pass
|
|
37
|
-
|
|
38
|
-
@abstractmethod
|
|
39
|
-
def _register(self, concrete: Callable[..., Any]) -> None:
|
|
40
|
-
"""
|
|
41
|
-
Validates and registers a command class.
|
|
42
|
-
|
|
43
|
-
This method ensures that the provided class is valid (inherits from `BaseCommand`,
|
|
44
|
-
has a `signature`, `description`, and `handle` method) and registers it in the
|
|
45
|
-
`_commands` dictionary.
|
|
46
|
-
|
|
47
|
-
Parameters
|
|
48
|
-
----------
|
|
49
|
-
concrete : Callable[..., Any]
|
|
50
|
-
The command class to register.
|
|
51
|
-
|
|
52
|
-
Raises
|
|
53
|
-
------
|
|
54
|
-
TypeError
|
|
55
|
-
If the input is not a class or does not inherit from `BaseCommand`.
|
|
56
|
-
ValueError
|
|
57
|
-
If the class does not have required attributes or methods.
|
|
58
|
-
"""
|
|
59
|
-
pass
|
|
60
|
-
|
|
61
|
-
@abstractmethod
|
|
62
|
-
def get(self, signature: str = None) -> Dict[str, Any]:
|
|
63
|
-
"""
|
|
64
|
-
Retrieves a registered command by its signature.
|
|
65
|
-
|
|
66
|
-
Parameters
|
|
67
|
-
----------
|
|
68
|
-
signature : str
|
|
69
|
-
The command signature to retrieve.
|
|
70
|
-
|
|
71
|
-
Returns
|
|
72
|
-
-------
|
|
73
|
-
Dict[str, Any]
|
|
74
|
-
A dictionary containing the command class, arguments, description, and signature.
|
|
75
|
-
|
|
76
|
-
Raises
|
|
77
|
-
------
|
|
78
|
-
KeyError
|
|
79
|
-
If the command signature is not found.
|
|
80
|
-
"""
|
|
81
|
-
pass
|
|
File without changes
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Any, Optional
|
|
3
|
-
|
|
4
|
-
class IEnvironmentBootstrapper(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Attributes
|
|
7
|
-
----------
|
|
8
|
-
_environment_vars : Dict[str, str]
|
|
9
|
-
A dictionary to store the loaded environment variables.
|
|
10
|
-
path : Path
|
|
11
|
-
The path to the `.env` file.
|
|
12
|
-
|
|
13
|
-
Methods
|
|
14
|
-
-------
|
|
15
|
-
_autoload()
|
|
16
|
-
Loads environment variables from the `.env` file or creates the file if it does not exist.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
@abstractmethod
|
|
20
|
-
def _autoload(self) -> None:
|
|
21
|
-
"""
|
|
22
|
-
Loads environment variables from the `.env` file or creates the file if it does not exist.
|
|
23
|
-
|
|
24
|
-
This method checks if the `.env` file exists in the current working directory.
|
|
25
|
-
If the file does not exist, it creates an empty `.env` file. If the file exists,
|
|
26
|
-
it loads the environment variables into the `_environment_vars` dictionary.
|
|
27
|
-
|
|
28
|
-
Raises
|
|
29
|
-
------
|
|
30
|
-
PermissionError
|
|
31
|
-
If the `.env` file cannot be created or read due to insufficient permissions.
|
|
32
|
-
"""
|
|
33
|
-
pass
|
|
File without changes
|