cli-command-parser 2024.5.31__tar.gz → 2024.8.17__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.5.31/lib/cli_command_parser.egg-info → cli_command_parser-2024.8.17}/PKG-INFO +1 -1
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/__version__.py +1 -1
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/documentation.py +6 -3
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/files.py +7 -4
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17/lib/cli_command_parser.egg-info}/PKG-INFO +1 -1
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/LICENSE +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/MANIFEST.in +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/entry_points.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/__init__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/__main__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/annotations.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/command_parameters.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/commands.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/compat.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/config.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/context.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/__init__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/__main__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/argparse_ast.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/argparse_utils.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/cli.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/command_builder.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/utils.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/conversion/visitor.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/core.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/error_handling.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/exceptions.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/formatting/__init__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/formatting/commands.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/formatting/params.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/formatting/restructured_text.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/formatting/utils.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/__init__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/base.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/choices.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/exceptions.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/numeric.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/patterns.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/time.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/utils.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/metadata.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/nargs.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/__init__.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/actions.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/base.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/choice_map.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/groups.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/option_strings.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/options.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/pass_thru.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parameters/positionals.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parse_tree.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parser.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/testing.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/typing.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/utils.py +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser.egg-info/SOURCES.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser.egg-info/dependency_links.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser.egg-info/entry_points.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser.egg-info/requires.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser.egg-info/top_level.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/pyproject.toml +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/readme.rst +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/requirements-dev.txt +0 -0
- {cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/setup.cfg +0 -0
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/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.
|
|
4
|
+
__version__ = '2024.08.17'
|
|
5
5
|
__author__ = 'Doug Skrypa'
|
|
6
6
|
__author_email__ = 'dskrypa@gmail.com'
|
|
7
7
|
__license__ = 'Apache 2.0'
|
|
@@ -10,6 +10,7 @@ import logging
|
|
|
10
10
|
import sys
|
|
11
11
|
from abc import ABC
|
|
12
12
|
from collections import defaultdict
|
|
13
|
+
from fnmatch import fnmatch
|
|
13
14
|
from importlib.util import module_from_spec, spec_from_file_location
|
|
14
15
|
from pathlib import Path
|
|
15
16
|
from typing import TYPE_CHECKING, Any, Iterable, Mapping
|
|
@@ -170,7 +171,7 @@ class RstWriter:
|
|
|
170
171
|
:param ext: The file extension / suffix (including the leading ``.``) to use for output.
|
|
171
172
|
:param module_template: The format string to use when generating RST for Python modules.
|
|
172
173
|
:param skip_modules: A collection of module names (using ``package.module`` notation) that should be skipped
|
|
173
|
-
when documenting a Python package via :meth:`.document_package`.
|
|
174
|
+
when documenting a Python package via :meth:`.document_package`. Supports fnmatch / glob wildcards.
|
|
174
175
|
"""
|
|
175
176
|
|
|
176
177
|
def __init__(
|
|
@@ -319,11 +320,13 @@ class RstWriter:
|
|
|
319
320
|
for path in pkg_path.iterdir():
|
|
320
321
|
if path.is_dir():
|
|
321
322
|
sub_pkg_name = f'{pkg_name}.{path.name}'
|
|
322
|
-
if self.
|
|
323
|
+
if sub_pkg_name in self.skip_modules or any(fnmatch(sub_pkg_name, pat) for pat in self.skip_modules):
|
|
324
|
+
continue
|
|
325
|
+
elif self.document_package(sub_pkg_name, path, subdir, max_depth=max_depth):
|
|
323
326
|
contents.append(sub_pkg_name)
|
|
324
327
|
elif path.is_file() and path.suffix == '.py' and not path.name.startswith('__'):
|
|
325
328
|
name = f'{pkg_name}.{path.stem}'
|
|
326
|
-
if name in self.skip_modules:
|
|
329
|
+
if name in self.skip_modules or any(fnmatch(name, pat) for pat in self.skip_modules):
|
|
327
330
|
continue
|
|
328
331
|
contents.append(name)
|
|
329
332
|
self.document_module(name, subdir)
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/files.py
RENAMED
|
@@ -85,15 +85,18 @@ class FileInput(InputType[T], ABC):
|
|
|
85
85
|
path = path.resolve()
|
|
86
86
|
if self.exists is not None:
|
|
87
87
|
if self.exists and not path.exists():
|
|
88
|
-
raise InputValidationError('
|
|
88
|
+
raise InputValidationError('the provided path does not exist')
|
|
89
89
|
elif not self.exists and path.exists():
|
|
90
|
-
raise InputValidationError('
|
|
90
|
+
raise InputValidationError('the provided path already exists')
|
|
91
|
+
|
|
91
92
|
if self.type != StatMode.ANY and path.exists() and not self.type.matches(path.stat().st_mode):
|
|
93
|
+
# TODO: Indicate what the discovered type was
|
|
92
94
|
raise InputValidationError(f'expected a {self.type}')
|
|
95
|
+
|
|
93
96
|
if self.readable and not os.access(path, os.R_OK):
|
|
94
|
-
raise InputValidationError('
|
|
97
|
+
raise InputValidationError('the provided path is not readable')
|
|
95
98
|
if self.writable and not os.access(path, os.W_OK):
|
|
96
|
-
raise InputValidationError('
|
|
99
|
+
raise InputValidationError('the provided path is not writable')
|
|
97
100
|
return path
|
|
98
101
|
|
|
99
102
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/__init__.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/__main__.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/annotations.py
RENAMED
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/commands.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/compat.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/config.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/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.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/core.py
RENAMED
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/exceptions.py
RENAMED
|
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.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/time.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/inputs/utils.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/metadata.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/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.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parse_tree.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/parser.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/testing.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/lib/cli_command_parser/typing.py
RENAMED
|
File without changes
|
{cli_command_parser-2024.5.31 → cli_command_parser-2024.8.17}/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
|