wexample-cli 0.7.0__tar.gz → 1.0.1__tar.gz
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.
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/PKG-INFO +8 -8
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/README.md +4 -4
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/pyproject.toml +4 -4
- wexample_cli-1.0.1/src/wexample_cli/exception/abstract_command_option_exception.py +15 -0
- wexample_cli-1.0.1/src/wexample_cli/exception/command_option_missing_exception.py +19 -0
- wexample_cli-1.0.1/src/wexample_cli/exception/command_option_validation_exception.py +19 -0
- wexample_cli-0.7.0/src/wexample_cli/exception/abstract_command_option_exception.py +0 -31
- wexample_cli-0.7.0/src/wexample_cli/exception/command_option_missing_exception.py +0 -27
- wexample_cli-0.7.0/src/wexample_cli/exception/command_option_validation_exception.py +0 -17
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/command/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/command/extended_command.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/common/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/common/command_method_wrapper.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/const/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/const/middleware.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/const/tags.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/const/types.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/context/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/context/execution_context.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/alias.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/as_sudo.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/command.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/middleware.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/option.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/option_stop_on_failure.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/screenable.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/webhook.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/exception/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/helpers/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/helpers/extra_args.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/middleware/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/middleware/abstract_middleware.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/py.typed +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/testing/__init__.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/testing/kernel.py +0 -0
- {wexample_cli-0.7.0 → wexample_cli-1.0.1}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wexample-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Reusable CLI primitives — command decorators, options, middlewares, and the enriched command runner — extracted from wex-core so any kernel built on wexample-app can opt in without depending on the full wex framework.
|
|
5
5
|
Author-Email: weeger <contact@wexample.com>
|
|
6
6
|
License: MIT
|
|
@@ -10,9 +10,9 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Project-URL: homepage, https://github.com/wexample/python-cli
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
12
|
Requires-Dist: attrs>=23.1.0
|
|
13
|
-
Requires-Dist: wexample-app>=
|
|
14
|
-
Requires-Dist: wexample-helpers>=
|
|
15
|
-
Requires-Dist: wexample-prompt>=
|
|
13
|
+
Requires-Dist: wexample-app>=18.0.0
|
|
14
|
+
Requires-Dist: wexample-helpers>=15.0.0
|
|
15
|
+
Requires-Dist: wexample-prompt>=13.1.0
|
|
16
16
|
Provides-Extra: dev
|
|
17
17
|
Requires-Dist: pytest; extra == "dev"
|
|
18
18
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
@@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
|
|
21
21
|
# cli
|
|
22
22
|
|
|
23
|
-
Version: 0.
|
|
23
|
+
Version: 1.0.1
|
|
24
24
|
|
|
25
25
|
Reusable CLI primitives — command decorators, options, middlewares, and the enriched command runner — extracted from wex-core so any kernel built on wexample-app can opt in without depending on the full wex framework.
|
|
26
26
|
|
|
@@ -100,9 +100,9 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
|
|
|
100
100
|
## Dependencies
|
|
101
101
|
|
|
102
102
|
- attrs: >=23.1.0
|
|
103
|
-
- wexample-app: >=
|
|
104
|
-
- wexample-helpers: >=
|
|
105
|
-
- wexample-prompt: >=
|
|
103
|
+
- wexample-app: >=18.0.0
|
|
104
|
+
- wexample-helpers: >=15.0.0
|
|
105
|
+
- wexample-prompt: >=13.1.0
|
|
106
106
|
|
|
107
107
|
## Versioning & Compatibility Policy
|
|
108
108
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cli
|
|
2
2
|
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
|
|
5
5
|
Reusable CLI primitives — command decorators, options, middlewares, and the enriched command runner — extracted from wex-core so any kernel built on wexample-app can opt in without depending on the full wex framework.
|
|
6
6
|
|
|
@@ -80,9 +80,9 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
|
|
|
80
80
|
## Dependencies
|
|
81
81
|
|
|
82
82
|
- attrs: >=23.1.0
|
|
83
|
-
- wexample-app: >=
|
|
84
|
-
- wexample-helpers: >=
|
|
85
|
-
- wexample-prompt: >=
|
|
83
|
+
- wexample-app: >=18.0.0
|
|
84
|
+
- wexample-helpers: >=15.0.0
|
|
85
|
+
- wexample-prompt: >=13.1.0
|
|
86
86
|
|
|
87
87
|
## Versioning & Compatibility Policy
|
|
88
88
|
|
|
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "wexample-cli"
|
|
9
|
-
version = "0.
|
|
9
|
+
version = "1.0.1"
|
|
10
10
|
description = "Reusable CLI primitives — command decorators, options, middlewares, and the enriched command runner — extracted from wex-core so any kernel built on wexample-app can opt in without depending on the full wex framework."
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "weeger", email = "contact@wexample.com" },
|
|
@@ -19,9 +19,9 @@ classifiers = [
|
|
|
19
19
|
]
|
|
20
20
|
dependencies = [
|
|
21
21
|
"attrs>=23.1.0",
|
|
22
|
-
"wexample-app>=
|
|
23
|
-
"wexample-helpers>=
|
|
24
|
-
"wexample-prompt>=
|
|
22
|
+
"wexample-app>=18.0.0",
|
|
23
|
+
"wexample-helpers>=15.0.0",
|
|
24
|
+
"wexample-prompt>=13.1.0",
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
[project.readme]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import ClassVar
|
|
4
|
+
|
|
5
|
+
from wexample_helpers.classes.field import public_field
|
|
6
|
+
from wexample_helpers.decorator.base_class import base_class
|
|
7
|
+
from wexample_helpers.exception.undefined_exception import UndefinedException
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@base_class
|
|
11
|
+
class AbstractCommandOptionException(UndefinedException):
|
|
12
|
+
"""Base exception class for command option related errors."""
|
|
13
|
+
|
|
14
|
+
error_code: ClassVar[str] = "COMMAND_OPTION_ERROR"
|
|
15
|
+
option_name: str = public_field(description="Name of the command option")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import ClassVar
|
|
4
|
+
|
|
5
|
+
from wexample_helpers.decorator.base_class import base_class
|
|
6
|
+
|
|
7
|
+
from wexample_cli.exception.abstract_command_option_exception import (
|
|
8
|
+
AbstractCommandOptionException,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@base_class
|
|
13
|
+
class CommandOptionMissingException(AbstractCommandOptionException):
|
|
14
|
+
"""Exception raised when a required command option is missing."""
|
|
15
|
+
|
|
16
|
+
error_code: ClassVar[str] = "COMMAND_OPTION_MISSING"
|
|
17
|
+
|
|
18
|
+
def _build_message(self) -> str:
|
|
19
|
+
return f"Required option '{self.option_name}' is missing"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from wexample_helpers.classes.field import public_field
|
|
6
|
+
from wexample_helpers.decorator.base_class import base_class
|
|
7
|
+
|
|
8
|
+
from wexample_cli.exception.abstract_command_option_exception import (
|
|
9
|
+
AbstractCommandOptionException,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@base_class
|
|
14
|
+
class CommandOptionValidationException(AbstractCommandOptionException):
|
|
15
|
+
error_message: str = public_field(description="Validation error details")
|
|
16
|
+
value: Any = public_field(description="Invalid value provided for the option")
|
|
17
|
+
|
|
18
|
+
def _build_message(self) -> str:
|
|
19
|
+
return f'Option "{self.option_name}" validation failed: {self.error_message}'
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from wexample_helpers.exception.undefined_exception import UndefinedException
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class AbstractCommandOptionException(UndefinedException):
|
|
9
|
-
"""Base exception class for command option related errors."""
|
|
10
|
-
|
|
11
|
-
error_code: str = "COMMAND_OPTION_ERROR"
|
|
12
|
-
|
|
13
|
-
def __init__(
|
|
14
|
-
self,
|
|
15
|
-
option_name: str,
|
|
16
|
-
message: str,
|
|
17
|
-
data: dict[str, Any] | None = None,
|
|
18
|
-
cause: Exception | None = None,
|
|
19
|
-
previous: Exception | None = None,
|
|
20
|
-
) -> None:
|
|
21
|
-
# Merge provided data with base data
|
|
22
|
-
merged_data = {option_name: option_name}
|
|
23
|
-
if data:
|
|
24
|
-
merged_data.update(data)
|
|
25
|
-
|
|
26
|
-
# Store option_name as instance attribute
|
|
27
|
-
self.option_name = option_name
|
|
28
|
-
|
|
29
|
-
super().__init__(
|
|
30
|
-
message=message, data=merged_data, cause=cause, previous=previous
|
|
31
|
-
)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from wexample_cli.exception.abstract_command_option_exception import (
|
|
4
|
-
AbstractCommandOptionException,
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CommandOptionMissingException(AbstractCommandOptionException):
|
|
9
|
-
"""Exception raised when a required command option is missing."""
|
|
10
|
-
|
|
11
|
-
error_code: str = "COMMAND_OPTION_MISSING"
|
|
12
|
-
|
|
13
|
-
def __init__(
|
|
14
|
-
self,
|
|
15
|
-
option_name: str,
|
|
16
|
-
cause: Exception | None = None,
|
|
17
|
-
previous: Exception | None = None,
|
|
18
|
-
) -> None:
|
|
19
|
-
# Store option_name as instance attribute
|
|
20
|
-
self.option_name = option_name
|
|
21
|
-
|
|
22
|
-
super().__init__(
|
|
23
|
-
option_name=option_name,
|
|
24
|
-
message=f"Required option '{option_name}' is missing",
|
|
25
|
-
cause=cause,
|
|
26
|
-
previous=previous,
|
|
27
|
-
)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from wexample_cli.exception.abstract_command_option_exception import (
|
|
6
|
-
AbstractCommandOptionException,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class CommandOptionValidationException(AbstractCommandOptionException):
|
|
11
|
-
def __init__(self, option_name: str, value: Any, error_message: str) -> None:
|
|
12
|
-
super().__init__(
|
|
13
|
-
message=f'Option "{option_name}" validation failed: {error_message}',
|
|
14
|
-
option_name=option_name,
|
|
15
|
-
)
|
|
16
|
-
self.value = value
|
|
17
|
-
self.error_message = error_message
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/decorator/option_stop_on_failure.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wexample_cli-0.7.0 → wexample_cli-1.0.1}/src/wexample_cli/middleware/abstract_middleware.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|