duty 1.5.0__py3-none-any.whl → 1.6.1__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.
- duty/__init__.py +49 -2
- duty/__main__.py +1 -1
- duty/_internal/__init__.py +0 -0
- duty/_internal/callables/__init__.py +34 -0
- duty/{callables → _internal/callables}/_io.py +2 -0
- duty/_internal/callables/autoflake.py +132 -0
- duty/_internal/callables/black.py +176 -0
- duty/_internal/callables/blacken_docs.py +92 -0
- duty/_internal/callables/build.py +76 -0
- duty/_internal/callables/coverage.py +716 -0
- duty/_internal/callables/flake8.py +222 -0
- duty/_internal/callables/git_changelog.py +178 -0
- duty/_internal/callables/griffe.py +227 -0
- duty/_internal/callables/interrogate.py +152 -0
- duty/_internal/callables/isort.py +573 -0
- duty/_internal/callables/mkdocs.py +256 -0
- duty/_internal/callables/mypy.py +496 -0
- duty/_internal/callables/pytest.py +475 -0
- duty/_internal/callables/ruff.py +399 -0
- duty/_internal/callables/safety.py +82 -0
- duty/_internal/callables/ssort.py +38 -0
- duty/_internal/callables/twine.py +284 -0
- duty/_internal/cli.py +322 -0
- duty/_internal/collection.py +246 -0
- duty/_internal/context.py +111 -0
- duty/{debug.py → _internal/debug.py} +13 -15
- duty/_internal/decorator.py +111 -0
- duty/_internal/exceptions.py +12 -0
- duty/_internal/tools/__init__.py +41 -0
- duty/{tools → _internal/tools}/_autoflake.py +8 -4
- duty/{tools → _internal/tools}/_base.py +15 -2
- duty/{tools → _internal/tools}/_black.py +5 -5
- duty/{tools → _internal/tools}/_blacken_docs.py +10 -5
- duty/{tools → _internal/tools}/_build.py +4 -4
- duty/{tools → _internal/tools}/_coverage.py +8 -4
- duty/{tools → _internal/tools}/_flake8.py +10 -12
- duty/{tools → _internal/tools}/_git_changelog.py +8 -4
- duty/{tools → _internal/tools}/_griffe.py +8 -4
- duty/{tools → _internal/tools}/_interrogate.py +4 -4
- duty/{tools → _internal/tools}/_isort.py +8 -6
- duty/{tools → _internal/tools}/_mkdocs.py +8 -4
- duty/{tools → _internal/tools}/_mypy.py +5 -5
- duty/{tools → _internal/tools}/_pytest.py +8 -4
- duty/{tools → _internal/tools}/_ruff.py +11 -5
- duty/{tools → _internal/tools}/_safety.py +13 -8
- duty/{tools → _internal/tools}/_ssort.py +10 -6
- duty/{tools → _internal/tools}/_twine.py +11 -5
- duty/_internal/tools/_yore.py +96 -0
- duty/_internal/validation.py +266 -0
- duty/callables/__init__.py +4 -4
- duty/callables/autoflake.py +11 -126
- duty/callables/black.py +12 -171
- duty/callables/blacken_docs.py +11 -86
- duty/callables/build.py +12 -71
- duty/callables/coverage.py +12 -711
- duty/callables/flake8.py +12 -217
- duty/callables/git_changelog.py +12 -173
- duty/callables/griffe.py +12 -222
- duty/callables/interrogate.py +12 -147
- duty/callables/isort.py +12 -568
- duty/callables/mkdocs.py +12 -251
- duty/callables/mypy.py +11 -490
- duty/callables/pytest.py +12 -470
- duty/callables/ruff.py +12 -394
- duty/callables/safety.py +11 -76
- duty/callables/ssort.py +12 -33
- duty/callables/twine.py +12 -279
- duty/cli.py +10 -316
- duty/collection.py +12 -228
- duty/completions.bash +9 -9
- duty/context.py +12 -107
- duty/decorator.py +12 -108
- duty/exceptions.py +13 -10
- duty/tools.py +63 -0
- duty/validation.py +12 -262
- {duty-1.5.0.dist-info → duty-1.6.1.dist-info}/METADATA +4 -3
- duty-1.6.1.dist-info/RECORD +81 -0
- {duty-1.5.0.dist-info → duty-1.6.1.dist-info}/WHEEL +1 -1
- {duty-1.5.0.dist-info → duty-1.6.1.dist-info}/entry_points.txt +1 -1
- duty/tools/__init__.py +0 -48
- duty-1.5.0.dist-info/RECORD +0 -54
- {duty-1.5.0.dist-info → duty-1.6.1.dist-info}/licenses/LICENSE +0 -0
duty/callables/interrogate.py
CHANGED
|
@@ -1,152 +1,17 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Deprecated. Use [`duty.tools.interrogate`][] instead."""
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# YORE: Bump 2: Remove file.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import warnings
|
|
6
|
+
from typing import Any
|
|
6
7
|
|
|
7
|
-
from
|
|
8
|
+
from duty._internal.callables import interrogate as _interrogate
|
|
8
9
|
|
|
9
|
-
_BADGE_STYLE = Literal["flat", "flat-square", "flat-square-modified", "for-the-badge", "plastic", "social"]
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exclude: str | None = None,
|
|
19
|
-
ignore_init_method: bool | None = None,
|
|
20
|
-
ignore_init_module: bool | None = None,
|
|
21
|
-
ignore_magic: bool | None = None,
|
|
22
|
-
ignore_module: bool | None = None,
|
|
23
|
-
ignore_nested_functions: bool | None = None,
|
|
24
|
-
ignore_nested_classes: bool | None = None,
|
|
25
|
-
ignore_private: bool | None = None,
|
|
26
|
-
ignore_property_decorators: bool | None = None,
|
|
27
|
-
ignore_setters: bool | None = None,
|
|
28
|
-
ignore_semiprivate: bool | None = None,
|
|
29
|
-
ignore_regex: str | None = None,
|
|
30
|
-
whitelist_regex: str | None = None,
|
|
31
|
-
output: str | None = None,
|
|
32
|
-
config: str | None = None,
|
|
33
|
-
color: bool | None = None,
|
|
34
|
-
omit_covered_files: bool | None = None,
|
|
35
|
-
generate_badge: str | None = None,
|
|
36
|
-
badge_format: Literal["png", "svg"] | None = None,
|
|
37
|
-
badge_style: _BADGE_STYLE | None = None,
|
|
38
|
-
) -> None:
|
|
39
|
-
"""Run `interrogate`.
|
|
40
|
-
|
|
41
|
-
Args:
|
|
42
|
-
src: Format the directories and file paths.
|
|
43
|
-
verbose: Level of verbosity.
|
|
44
|
-
quiet: Do not print output.
|
|
45
|
-
fail_under: Fail when coverage % is less than a given amount.
|
|
46
|
-
exclude: Exclude PATHs of files and/or directories.
|
|
47
|
-
ignore_init_method: Ignore `__init__` method of classes.
|
|
48
|
-
ignore_init_module: Ignore `__init__.py` modules.
|
|
49
|
-
ignore_magic: Ignore all magic methods of classes.
|
|
50
|
-
ignore_module: Ignore module-level docstrings.
|
|
51
|
-
ignore_nested_functions: Ignore nested functions and methods.
|
|
52
|
-
ignore_nested_classes: Ignore nested classes.
|
|
53
|
-
ignore_private: Ignore private classes, methods, and functions starting with two underscores.
|
|
54
|
-
ignore_property_decorators: Ignore methods with property setter/getter decorators.
|
|
55
|
-
ignore_setters: Ignore methods with property setter decorators.
|
|
56
|
-
ignore_semiprivate: Ignore semiprivate classes, methods, and functions starting with a single underscore.
|
|
57
|
-
ignore_regex: Regex identifying class, method, and function names to ignore.
|
|
58
|
-
whitelist_regex: Regex identifying class, method, and function names to include.
|
|
59
|
-
output: Write output to a given FILE.
|
|
60
|
-
config: Read configuration from pyproject.toml or setup.cfg.
|
|
61
|
-
color: Toggle color output on/off when printing to stdout.
|
|
62
|
-
omit_covered_files: Omit reporting files that have 100% documentation coverage.
|
|
63
|
-
generate_badge: Generate a shields.io status badge (an SVG image) in at a given file or directory.
|
|
64
|
-
badge_format: File format for the generated badge.
|
|
65
|
-
badge_style: Desired style of shields.io badge.
|
|
66
|
-
"""
|
|
67
|
-
from interrogate.cli import main as interrogate
|
|
68
|
-
|
|
69
|
-
cli_args: list[str] = list(src)
|
|
70
|
-
|
|
71
|
-
if verbose:
|
|
72
|
-
cli_args.append("--verbose")
|
|
73
|
-
cli_args.append(str(verbose))
|
|
74
|
-
|
|
75
|
-
if quiet:
|
|
76
|
-
cli_args.append("--quiet")
|
|
77
|
-
|
|
78
|
-
if fail_under:
|
|
79
|
-
cli_args.append("--fail-under")
|
|
80
|
-
cli_args.append(str(fail_under))
|
|
81
|
-
|
|
82
|
-
if exclude:
|
|
83
|
-
cli_args.append("--exclude")
|
|
84
|
-
cli_args.append(exclude)
|
|
85
|
-
|
|
86
|
-
if ignore_init_method:
|
|
87
|
-
cli_args.append("--ignore-init-method")
|
|
88
|
-
|
|
89
|
-
if ignore_init_module:
|
|
90
|
-
cli_args.append("--ignore-init-module")
|
|
91
|
-
|
|
92
|
-
if ignore_magic:
|
|
93
|
-
cli_args.append("--ignore-magic")
|
|
94
|
-
|
|
95
|
-
if ignore_module:
|
|
96
|
-
cli_args.append("--ignore-module")
|
|
97
|
-
|
|
98
|
-
if ignore_nested_functions:
|
|
99
|
-
cli_args.append("--ignore-nested-functions")
|
|
100
|
-
|
|
101
|
-
if ignore_nested_classes:
|
|
102
|
-
cli_args.append("--ignore-nested-classes")
|
|
103
|
-
|
|
104
|
-
if ignore_private:
|
|
105
|
-
cli_args.append("--ignore-private")
|
|
106
|
-
|
|
107
|
-
if ignore_property_decorators:
|
|
108
|
-
cli_args.append("--ignore-property-decorators")
|
|
109
|
-
|
|
110
|
-
if ignore_setters:
|
|
111
|
-
cli_args.append("--ignore-setters")
|
|
112
|
-
|
|
113
|
-
if ignore_semiprivate:
|
|
114
|
-
cli_args.append("--ignore-semiprivate")
|
|
115
|
-
|
|
116
|
-
if ignore_regex:
|
|
117
|
-
cli_args.append("--ignore-regex")
|
|
118
|
-
cli_args.append(ignore_regex)
|
|
119
|
-
|
|
120
|
-
if whitelist_regex:
|
|
121
|
-
cli_args.append("--whitelist-regex")
|
|
122
|
-
cli_args.append(whitelist_regex)
|
|
123
|
-
|
|
124
|
-
if output:
|
|
125
|
-
cli_args.append("--output")
|
|
126
|
-
cli_args.append(output)
|
|
127
|
-
|
|
128
|
-
if omit_covered_files:
|
|
129
|
-
cli_args.append("--omit-covered-files")
|
|
130
|
-
|
|
131
|
-
if generate_badge:
|
|
132
|
-
cli_args.append("--generate-badge")
|
|
133
|
-
cli_args.append(generate_badge)
|
|
134
|
-
|
|
135
|
-
if badge_format:
|
|
136
|
-
cli_args.append("--badge-format")
|
|
137
|
-
cli_args.append(badge_format)
|
|
138
|
-
|
|
139
|
-
if badge_style:
|
|
140
|
-
cli_args.append("--badge-style")
|
|
141
|
-
cli_args.append(badge_style)
|
|
142
|
-
|
|
143
|
-
if config:
|
|
144
|
-
cli_args.append("--config")
|
|
145
|
-
cli_args.append(config)
|
|
146
|
-
|
|
147
|
-
if color is True:
|
|
148
|
-
cli_args.append("--color")
|
|
149
|
-
elif color is False:
|
|
150
|
-
cli_args.append("--no-color")
|
|
151
|
-
|
|
152
|
-
interrogate(cli_args)
|
|
11
|
+
def __getattr__(name: str) -> Any:
|
|
12
|
+
warnings.warn(
|
|
13
|
+
"Callables are deprecated in favor of tools, use `duty.tools.interrogate` instead of `duty.callables.interrogate`.",
|
|
14
|
+
DeprecationWarning,
|
|
15
|
+
stacklevel=2,
|
|
16
|
+
)
|
|
17
|
+
return getattr(_interrogate, name)
|