cli-command-parser 2024.4.20__tar.gz → 2024.4.21__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.
- {cli_command_parser-2024.4.20/lib/cli_command_parser.egg-info → cli_command_parser-2024.4.21}/PKG-INFO +1 -1
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/__version__.py +1 -1
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/annotations.py +4 -2
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/commands.py +1 -1
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/exceptions.py +0 -1
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21/lib/cli_command_parser.egg-info}/PKG-INFO +1 -1
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/LICENSE +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/MANIFEST.in +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/entry_points.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/__init__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/__main__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/command_parameters.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/compat.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/config.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/context.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/__init__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/__main__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/argparse_ast.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/argparse_utils.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/cli.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/command_builder.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/utils.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/conversion/visitor.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/core.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/documentation.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/error_handling.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/formatting/__init__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/formatting/commands.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/formatting/params.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/formatting/restructured_text.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/formatting/utils.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/__init__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/base.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/choices.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/exceptions.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/files.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/numeric.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/patterns.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/time.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/utils.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/metadata.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/nargs.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/__init__.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/actions.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/base.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/choice_map.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/groups.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/option_strings.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/options.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/pass_thru.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parameters/positionals.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parse_tree.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parser.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/testing.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/typing.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/utils.py +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser.egg-info/SOURCES.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser.egg-info/dependency_links.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser.egg-info/entry_points.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser.egg-info/requires.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser.egg-info/top_level.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/pyproject.toml +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/readme.rst +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/requirements-dev.txt +0 -0
- {cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/setup.cfg +0 -0
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/__version__.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
__title__ = 'cli_command_parser'
|
|
2
2
|
__description__ = 'CLI Command Parser'
|
|
3
3
|
__url__ = 'https://github.com/dskrypa/cli_command_parser'
|
|
4
|
-
__version__ = '2024.04.
|
|
4
|
+
__version__ = '2024.04.21'
|
|
5
5
|
__author__ = 'Doug Skrypa'
|
|
6
6
|
__author_email__ = 'dskrypa@gmail.com'
|
|
7
7
|
__license__ = 'Apache 2.0'
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/annotations.py
RENAMED
|
@@ -5,8 +5,9 @@ Utilities for extracting types from annotations.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
from collections.abc import Collection, Iterable
|
|
8
|
+
from functools import lru_cache
|
|
8
9
|
from inspect import isclass
|
|
9
|
-
from typing import Union, Optional, get_type_hints, get_origin, get_args as _get_args
|
|
10
|
+
from typing import Union, Optional, get_type_hints as _get_type_hints, get_origin, get_args as _get_args
|
|
10
11
|
|
|
11
12
|
try:
|
|
12
13
|
from types import NoneType
|
|
@@ -15,9 +16,10 @@ except ImportError: # Added in 3.10
|
|
|
15
16
|
|
|
16
17
|
__all__ = ['get_descriptor_value_type']
|
|
17
18
|
|
|
19
|
+
get_type_hints = lru_cache()(_get_type_hints) # Cache the attr:annotation mapping for each Command class
|
|
20
|
+
|
|
18
21
|
|
|
19
22
|
def get_descriptor_value_type(command_cls: type, attr: str) -> Optional[type]:
|
|
20
|
-
# TODO: Optimize this to cache get_type_hints for a given class?
|
|
21
23
|
try:
|
|
22
24
|
annotation = get_type_hints(command_cls)[attr]
|
|
23
25
|
except (KeyError, NameError): # KeyError due to attr missing; NameError for forward references
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/exceptions.py
RENAMED
|
@@ -123,7 +123,6 @@ class UsageError(CommandParserException):
|
|
|
123
123
|
"""Base exception for user errors"""
|
|
124
124
|
|
|
125
125
|
message: str = None
|
|
126
|
-
# TODO: Document that this is a recommended exception type to use when performing manual input validation
|
|
127
126
|
|
|
128
127
|
|
|
129
128
|
class ParamUsageError(UsageError):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/__init__.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/compat.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/config.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/context.py
RENAMED
|
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
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/core.py
RENAMED
|
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
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/files.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/time.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/inputs/utils.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/metadata.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/nargs.py
RENAMED
|
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
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parse_tree.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/parser.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/testing.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/typing.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.4.20 → cli_command_parser-2024.4.21}/lib/cli_command_parser/utils.py
RENAMED
|
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
|