duty 1.6.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/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.6.0.dist-info → duty-1.6.1.dist-info}/METADATA +4 -3
- duty-1.6.1.dist-info/RECORD +81 -0
- {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/WHEEL +1 -1
- {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/entry_points.txt +1 -1
- duty/tools/__init__.py +0 -50
- duty/tools/_yore.py +0 -54
- duty-1.6.0.dist-info/RECORD +0 -55
- {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/licenses/LICENSE +0 -0
duty/validation.py
CHANGED
|
@@ -1,267 +1,17 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Deprecated. Import from `duty` directly."""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
effectively checking all CLI arguments and failing early
|
|
5
|
-
if they are incorrect.
|
|
6
|
-
"""
|
|
3
|
+
# YORE: Bump 2: Remove file.
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
import warnings
|
|
6
|
+
from typing import Any
|
|
9
7
|
|
|
10
|
-
import
|
|
11
|
-
import textwrap
|
|
12
|
-
from contextlib import suppress
|
|
13
|
-
from functools import cached_property, partial
|
|
14
|
-
from inspect import Parameter, Signature, signature
|
|
15
|
-
from typing import TYPE_CHECKING, Any, Callable, ForwardRef, Union, get_args, get_origin
|
|
8
|
+
from duty._internal import validation
|
|
16
9
|
|
|
17
|
-
if TYPE_CHECKING:
|
|
18
|
-
from collections.abc import Sequence
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
from typing import _eval_type # type: ignore[attr-defined]
|
|
28
|
-
|
|
29
|
-
if sys.version_info >= (3, 13):
|
|
30
|
-
eval_type = partial(_eval_type, type_params=None)
|
|
31
|
-
else:
|
|
32
|
-
eval_type = _eval_type
|
|
33
|
-
union_types = (Union, UnionType)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def to_bool(value: str) -> bool:
|
|
37
|
-
"""Convert a string to a boolean.
|
|
38
|
-
|
|
39
|
-
Parameters:
|
|
40
|
-
value: The string to convert.
|
|
41
|
-
|
|
42
|
-
Returns:
|
|
43
|
-
True or False.
|
|
44
|
-
"""
|
|
45
|
-
return value.lower() not in {"", "0", "no", "n", "false", "off"}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def cast_arg(arg: Any, annotation: Any) -> Any:
|
|
49
|
-
"""Cast an argument using a type annotation.
|
|
50
|
-
|
|
51
|
-
Parameters:
|
|
52
|
-
arg: The argument value.
|
|
53
|
-
annotation: A type annotation.
|
|
54
|
-
|
|
55
|
-
Returns:
|
|
56
|
-
The cast value.
|
|
57
|
-
"""
|
|
58
|
-
if annotation is Parameter.empty:
|
|
59
|
-
return arg
|
|
60
|
-
if annotation is bool:
|
|
61
|
-
annotation = to_bool
|
|
62
|
-
if get_origin(annotation) in union_types:
|
|
63
|
-
for sub_annotation in get_args(annotation):
|
|
64
|
-
if sub_annotation is type(None):
|
|
65
|
-
continue
|
|
66
|
-
with suppress(Exception):
|
|
67
|
-
return cast_arg(arg, sub_annotation)
|
|
68
|
-
try:
|
|
69
|
-
return annotation(arg)
|
|
70
|
-
except Exception: # noqa: BLE001
|
|
71
|
-
return arg
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class ParamsCaster:
|
|
75
|
-
"""A helper class to cast parameters based on a function's signature annotations."""
|
|
76
|
-
|
|
77
|
-
def __init__(self, signature: Signature) -> None:
|
|
78
|
-
"""Initialize the object.
|
|
79
|
-
|
|
80
|
-
Parameters:
|
|
81
|
-
signature: The signature to use to cast arguments.
|
|
82
|
-
"""
|
|
83
|
-
self.params_dict = signature.parameters
|
|
84
|
-
self.params_list = list(self.params_dict.values())
|
|
85
|
-
|
|
86
|
-
@cached_property
|
|
87
|
-
def var_positional_position(self) -> int:
|
|
88
|
-
"""Give the position of the variable positional parameter in the signature.
|
|
89
|
-
|
|
90
|
-
Returns:
|
|
91
|
-
The position of the variable positional parameter.
|
|
92
|
-
"""
|
|
93
|
-
for pos, param in enumerate(self.params_list):
|
|
94
|
-
if param.kind is Parameter.VAR_POSITIONAL:
|
|
95
|
-
return pos
|
|
96
|
-
return -1
|
|
97
|
-
|
|
98
|
-
@cached_property
|
|
99
|
-
def has_var_positional(self) -> bool:
|
|
100
|
-
"""Tell if there is a variable positional parameter.
|
|
101
|
-
|
|
102
|
-
Returns:
|
|
103
|
-
True or False.
|
|
104
|
-
"""
|
|
105
|
-
return self.var_positional_position >= 0
|
|
106
|
-
|
|
107
|
-
@cached_property
|
|
108
|
-
def var_positional_annotation(self) -> Any:
|
|
109
|
-
"""Give the variable positional parameter (`*args`) annotation if any.
|
|
110
|
-
|
|
111
|
-
Returns:
|
|
112
|
-
The variable positional parameter annotation.
|
|
113
|
-
"""
|
|
114
|
-
return self.params_list[self.var_positional_position].annotation
|
|
115
|
-
|
|
116
|
-
@cached_property
|
|
117
|
-
def var_keyword_annotation(self) -> Any:
|
|
118
|
-
"""Give the variable keyword parameter (`**kwargs`) annotation if any.
|
|
119
|
-
|
|
120
|
-
Returns:
|
|
121
|
-
The variable keyword parameter annotation.
|
|
122
|
-
"""
|
|
123
|
-
for param in self.params_list:
|
|
124
|
-
if param.kind is Parameter.VAR_KEYWORD:
|
|
125
|
-
return param.annotation
|
|
126
|
-
return Parameter.empty
|
|
127
|
-
|
|
128
|
-
def annotation_at_pos(self, pos: int) -> Any:
|
|
129
|
-
"""Give the annotation for the parameter at the given position.
|
|
130
|
-
|
|
131
|
-
Parameters:
|
|
132
|
-
pos: The position of the parameter.
|
|
133
|
-
|
|
134
|
-
Returns:
|
|
135
|
-
The positional parameter annotation.
|
|
136
|
-
"""
|
|
137
|
-
return self.params_list[pos].annotation
|
|
138
|
-
|
|
139
|
-
def eaten_by_var_positional(self, pos: int) -> bool:
|
|
140
|
-
"""Tell if the parameter at this position is eaten by a variable positional parameter.
|
|
141
|
-
|
|
142
|
-
Parameters:
|
|
143
|
-
pos: The position of the parameter.
|
|
144
|
-
|
|
145
|
-
Returns:
|
|
146
|
-
Whether the parameter is eaten.
|
|
147
|
-
"""
|
|
148
|
-
return self.has_var_positional and pos >= self.var_positional_position
|
|
149
|
-
|
|
150
|
-
def cast_posarg(self, pos: int, arg: Any) -> Any:
|
|
151
|
-
"""Cast a positional argument.
|
|
152
|
-
|
|
153
|
-
Parameters:
|
|
154
|
-
pos: The position of the argument in the signature.
|
|
155
|
-
arg: The argument value.
|
|
156
|
-
|
|
157
|
-
Returns:
|
|
158
|
-
The cast value.
|
|
159
|
-
"""
|
|
160
|
-
if self.eaten_by_var_positional(pos):
|
|
161
|
-
return cast_arg(arg, self.var_positional_annotation)
|
|
162
|
-
return cast_arg(arg, self.annotation_at_pos(pos))
|
|
163
|
-
|
|
164
|
-
def cast_kwarg(self, name: str, value: Any) -> Any:
|
|
165
|
-
"""Cast a keyword argument.
|
|
166
|
-
|
|
167
|
-
Parameters:
|
|
168
|
-
name: The name of the argument in the signature.
|
|
169
|
-
value: The argument value.
|
|
170
|
-
|
|
171
|
-
Returns:
|
|
172
|
-
The cast value.
|
|
173
|
-
"""
|
|
174
|
-
if name in self.params_dict:
|
|
175
|
-
return cast_arg(value, self.params_dict[name].annotation)
|
|
176
|
-
return cast_arg(value, self.var_keyword_annotation)
|
|
177
|
-
|
|
178
|
-
def cast(self, *args: Any, **kwargs: Any) -> tuple[Sequence, dict[str, Any]]:
|
|
179
|
-
"""Cast all positional and keyword arguments.
|
|
180
|
-
|
|
181
|
-
Parameters:
|
|
182
|
-
*args: The positional arguments.
|
|
183
|
-
**kwargs: The keyword arguments.
|
|
184
|
-
|
|
185
|
-
Returns:
|
|
186
|
-
The cast arguments.
|
|
187
|
-
"""
|
|
188
|
-
positional = tuple(self.cast_posarg(pos, arg) for pos, arg in enumerate(args))
|
|
189
|
-
keyword = {name: self.cast_kwarg(name, value) for name, value in kwargs.items()}
|
|
190
|
-
return positional, keyword
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
def _get_params_caster(func: Callable, *args: Any, **kwargs: Any) -> ParamsCaster:
|
|
194
|
-
duties_module = sys.modules[func.__module__]
|
|
195
|
-
exec_globals = dict(duties_module.__dict__)
|
|
196
|
-
eval_str = False
|
|
197
|
-
for name in list(exec_globals.keys()):
|
|
198
|
-
if exec_globals[name] is annotations:
|
|
199
|
-
eval_str = True
|
|
200
|
-
del exec_globals[name]
|
|
201
|
-
break
|
|
202
|
-
exec_globals["__context_above"] = {}
|
|
203
|
-
|
|
204
|
-
# Don't keep first parameter: context.
|
|
205
|
-
params = list(signature(func).parameters.values())[1:]
|
|
206
|
-
params_no_types = [Parameter(param.name, param.kind, default=param.default) for param in params]
|
|
207
|
-
code_sig = Signature(parameters=params_no_types)
|
|
208
|
-
if eval_str:
|
|
209
|
-
params_types = [
|
|
210
|
-
Parameter(
|
|
211
|
-
param.name,
|
|
212
|
-
param.kind,
|
|
213
|
-
default=param.default,
|
|
214
|
-
annotation=(
|
|
215
|
-
eval_type(
|
|
216
|
-
ForwardRef(param.annotation) if isinstance(param.annotation, str) else param.annotation,
|
|
217
|
-
exec_globals,
|
|
218
|
-
{},
|
|
219
|
-
)
|
|
220
|
-
if param.annotation is not Parameter.empty
|
|
221
|
-
else type(param.default)
|
|
222
|
-
),
|
|
223
|
-
)
|
|
224
|
-
for param in params
|
|
225
|
-
]
|
|
226
|
-
else:
|
|
227
|
-
params_types = params
|
|
228
|
-
cast_sig = Signature(parameters=params_types)
|
|
229
|
-
|
|
230
|
-
code = f"""
|
|
231
|
-
import inspect
|
|
232
|
-
def {func.__name__}{code_sig}: ...
|
|
233
|
-
__context_above['func'] = {func.__name__}
|
|
234
|
-
"""
|
|
235
|
-
|
|
236
|
-
exec(textwrap.dedent(code), exec_globals) # noqa: S102
|
|
237
|
-
func = exec_globals["__context_above"]["func"]
|
|
238
|
-
|
|
239
|
-
# Trigger TypeError early.
|
|
240
|
-
func(*args, **kwargs)
|
|
241
|
-
|
|
242
|
-
return ParamsCaster(cast_sig)
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
def validate(
|
|
246
|
-
func: Callable,
|
|
247
|
-
*args: Any,
|
|
248
|
-
**kwargs: Any,
|
|
249
|
-
) -> tuple[Sequence, dict[str, Any]]:
|
|
250
|
-
"""Validate positional and keyword arguments against a function.
|
|
251
|
-
|
|
252
|
-
First we clone the function, removing the first parameter (the context)
|
|
253
|
-
and the body, to fail early with a `TypeError` if the arguments
|
|
254
|
-
are incorrect: not enough, too much, in the wrong order, etc.
|
|
255
|
-
|
|
256
|
-
Then we cast all the arguments using the function's signature
|
|
257
|
-
and we return them.
|
|
258
|
-
|
|
259
|
-
Parameters:
|
|
260
|
-
func: The function to copy.
|
|
261
|
-
*args: The positional arguments.
|
|
262
|
-
**kwargs: The keyword arguments.
|
|
263
|
-
|
|
264
|
-
Returns:
|
|
265
|
-
The casted arguments.
|
|
266
|
-
"""
|
|
267
|
-
return _get_params_caster(func, *args, **kwargs).cast(*args, **kwargs)
|
|
11
|
+
def __getattr__(name: str) -> Any:
|
|
12
|
+
warnings.warn(
|
|
13
|
+
"Importing from `duty.validation` is deprecated. Import from `duty` directly.",
|
|
14
|
+
DeprecationWarning,
|
|
15
|
+
stacklevel=2,
|
|
16
|
+
)
|
|
17
|
+
return getattr(validation, name)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: duty
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.1
|
|
4
4
|
Summary: A simple task runner.
|
|
5
5
|
Keywords: task-runner,task,runner,cross-platform
|
|
6
6
|
Author-Email: =?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>
|
|
7
|
-
License: ISC
|
|
7
|
+
License-Expression: ISC
|
|
8
|
+
License-File: LICENSE
|
|
8
9
|
Classifier: Development Status :: 4 - Beta
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
11
|
Classifier: Programming Language :: Python
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
duty-1.6.1.dist-info/METADATA,sha256=wUis3xequONblHXQ95AUmSDmGC5fsZrr81l9WksILmE,2743
|
|
2
|
+
duty-1.6.1.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
|
3
|
+
duty-1.6.1.dist-info/entry_points.txt,sha256=aCE5QWIgzL6DnOQTeLmwnOqbV70ERZQ71hFYXAiMDwU,51
|
|
4
|
+
duty-1.6.1.dist-info/licenses/LICENSE,sha256=nQxdYSduhkgEpOTmg4yyIMmFPzcr2qrlUl8Tf9QZPug,754
|
|
5
|
+
duty/__init__.py,sha256=XYIKFqVvQCBDPNCtsCwPpN_mEnKRas5_103x9tdx3Vg,1205
|
|
6
|
+
duty/__main__.py,sha256=uzZGmlxuxHwn-rBp8axUwB57GcnmPGcFmDVHArwrrdI,343
|
|
7
|
+
duty/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
duty/_internal/callables/__init__.py,sha256=q8T0yhzhEr5CoEbe5nshCBqolZXaL0111ovxG61SVYs,900
|
|
9
|
+
duty/_internal/callables/_io.py,sha256=iT38ccmwh33ObJqwzbRlOKuA5k74JnmaA31HIF4LBTM,397
|
|
10
|
+
duty/_internal/callables/autoflake.py,sha256=llew_D1RNi-bfDLkgOMYDdfIxaezoCcNRwqbXkxtzAw,4682
|
|
11
|
+
duty/_internal/callables/black.py,sha256=_JVOqZauPmHHf7E3R0FOfFYqv8mB9YL6IFOCPXeV06w,7136
|
|
12
|
+
duty/_internal/callables/blacken_docs.py,sha256=6KsXjPUFvUIPje-8P-_oo_yvJ7ON3NThxj7WeV4-blE,3476
|
|
13
|
+
duty/_internal/callables/build.py,sha256=hx_lwvacJlNdAol5YDXciG98m25fGi-bt1AI1mUbZb8,2132
|
|
14
|
+
duty/_internal/callables/coverage.py,sha256=zuwj-N2BCQnuMPodxJ0DVvQYCbM3pmizvdMMCofrI6w,23812
|
|
15
|
+
duty/_internal/callables/flake8.py,sha256=N0oN53jY6uDOgodq_LVNBPFSCWSwcht5l2QNQ8lZt4A,8455
|
|
16
|
+
duty/_internal/callables/git_changelog.py,sha256=c4nFFZ8LC7ujLrs3VzR0qatL2aHBgFEAU-X7EDRk8vg,7418
|
|
17
|
+
duty/_internal/callables/griffe.py,sha256=3NSMOotrs2Y4MY0MpBx-co4yS6SpaInF8CgDsqhz38Q,7363
|
|
18
|
+
duty/_internal/callables/interrogate.py,sha256=mpFslHtrJ-qMb16Uw_ok7AN4nu3e1Ow0uVxfSJALQgI,5025
|
|
19
|
+
duty/_internal/callables/isort.py,sha256=pALvF3c-2AERkyKmnB1OpGnI2O13Y_IV9RL_onkI7mI,26418
|
|
20
|
+
duty/_internal/callables/mkdocs.py,sha256=PGwkboio8SBrw3desN4gt5JlkX-X45j_ziR4NRJxY2M,7880
|
|
21
|
+
duty/_internal/callables/mypy.py,sha256=hzqk_jMfgL7FdCez7z68kOe7IMLf9KtcDRKYxGEk_CM,19789
|
|
22
|
+
duty/_internal/callables/pytest.py,sha256=Vv5qKujH0k5mdMUlevjjiMwxsvmgMwQJlTdGfNWX0Lg,18310
|
|
23
|
+
duty/_internal/callables/ruff.py,sha256=2M1QlhomQodZNWpzFbGrbrfH_eq-YILIu0a0JbWtvMI,13293
|
|
24
|
+
duty/_internal/callables/safety.py,sha256=s1GQhqirYuq3sCESTrmH1v20F3cFy5iMEg4LJsDkOXg,2485
|
|
25
|
+
duty/_internal/callables/ssort.py,sha256=NY6yDLZBp5cHYxBMWryP2eZdBCNwDtK5kpJ1v35eMAA,819
|
|
26
|
+
duty/_internal/callables/twine.py,sha256=IEAs1VkaCv5YlfNUJcjWxQ2uotAbqnL1XAis0babfVU,9493
|
|
27
|
+
duty/_internal/cli.py,sha256=Ird5T_zn11SSKTHcyRs8HdeWp_0AwncOU_Jejgpy2l8,9304
|
|
28
|
+
duty/_internal/collection.py,sha256=Qk1e2T2aGL_YoOaoHmSbGg4FmhyWeJSYA492nu1R7go,8297
|
|
29
|
+
duty/_internal/context.py,sha256=y3VZNJx0Vc3E5oKMUKNG-o7i2jgqOFgORq_4IE6Itmc,3300
|
|
30
|
+
duty/_internal/debug.py,sha256=l27dhHiH7jvm_7sCpxFAlJnGgQgF3QeKweOs_zjN4iM,2837
|
|
31
|
+
duty/_internal/decorator.py,sha256=cWN2I7vrbQIixoYkA26oBUwSgG_rYRDeg4j_67j25Is,2946
|
|
32
|
+
duty/_internal/exceptions.py,sha256=4qCbjn1bddKjvgCQKsO7tIsO8uWoDH-PgtoIj_qZobc,362
|
|
33
|
+
duty/_internal/tools/__init__.py,sha256=N-hxkwzRE-G-MLT5uuBiIdFNglqQdUH2w5Pb86ELsDc,1203
|
|
34
|
+
duty/_internal/tools/_autoflake.py,sha256=Y2y5KujdJILc6tJMTdRuXivcleB969LTSnPu6JA6eAM,5389
|
|
35
|
+
duty/_internal/tools/_base.py,sha256=bWRNoN56kkgfHpp_W4VGVV2U7Xo1LeimWeFPFZeuxpk,2044
|
|
36
|
+
duty/_internal/tools/_black.py,sha256=C4jxcLbMLMYmDm6FnLvXmBV-mVYOqjynmfiOqZZyZkg,7945
|
|
37
|
+
duty/_internal/tools/_blacken_docs.py,sha256=dRPTA5vWvI2vFmYosFBE7rNYXuLutOKSULVxT6_EU3o,5124
|
|
38
|
+
duty/_internal/tools/_build.py,sha256=LGEhEzxCtgEKLcp7jpVod2O10BT3oBGExEt1pPl-QIw,2611
|
|
39
|
+
duty/_internal/tools/_coverage.py,sha256=o_GoVXAy7eLw1bZaQhrcBm-8yfhOG25K8fuvVr1pruA,26441
|
|
40
|
+
duty/_internal/tools/_flake8.py,sha256=2xHoNG_nxL7TEDLn6qpbjq9ppTF25lAenV-D57H_pJw,9339
|
|
41
|
+
duty/_internal/tools/_git_changelog.py,sha256=KxctfBTgD5f_BXBv1nRlQK8Qx62mp7IUtazgN8aIPYU,8341
|
|
42
|
+
duty/_internal/tools/_griffe.py,sha256=5JpOAMgfnoFWJK8vCULaKwXlq_w4toY0LXxZPvqCeoI,8043
|
|
43
|
+
duty/_internal/tools/_interrogate.py,sha256=GyInYCyzcxUBxDvJkMHlZ38GrYcmMSf_l3I2tMMVtSE,5757
|
|
44
|
+
duty/_internal/tools/_isort.py,sha256=cXKqQj-ReYm0pfH41P6l3tdObdtDfkAUcjOUrRAXQks,28413
|
|
45
|
+
duty/_internal/tools/_mkdocs.py,sha256=5-6dJi9S59fDAirNN3RKMpo-Er-fNDp8eT8tdFXENyE,9136
|
|
46
|
+
duty/_internal/tools/_mypy.py,sha256=xvAmy2JTo2jXd_Z1KGpQHg7SaZa6d5lE6Rsz35ksMI4,21592
|
|
47
|
+
duty/_internal/tools/_pytest.py,sha256=FHoCXDZ6fZoWVD5yI1-IHvtXbVebxI4UarKqIQHXUb8,20160
|
|
48
|
+
duty/_internal/tools/_ruff.py,sha256=JNuXrSwaWesKn7ad6uRZL4suJFlAlAusN6_kU0EkW5w,15402
|
|
49
|
+
duty/_internal/tools/_safety.py,sha256=MGFZ3xJ2JqlHQTEfnRaprQl1_Pi6iKCvSzbUC6zlIAY,3418
|
|
50
|
+
duty/_internal/tools/_ssort.py,sha256=s8kxAazD0pbbMsvXK_6xmJUVF1tlXCQuCjmL2zCxawA,1199
|
|
51
|
+
duty/_internal/tools/_twine.py,sha256=GF5FJbyo5-4sx1rGuz5xd9Vy_uIiTVWA_kF3rBpoICY,10519
|
|
52
|
+
duty/_internal/tools/_yore.py,sha256=wNa7ZeSOg5Ai5ORVVs2kBk3_IJdDqcjGrstbeBjDI1E,3492
|
|
53
|
+
duty/_internal/validation.py,sha256=w9jbHd-uZz-ZSbnQj5w4N3v-BLhEYOXVIgl1PU3-lfY,8352
|
|
54
|
+
duty/callables/__init__.py,sha256=soGDrmBeiJrdSRfx1hFNZWZ6BBglvG4AJ3iJb6_IWug,1071
|
|
55
|
+
duty/callables/autoflake.py,sha256=2maCJm-gzSIhjxyAZmMQqw2cUQjgIir66eMScvcwDDE,460
|
|
56
|
+
duty/callables/black.py,sha256=aWb5qjYzFvBYMIoQPfYikaDf4r50T6mi2ERiLBAQUQQ,436
|
|
57
|
+
duty/callables/blacken_docs.py,sha256=BUUcor4Gr6OXpx3RT4uSPkDTRVDgHhtlkVvUa6K_DPk,478
|
|
58
|
+
duty/callables/build.py,sha256=qoYxMqv_6E1p778aVmmTMfzrdjZ_QLRNO8BDpWxBCaM,436
|
|
59
|
+
duty/callables/coverage.py,sha256=FbjXRQRsyuzYRtt5m-LhxIECpRvVriB_fDHCeXn2Y7k,454
|
|
60
|
+
duty/callables/flake8.py,sha256=ZZy-ixk087-rBXogKvYogRe0hEAr22_buaZp7RCoaMI,442
|
|
61
|
+
duty/callables/git_changelog.py,sha256=72DLnOdA5Puj1Un1oEo6L11a9dB0TzMAX1ZYYU7XtAs,484
|
|
62
|
+
duty/callables/griffe.py,sha256=JF8kl1z_3a2FSnHG-RBHp8o0FocKcQmVJPyHOPdD1po,442
|
|
63
|
+
duty/callables/interrogate.py,sha256=Kv8BvM1HIoM__SAn6TEHPAZ-ggodtGoh4Ief6rxMYS4,472
|
|
64
|
+
duty/callables/isort.py,sha256=O2PhRqPHF6mjOpJl8WKXP4wrCIh6a36xsw8TLMna_QM,436
|
|
65
|
+
duty/callables/mkdocs.py,sha256=ZuaO5JLZ_L7dI91DdxHgGqsIZHEn8Ohh7e-D85EheMw,442
|
|
66
|
+
duty/callables/mypy.py,sha256=hAVrIQ6UHPeNBU5eRY0jyeS4SQrifhcCDpiMiuM39Y4,430
|
|
67
|
+
duty/callables/pytest.py,sha256=B_y6eswkAnYSUrfyvFFedcy7IzfF0_4TTGmo3dTgEwU,442
|
|
68
|
+
duty/callables/ruff.py,sha256=8qQQgJoPII_gJlETcwfhUxAd_2ZrL1du1HzTmIx78bk,430
|
|
69
|
+
duty/callables/safety.py,sha256=IeJXp_ROZtDaK7Ff7ETuF9O_mSkJLoWmfMP_LWdDl3E,442
|
|
70
|
+
duty/callables/ssort.py,sha256=AmyMiYgg5Qg4RZGOUGah_tUkip9eroB7cbqA3eNCS3I,436
|
|
71
|
+
duty/callables/twine.py,sha256=ujGzOnRfH1XLMNgEINJC0HrumcSfrVu5RUKad94T2Tc,436
|
|
72
|
+
duty/cli.py,sha256=ZHlAxwDCOmNCiIpM1EobENwwJsH5x5c9qO_7nRLINYo,372
|
|
73
|
+
duty/collection.py,sha256=ddjTQTcsPoUBL5exzouKd7u_IJqGKn9qBWZLju4ZdIk,393
|
|
74
|
+
duty/completions.bash,sha256=7-JMwnzlvRLGv3eK55dIahDsuQCqmAGSLvxXRyeQ60M,1293
|
|
75
|
+
duty/context.py,sha256=r43nNaELqXJ7w1XdEKgmlPPa22FH_qS5Sk9XNmh1CZI,384
|
|
76
|
+
duty/decorator.py,sha256=NPRfykzeju_Ta2r2iaO8JlbZ0GcFdP8trsOVIx7AqDo,390
|
|
77
|
+
duty/exceptions.py,sha256=p36-9D47b-gWPd_HZoUKl0nivaaLJiuAbNHe3TTYr7w,393
|
|
78
|
+
duty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
+
duty/tools.py,sha256=sKKM9CBFswtC4devluN0knegv8b4mhv4DBBfJwMDgx0,1208
|
|
80
|
+
duty/validation.py,sha256=U-fSrcMVgKyTCOczNS_TsSNF03U1DVgEg0BF3rJAySo,393
|
|
81
|
+
duty-1.6.1.dist-info/RECORD,,
|
duty/tools/__init__.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"""Module containing callables for many tools."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from failprint.lazy import lazy
|
|
6
|
-
|
|
7
|
-
from duty.tools._autoflake import autoflake
|
|
8
|
-
from duty.tools._base import LazyStderr, LazyStdout, Tool
|
|
9
|
-
from duty.tools._black import black
|
|
10
|
-
from duty.tools._blacken_docs import blacken_docs
|
|
11
|
-
from duty.tools._build import build
|
|
12
|
-
from duty.tools._coverage import coverage
|
|
13
|
-
from duty.tools._flake8 import flake8
|
|
14
|
-
from duty.tools._git_changelog import git_changelog
|
|
15
|
-
from duty.tools._griffe import griffe
|
|
16
|
-
from duty.tools._interrogate import interrogate
|
|
17
|
-
from duty.tools._isort import isort
|
|
18
|
-
from duty.tools._mkdocs import mkdocs
|
|
19
|
-
from duty.tools._mypy import mypy
|
|
20
|
-
from duty.tools._pytest import pytest
|
|
21
|
-
from duty.tools._ruff import ruff
|
|
22
|
-
from duty.tools._safety import safety
|
|
23
|
-
from duty.tools._ssort import ssort
|
|
24
|
-
from duty.tools._twine import twine
|
|
25
|
-
from duty.tools._yore import yore
|
|
26
|
-
|
|
27
|
-
__all__ = [
|
|
28
|
-
"LazyStderr",
|
|
29
|
-
"LazyStdout",
|
|
30
|
-
"Tool",
|
|
31
|
-
"autoflake",
|
|
32
|
-
"black",
|
|
33
|
-
"blacken_docs",
|
|
34
|
-
"build",
|
|
35
|
-
"coverage",
|
|
36
|
-
"flake8",
|
|
37
|
-
"git_changelog",
|
|
38
|
-
"griffe",
|
|
39
|
-
"interrogate",
|
|
40
|
-
"isort",
|
|
41
|
-
"lazy",
|
|
42
|
-
"mkdocs",
|
|
43
|
-
"mypy",
|
|
44
|
-
"pytest",
|
|
45
|
-
"ruff",
|
|
46
|
-
"safety",
|
|
47
|
-
"ssort",
|
|
48
|
-
"twine",
|
|
49
|
-
"yore",
|
|
50
|
-
]
|
duty/tools/_yore.py
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"""Callable for [Yore](https://github.com/pawamoy/yore)."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from duty.tools._base import Tool
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class yore(Tool): # noqa: N801
|
|
9
|
-
"""Call [Yore](https://github.com/pawamoy/yore)."""
|
|
10
|
-
|
|
11
|
-
cli_name = "yore"
|
|
12
|
-
|
|
13
|
-
@classmethod
|
|
14
|
-
def check(
|
|
15
|
-
cls,
|
|
16
|
-
*paths: str,
|
|
17
|
-
bump: str | None = None,
|
|
18
|
-
eol_within: str | None = None,
|
|
19
|
-
bol_within: str | None = None,
|
|
20
|
-
) -> yore:
|
|
21
|
-
"""Checks Yore comments against Python EOL dates or the provided next version of your project.
|
|
22
|
-
|
|
23
|
-
Parameters:
|
|
24
|
-
paths: Path to files or directories to check.
|
|
25
|
-
bump: The next version of your project.
|
|
26
|
-
eol_within: The time delta to start checking before the End of Life of a Python version.
|
|
27
|
-
It is provided in a human-readable format, like `2 weeks` or `1 month`.
|
|
28
|
-
Spaces are optional, and the unit can be shortened to a single letter:
|
|
29
|
-
`d` for days, `w` for weeks, `m` for months, and `y` for years.
|
|
30
|
-
bol_within: The time delta to start checking before the Beginning of Life of a Python version.
|
|
31
|
-
It is provided in a human-readable format, like `2 weeks` or `1 month`.
|
|
32
|
-
Spaces are optional, and the unit can be shortened to a single letter:
|
|
33
|
-
`d` for days, `w` for weeks, `m` for months, and `y` for years.
|
|
34
|
-
"""
|
|
35
|
-
cli_args = ["check", *paths]
|
|
36
|
-
|
|
37
|
-
if bump:
|
|
38
|
-
cli_args.append("--bump")
|
|
39
|
-
cli_args.append(bump)
|
|
40
|
-
|
|
41
|
-
if eol_within:
|
|
42
|
-
cli_args.append("--eol-within")
|
|
43
|
-
cli_args.append(eol_within)
|
|
44
|
-
|
|
45
|
-
if bol_within:
|
|
46
|
-
cli_args.append("--bol-within")
|
|
47
|
-
cli_args.append(bol_within)
|
|
48
|
-
|
|
49
|
-
return cls(cli_args)
|
|
50
|
-
|
|
51
|
-
def __call__(self) -> int:
|
|
52
|
-
from yore import main as run_yore
|
|
53
|
-
|
|
54
|
-
return run_yore(self.cli_args)
|
duty-1.6.0.dist-info/RECORD
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
duty-1.6.0.dist-info/METADATA,sha256=wUMy0aPyCI_pbGwg8EpYXorgI5-I_hHo9rr6uA1lNdo,2710
|
|
2
|
-
duty-1.6.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
3
|
-
duty-1.6.0.dist-info/entry_points.txt,sha256=XZTh9yTgC9GDFmNoVeOqgKT6BCMifkCToilIj77B9ss,55
|
|
4
|
-
duty-1.6.0.dist-info/licenses/LICENSE,sha256=nQxdYSduhkgEpOTmg4yyIMmFPzcr2qrlUl8Tf9QZPug,754
|
|
5
|
-
duty/__init__.py,sha256=2fdBMNEBXYSCnV1GQm56VGe8VuvMp79-Hj3SHrAb5MM,144
|
|
6
|
-
duty/__main__.py,sha256=4YvloGDKmyVzOsE6ZdyCQyY0Jsl0LSlbqkO2UDExgmI,333
|
|
7
|
-
duty/callables/__init__.py,sha256=R42f1qpIy7m2MMbs6Xc_OnQiEARr4g2Pghpp9ry4JFI,1042
|
|
8
|
-
duty/callables/_io.py,sha256=vrMLd7ggCFDy8coWUqntmxgKC9BvFu8smK4pK2S7EeA,367
|
|
9
|
-
duty/callables/autoflake.py,sha256=5IUL2TUfrbWUs_-TBjzqsSHJOxGFiGtBuWBV6AIYdu4,4699
|
|
10
|
-
duty/callables/black.py,sha256=c2gWuhESEWRi1JGKAlMF_ZLoVJ5_bHLd7c4Lg0qyuX8,7153
|
|
11
|
-
duty/callables/blacken_docs.py,sha256=OMKrfIZ1ZN6_h8SFGCBcnFCnlonQkkuRY7Vl-B2eGB0,3497
|
|
12
|
-
duty/callables/build.py,sha256=_cF8B3HKy3BWsTSLfpKwhxkZ0JVhfB3v1Zh2eO1FnQw,2150
|
|
13
|
-
duty/callables/coverage.py,sha256=3F2DeHyB-L-Y4v_qJU3TIGPNISnX_Nwn79JtmdE-a-0,23843
|
|
14
|
-
duty/callables/flake8.py,sha256=3uqFdZUF3B35Zc-otjrZfUQgEQkQ3ecZd0ZlEH83sZc,8476
|
|
15
|
-
duty/callables/git_changelog.py,sha256=UVojhK44Qx6wFVDQIDaqd2aMl7m3iZxQTErHVZpBMfQ,7455
|
|
16
|
-
duty/callables/griffe.py,sha256=J1ji2OFuGXvg-Pa9a1LXeolesk2EViiToNtrV4WBuuM,7391
|
|
17
|
-
duty/callables/interrogate.py,sha256=ZtpryCRAHXVumRJ5SUBib8lBxAcXmdZxGZvIXiiZ2C8,5060
|
|
18
|
-
duty/callables/isort.py,sha256=WutuLM1CZiobHK4Kl2N22xbZg7d0JU6MBZV2muvyG94,26437
|
|
19
|
-
duty/callables/mkdocs.py,sha256=laaToR_KGsPYX7zcVa9u0fC7mMbKR5PYi5g_5pBW_J8,7902
|
|
20
|
-
duty/callables/mypy.py,sha256=qtdOxX4x1VeEXCgY_Mw9EzKs0flBU86Ih4PKgf1WyT4,19797
|
|
21
|
-
duty/callables/pytest.py,sha256=GJHRZCeRhItqOA-ikcFmr9WdpN7ohwTRIIgKl7pWKyw,18345
|
|
22
|
-
duty/callables/ruff.py,sha256=ZBjl1_MxaZ1-atHVB6YOFNf3QAm6GTw7Xj3hX8jnofo,13314
|
|
23
|
-
duty/callables/safety.py,sha256=ClwwAnDdZFG71_Fbh5X2XEGSPI8PZRy4-Jz6zq2amV4,2454
|
|
24
|
-
duty/callables/ssort.py,sha256=Lqak-xfJtKkj3AaI4_jPeaRkZ9SbvMCYhoUIVVHE6s8,842
|
|
25
|
-
duty/callables/twine.py,sha256=hsp8TcOYlbHCCqRwglDmNHS55LdnXFd-n2tFaJkMafs,9511
|
|
26
|
-
duty/cli.py,sha256=XnkVQAmHCf5QAykZ4foiLvBrsSD22dhSljXmLdFhWM4,9273
|
|
27
|
-
duty/collection.py,sha256=cg_rInuTErP7HTrUJsHenOSdtFZtzIw8cIIsr5g-0T8,7500
|
|
28
|
-
duty/completions.bash,sha256=7-JMwnzlvRLGv3eK55dIahDsuQCqmAGSLvxXRyeQ60M,1293
|
|
29
|
-
duty/context.py,sha256=YVF68a2w3SMEM0AsN1mBCvlOZ5jTEZ9OYCxDZvv_soI,3250
|
|
30
|
-
duty/debug.py,sha256=9stdqxNJ9zA2HWsYfmy3C9BrWOXLlHYRGsQ6dHfCUfM,2813
|
|
31
|
-
duty/decorator.py,sha256=3puIe45Q_5vOVXlr71eFayHS1Swz6YdNANHOnDnHDk0,2984
|
|
32
|
-
duty/exceptions.py,sha256=gTtqtqOiMroP5-83kC5jakuwBfYKpzCQHE9RWfAGRv0,358
|
|
33
|
-
duty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
duty/tools/__init__.py,sha256=btCGiw-6e2CD_VPbUCvmZFNqGvmkwaw6gnkpNQBJm6Y,1225
|
|
35
|
-
duty/tools/_autoflake.py,sha256=wDqNyfuC6rju9LqyTTimaQZs_8v7YvYECzdltO5rof0,5285
|
|
36
|
-
duty/tools/_base.py,sha256=MpjsSguxu_O6HAOkIy0hZdP2RkguS-NGVhYQHPnurWA,1474
|
|
37
|
-
duty/tools/_black.py,sha256=avo5-J2gHeXlOneYC0j1PSV7J-QFfPFUTdbwczsMvrA,7907
|
|
38
|
-
duty/tools/_blacken_docs.py,sha256=szKBSsAfQNoZVzTxtm7bZd9bCFe-UzL65XM3MZUJoZI,4972
|
|
39
|
-
duty/tools/_build.py,sha256=QbOZzeR9T_mWkF9poalOkCWuYe22E1liMUC7aBQTJ5k,2567
|
|
40
|
-
duty/tools/_coverage.py,sha256=UKCu-DLyW_-en_Hn9qsh4kXyfrL7DK82VOw9Hblkh_g,26341
|
|
41
|
-
duty/tools/_flake8.py,sha256=ZmV_1Hy773fzP40LDNmj8YJslWatldl0qfr_g2pcgrI,9371
|
|
42
|
-
duty/tools/_git_changelog.py,sha256=rqpNDt2xoEKePQHxtQ3ReumsSjrcvUlaop1NsO_w-9E,8247
|
|
43
|
-
duty/tools/_griffe.py,sha256=X1u0wCVMDJS7IF3fGSnyd-kx6zNBUKP48Yk8uPztuLs,7940
|
|
44
|
-
duty/tools/_interrogate.py,sha256=7A9qlWsoQRk2NUlJzE_0_OiG5Infl5IF8ehEiWfqZno,5730
|
|
45
|
-
duty/tools/_isort.py,sha256=VbQbK4iPVNWNYlmOPDEnEcFVB6fJ66W-8s36bS9HziQ,28352
|
|
46
|
-
duty/tools/_mkdocs.py,sha256=GfhXUScTjGQK5Djg6fAGtLSSssdbhebL2AonG5FGPV0,9027
|
|
47
|
-
duty/tools/_mypy.py,sha256=6La6BTfTfMlpA4-JO8dn1O0QQ1zaVEUEp5M6cRmPr7k,21555
|
|
48
|
-
duty/tools/_pytest.py,sha256=HG5jmRbdCKMK6-6i8cDd4MZ1CsDhHa0TQyjls0vy1WU,20064
|
|
49
|
-
duty/tools/_ruff.py,sha256=LftbwvIahvjZQPc3ksLmP34a26dK22rafkpL7VQyoXc,15224
|
|
50
|
-
duty/tools/_safety.py,sha256=D0ID65aeSCx6ZG01jZVSik075YkojjoYb8DoRtaz4X8,3206
|
|
51
|
-
duty/tools/_ssort.py,sha256=xhh5eYq16BC8KTSKDCxA10mR8RZoQuN10-xUjhu3QlE,1097
|
|
52
|
-
duty/tools/_twine.py,sha256=9y7-X9fqZ6wbOddGtxBMePI7hgq9QldYyMHxRBy_JXg,10347
|
|
53
|
-
duty/tools/_yore.py,sha256=lS8ZrK3KH71X3yevIylT7U0PtV-3ik2GNuEU2cOWgNQ,1888
|
|
54
|
-
duty/validation.py,sha256=z0CLIsc-2AYbh-zqm3XMhWwE9JlVYmIJkrbo_bjmqVw,8241
|
|
55
|
-
duty-1.6.0.dist-info/RECORD,,
|
|
File without changes
|