orionis 0.669.0__py3-none-any.whl → 0.671.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.
@@ -95,9 +95,6 @@ class PublisherCommand(BaseCommand):
95
95
  # Calculate the width for console panels (3/4 of the console width)
96
96
  self.__with_console = (self.__console.width // 4) * 3
97
97
 
98
- # Retrieve the PyPI token from environment variables and remove leading/trailing whitespace
99
- self.__token = os.getenv("PYPI_TOKEN").strip()
100
-
101
98
  def __bumpMinorVersion(self):
102
99
  """
103
100
  Increment the minor version number in the file where the VERSION constant is defined.
@@ -376,7 +373,7 @@ class PublisherCommand(BaseCommand):
376
373
  """
377
374
 
378
375
  # Get the PyPI token from environment variables
379
- token = self.__token
376
+ token = os.getenv("PYPI_TOKEN").strip()
380
377
 
381
378
  # Check if the PyPI token is available
382
379
  if not token:
@@ -281,7 +281,6 @@ class Reactor(IReactor):
281
281
 
282
282
  # Import the core command class for version
283
283
  from orionis.console.commands.__publisher__ import PublisherCommand
284
- from orionis.console.commands.__workflow__ import WorkFlowGithubCommand
285
284
  from orionis.console.commands.cache_clear import CacheClearCommand
286
285
  from orionis.console.commands.help import HelpCommand
287
286
  from orionis.console.commands.log_clear import LogClearCommand
@@ -294,7 +293,6 @@ class Reactor(IReactor):
294
293
  # List of core command classes to load (extend this list as more core commands are added)
295
294
  core_commands = [
296
295
  PublisherCommand,
297
- WorkFlowGithubCommand,
298
296
  CacheClearCommand,
299
297
  HelpCommand,
300
298
  LogClearCommand,
@@ -14,13 +14,13 @@ class BaseExceptionHandler(IBaseExceptionHandler):
14
14
  # Example: OrionisContainerException
15
15
  ]
16
16
 
17
- async def destructureException(self, exception: BaseException) -> Throwable:
17
+ async def destructureException(self, exception: Exception) -> Throwable:
18
18
  """
19
19
  Converts an exception into a structured `Throwable` object containing detailed information.
20
20
 
21
21
  Parameters
22
22
  ----------
23
- e : BaseException
23
+ e : Exception
24
24
  The exception instance to be destructured.
25
25
 
26
26
  Returns
@@ -34,14 +34,22 @@ class BaseExceptionHandler(IBaseExceptionHandler):
34
34
  and wraps them in a `Throwable` object for consistent error handling and reporting.
35
35
  """
36
36
 
37
+ # Safely extract the exception arguments, defaulting to an empty string if none are present
38
+ args = getattr(exception, 'args', None)
39
+ if not args:
40
+ args = ("",)
41
+
42
+ # Optionally, ensure all args are stringified for consistency
43
+ args = tuple(str(arg) for arg in args)
44
+
37
45
  return Throwable(
38
- classtype=type(exception), # The class/type of the exception
39
- message=exception.args[0] if exception.args else str(exception), # The exception message as a string
40
- args=exception.args, # The arguments passed to the exception
41
- traceback=exception.__traceback__ or traceback.format_exc() # The traceback object, if available
46
+ classtype=type(exception), # The class/type of the exception
47
+ message=args[0], # The exception message as a string
48
+ args=args, # The arguments passed to the exception
49
+ traceback=exception.__traceback__ or traceback.format_exc() # The traceback object, if available
42
50
  )
43
51
 
44
- async def shouldIgnoreException(self, exception: BaseException) -> bool:
52
+ async def shouldIgnoreException(self, exception: Exception) -> bool:
45
53
  """
46
54
  Determines if the exception should be ignored (not handled) by the handler.
47
55
 
@@ -57,7 +65,7 @@ class BaseExceptionHandler(IBaseExceptionHandler):
57
65
  """
58
66
 
59
67
  # Ensure the provided object is an exception
60
- if not isinstance(exception, BaseException):
68
+ if not isinstance(exception, (BaseException, Exception)):
61
69
  raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
62
70
 
63
71
  # Convert the exception into a structured Throwable object
@@ -66,13 +74,13 @@ class BaseExceptionHandler(IBaseExceptionHandler):
66
74
  # Check if the exception type is in the list of exceptions to ignore
67
75
  return hasattr(self, 'dont_catch') and throwable.classtype in self.dont_catch
68
76
 
69
- async def report(self, exception: BaseException, log: ILogger) -> Any:
77
+ async def report(self, exception: Exception, log: ILogger) -> Any:
70
78
  """
71
79
  Report or log an exception.
72
80
 
73
81
  Parameters
74
82
  ----------
75
- exception : BaseException
83
+ exception : Exception
76
84
  The exception instance that was caught.
77
85
 
78
86
  Returns
@@ -80,7 +88,7 @@ class BaseExceptionHandler(IBaseExceptionHandler):
80
88
  None
81
89
  """
82
90
  # Ensure the provided object is an exception
83
- if not isinstance(exception, BaseException):
91
+ if not isinstance(exception, (BaseException, Exception)):
84
92
  raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
85
93
 
86
94
  # Convert the exception into a structured Throwable object
@@ -92,13 +100,13 @@ class BaseExceptionHandler(IBaseExceptionHandler):
92
100
  # Return the structured exception
93
101
  return throwable
94
102
 
95
- async def renderCLI(self, exception: BaseException, request: ICLIRequest, log: ILogger, console: IConsole) -> Any:
103
+ async def renderCLI(self, exception: Exception, request: ICLIRequest, log: ILogger, console: IConsole) -> Any:
96
104
  """
97
105
  Render the exception message for CLI output.
98
106
 
99
107
  Parameters
100
108
  ----------
101
- exception : BaseException
109
+ exception : Exception
102
110
  The exception instance that was caught.
103
111
 
104
112
  Returns
@@ -106,8 +114,8 @@ class BaseExceptionHandler(IBaseExceptionHandler):
106
114
  None
107
115
  """
108
116
  # Ensure the provided object is an exception
109
- if not isinstance(exception, BaseException):
110
- raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
117
+ if not isinstance(exception, (BaseException, Exception)):
118
+ raise TypeError(f"Expected Exception, got {type(exception).__name__}")
111
119
 
112
120
  # Ensure the request is a CLIRequest
113
121
  if not isinstance(request, ICLIRequest):
orionis/failure/catch.py CHANGED
@@ -41,7 +41,7 @@ class Catch(ICatch):
41
41
  # Retrieve the console output service from the application container
42
42
  self.__exception_handler: IBaseExceptionHandler = app.getExceptionHandler()
43
43
 
44
- def exception(self, kernel: Any, request: Any, e: BaseException) -> None:
44
+ def exception(self, kernel: Any, request: Any, e: BaseException | Exception) -> None:
45
45
  """
46
46
  Handles and reports exceptions that occur during CLI execution.
47
47
 
@@ -69,8 +69,8 @@ class Catch(ICatch):
69
69
  """
70
70
 
71
71
  # If there is no exception handler, return early
72
- if self.__app.call(self.__exception_handler, 'shouldIgnoreException', exception=e):
73
- return
72
+ # if self.__app.call(self.__exception_handler, 'shouldIgnoreException', exception=e):
73
+ # return
74
74
 
75
75
  # Report the exception using the exception handler and logger
76
76
  self.__app.call(self.__exception_handler, 'report', exception=e)
@@ -4,7 +4,7 @@ from typing import Any
4
4
  class ICatch(ABC):
5
5
 
6
6
  @abstractmethod
7
- def exception(self, kernel: Any, request: Any, e: BaseException) -> None:
7
+ def exception(self, kernel: Any, request: Any, e: BaseException | Exception) -> None:
8
8
  """
9
9
  Handles and reports exceptions that occur during CLI execution.
10
10
 
@@ -7,13 +7,13 @@ from orionis.services.log.contracts.log_service import ILogger
7
7
  class IBaseExceptionHandler:
8
8
 
9
9
  @abstractmethod
10
- async def destructureException(self, e: BaseException):
10
+ async def destructureException(self, e: Exception):
11
11
  """
12
12
  Converts an exception into a structured `Throwable` object containing detailed information.
13
13
 
14
14
  Parameters
15
15
  ----------
16
- e : BaseException
16
+ e : Exception
17
17
  The exception instance to be destructured.
18
18
 
19
19
  Returns
@@ -29,13 +29,13 @@ class IBaseExceptionHandler:
29
29
  pass
30
30
 
31
31
  @abstractmethod
32
- async def shouldIgnoreException(self, e: BaseException) -> bool:
32
+ async def shouldIgnoreException(self, e: Exception) -> bool:
33
33
  """
34
34
  Determines if the exception should be ignored (not handled) by the handler.
35
35
 
36
36
  Parameters
37
37
  ----------
38
- e : BaseException
38
+ e : Exception
39
39
  The exception instance to check.
40
40
 
41
41
  Returns
@@ -46,13 +46,13 @@ class IBaseExceptionHandler:
46
46
  pass
47
47
 
48
48
  @abstractmethod
49
- async def report (self, exception: BaseException, log: ILogger) -> Any:
49
+ async def report (self, exception: Exception, log: ILogger) -> Any:
50
50
  """
51
51
  Report or log an exception.
52
52
 
53
53
  Parameters
54
54
  ----------
55
- exception : BaseException
55
+ exception : Exception
56
56
  The exception instance that was caught.
57
57
 
58
58
  Returns
@@ -62,13 +62,13 @@ class IBaseExceptionHandler:
62
62
  pass
63
63
 
64
64
  @abstractmethod
65
- async def renderCLI(self, exception: BaseException, request: ICLIRequest, log: ILogger, console: IConsole) -> Any:
65
+ async def renderCLI(self, exception: Exception, request: ICLIRequest, log: ILogger, console: IConsole) -> Any:
66
66
  """
67
67
  Render the exception message for CLI output.
68
68
 
69
69
  Parameters
70
70
  ----------
71
- exception : BaseException
71
+ exception : Exception
72
72
  The exception instance that was caught.
73
73
 
74
74
  Returns
@@ -30,4 +30,5 @@ class Throwable:
30
30
 
31
31
  classtype: type # The type of the throwable (e.g., Exception class)
32
32
  message: str # The error message associated with the throwable
33
+ args: tuple # Arguments passed to the throwable
33
34
  traceback: Optional[str] = None # Optional traceback information as a string
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.669.0"
8
+ VERSION = "0.671.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.669.0
3
+ Version: 0.671.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -8,8 +8,7 @@ orionis/console/base/command.py,sha256=tAO_EVy1aNWneNSKYYMAf9yDTfbvHAqSJnZZ6pOR4
8
8
  orionis/console/base/scheduler.py,sha256=JoZdtyrVJiNzBoVEWUovHscqBxqw_fPPwaENIQc4Zp4,7644
9
9
  orionis/console/base/scheduler_event_listener.py,sha256=X2mZBAYLBCtLOH7QSrCEaLeJ5m8Hq5UtGxaWRRvWbfo,4421
10
10
  orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- orionis/console/commands/__publisher__.py,sha256=xVFMVU4xrhmLK_ztou5UWJ2ONpzPc1fjjJufxnetej4,21371
12
- orionis/console/commands/__workflow__.py,sha256=16fpHjkMmdVI9cCemADLqNz3U50oaLoVTapGdbigrYU,3095
11
+ orionis/console/commands/__publisher__.py,sha256=ZKAg802weVlgEndJWtdlDzU2QoQOb7ge-CuhupTqSEc,21231
13
12
  orionis/console/commands/cache_clear.py,sha256=iwdMdRLw8BAGkR-OcBB3JD9pOidC3jWT-W-DUrENywQ,3048
14
13
  orionis/console/commands/help.py,sha256=VFIn3UqQm4pxwjfSQohVwKNpc7F-6XRcwSZQwDSLEaU,3739
15
14
  orionis/console/commands/log_clear.py,sha256=OI1j_myCYUOMI-SfnN-NH-6BYzzWKXOKIEb55vFTXq4,4045
@@ -33,7 +32,7 @@ orionis/console/contracts/reactor.py,sha256=iT6ShoCutAWEeJzOf_PK7CGXi9TgrOD5tewH
33
32
  orionis/console/contracts/schedule.py,sha256=xtXgp4BPhvhg3YSM4mrIdbyoBdr4OJBi1gBM_kJN5UQ,13694
34
33
  orionis/console/contracts/schedule_event_listener.py,sha256=h06qsBxuEMD3KLSyu0JXdUDHlQW19BX9lA09Qrh2QXg,3818
35
34
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- orionis/console/core/reactor.py,sha256=p9bA-hZ7TDp8qLVMKjFWjwhY-omQcvhUYZ25bOyWWsg,44063
35
+ orionis/console/core/reactor.py,sha256=ZIiov3nKrONu_QjY61tj-vNOO082GBwoA7MTXcmQif0,43946
37
36
  orionis/console/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
37
  orionis/console/debug/dumper.py,sha256=vbmP_GlrzBj0KDjiQl4iDudPRe6V0W5r5UA8i3h9_c4,6555
39
38
  orionis/console/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -85,14 +84,14 @@ orionis/container/facades/facade.py,sha256=c9V4ywJCdux1oluzVc7ph_8-TY2Nc85k3_UeQ
85
84
  orionis/container/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
85
  orionis/container/providers/service_provider.py,sha256=OlqmBIkZSDZHJ_JZvwhNiMMrn-GzeIoCgR-HdsqGOVM,2385
87
86
  orionis/failure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
- orionis/failure/catch.py,sha256=O6C_KsSPI-ZZb8upzwGagkJMhQ6FWX7J2q9BWweMgQE,3286
87
+ orionis/failure/catch.py,sha256=EMRWQ3liYnQoyhCCvPu7nzfnWmJwKIKsPtMiGWP107o,3302
89
88
  orionis/failure/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
- orionis/failure/base/handler.py,sha256=G-SygxqdEQmlV1Bpx78n9fY3HbobZlc0l30up7U29vA,4824
89
+ orionis/failure/base/handler.py,sha256=5B6IxbGDWol7cZu7-TOrO2SXb58ozTeg1GHk6FAFkP0,5136
91
90
  orionis/failure/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
- orionis/failure/contracts/catch.py,sha256=me7o9QIliD6A62f1nTGjPapbULjhC1ZRh136s1HpF24,1193
93
- orionis/failure/contracts/handler.py,sha256=AeJfkJfD3hTkOIYAtADq6GnQfq-qWgDfUc7bYMdYKAU,2240
91
+ orionis/failure/contracts/catch.py,sha256=HCMcz08A2F_A8GoTpI4p3u7-ZqnyJXaJhP1fcFIY52w,1205
92
+ orionis/failure/contracts/handler.py,sha256=6HWe9aQKTnGHaGb8ttsaQTJO1vSiXhZDkIDvb9-sWWU,2208
94
93
  orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
- orionis/failure/entities/throwable.py,sha256=FOMR5y9ARo4xAxxPa7ZlKVf4lS8eP56LmoASZFCyblU,1236
94
+ orionis/failure/entities/throwable.py,sha256=m1DroY-SaxrJsQ8PW496lvMRIWDU8vaveGNI7CGzQGU,1313
96
95
  orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
96
  orionis/foundation/application.py,sha256=33Z6-0iT7pbZw74zHRV_z_6CLUO-huIfkd236zl0wP4,93824
98
97
  orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -207,7 +206,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
207
206
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
208
207
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
209
208
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
210
- orionis/metadata/framework.py,sha256=irs5EscS2u5eVy-KT-u6G5o8K5OB-Lely1bIvSfEk6I,4089
209
+ orionis/metadata/framework.py,sha256=JYRLl0MA62Nx9yAUFTnJjSyPkz_KUw1AVvTBzfuao-k,4089
211
210
  orionis/metadata/package.py,sha256=s1JeGJPwdVh4jO3IOfmpwMuJ_oX6Vf9NL7jgPEQNf5Y,16050
212
211
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
213
212
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -394,8 +393,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
394
393
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
395
394
  orionis/test/view/render.py,sha256=arysoswhkV2vUd2aVMZRPpmH317jaWbgjDpQ_AWQ5AE,5663
396
395
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
397
- orionis-0.669.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
398
- orionis-0.669.0.dist-info/METADATA,sha256=WueZNIt5KCJuc0SNMupb5n5xkkL-HDzdWbo7zBb5uvI,4772
399
- orionis-0.669.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
400
- orionis-0.669.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
401
- orionis-0.669.0.dist-info/RECORD,,
396
+ orionis-0.671.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
397
+ orionis-0.671.0.dist-info/METADATA,sha256=gXH_KdM2Ir4wyE-b-TI1Vj14qFb1j63WWeSrHmxqkIw,4772
398
+ orionis-0.671.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
399
+ orionis-0.671.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
400
+ orionis-0.671.0.dist-info/RECORD,,
@@ -1,83 +0,0 @@
1
- from orionis.console.base.command import BaseCommand
2
- from orionis.console.contracts.reactor import IReactor
3
- from orionis.console.exceptions import CLIOrionisRuntimeError
4
- from rich.console import Console
5
- from rich.panel import Panel
6
-
7
- class WorkFlowGithubCommand(BaseCommand):
8
- """
9
- Runs the test suite and displays the results in the Orionis CLI workflow.
10
-
11
- This command executes the project's test suite using the provided reactor. If any tests fail or errors occur,
12
- it displays a summary panel and prevents further workflow actions by raising an exception.
13
-
14
- Attributes
15
- ----------
16
- timestamps : bool
17
- Indicates whether timestamps will be shown in the command output.
18
- signature : str
19
- Command signature for invocation.
20
- description : str
21
- Brief description of the command's purpose.
22
- """
23
-
24
- # Indicates whether timestamps will be shown in the command output
25
- timestamps: bool = False
26
-
27
- # Command signature and description
28
- signature: str = "__workflow__"
29
-
30
- # Command description
31
- description: str = "Displays usage information, examples, and a list of available commands in the Orionis CLI."
32
-
33
- def handle(self, reactor: IReactor) -> None:
34
- """
35
- Displays usage information and a list of available commands for the Orionis CLI.
36
-
37
- Parameters
38
- ----------
39
- reactor : IReactor
40
- The reactor instance providing command metadata via the `info()` method.
41
-
42
- Returns
43
- -------
44
- None
45
- This method does not return any value. It prints help information to the console.
46
-
47
- Raises
48
- ------
49
- CLIOrionisRuntimeError
50
- If an unexpected error occurs during help information generation or display.
51
- """
52
- try:
53
-
54
- # Execute test suite
55
- response: dict = reactor.call("test")
56
-
57
- # Determinar si existieron errores en el test suite
58
- failed = response.get("failed", 0)
59
- errors = response.get("errors", 0)
60
-
61
- # If there are any failed tests, print a warning message
62
- if failed > 0 or errors > 0:
63
- console = Console()
64
- console.print(
65
- Panel(
66
- f"Tests failed: {failed}, Errors: {errors}",
67
- title="Test Suite Results",
68
- style="bold red"
69
- )
70
- )
71
-
72
- # If there are failed tests, we do not proceed with the publishing
73
- raise CLIOrionisRuntimeError(
74
- "Test suite failed. Please fix the issues before proceeding with the workflow."
75
- )
76
-
77
- # If all tests passed, print a success message
78
- self.info("All tests passed successfully. Proceeding with the workflow.")
79
-
80
- except Exception as e:
81
-
82
- # Raise a custom runtime error if any exception occurs
83
- raise CLIOrionisRuntimeError(f"An unexpected error occurred: {e}") from e