duty 1.4.2__py3-none-any.whl → 1.4.3__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/callables/blacken_docs.py +5 -1
- duty/callables/ruff.py +2 -2
- duty/callables/safety.py +4 -1
- duty/collection.py +2 -2
- duty/context.py +5 -2
- duty/decorator.py +3 -1
- duty/tools/_blacken_docs.py +5 -1
- duty/tools/_ruff.py +2 -2
- duty/tools/_safety.py +4 -1
- duty/validation.py +5 -2
- {duty-1.4.2.dist-info → duty-1.4.3.dist-info}/METADATA +5 -9
- {duty-1.4.2.dist-info → duty-1.4.3.dist-info}/RECORD +15 -15
- {duty-1.4.2.dist-info → duty-1.4.3.dist-info}/WHEEL +1 -1
- {duty-1.4.2.dist-info → duty-1.4.3.dist-info}/entry_points.txt +2 -0
- {duty-1.4.2.dist-info → duty-1.4.3.dist-info}/licenses/LICENSE +0 -0
duty/callables/blacken_docs.py
CHANGED
|
@@ -4,10 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from
|
|
7
|
+
from re import Pattern
|
|
8
|
+
from typing import TYPE_CHECKING
|
|
8
9
|
|
|
9
10
|
from failprint.lazy import lazy
|
|
10
11
|
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from collections.abc import Sequence
|
|
14
|
+
|
|
11
15
|
|
|
12
16
|
@lazy(name="blacken_docs")
|
|
13
17
|
def run(
|
duty/callables/ruff.py
CHANGED
|
@@ -5,12 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
import os
|
|
6
6
|
import subprocess
|
|
7
7
|
import sys
|
|
8
|
-
from functools import
|
|
8
|
+
from functools import cache
|
|
9
9
|
|
|
10
10
|
from failprint.lazy import lazy
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@
|
|
13
|
+
@cache
|
|
14
14
|
def _find_ruff() -> str:
|
|
15
15
|
from ruff.__main__ import find_ruff_bin
|
|
16
16
|
|
duty/callables/safety.py
CHANGED
|
@@ -5,10 +5,13 @@ from __future__ import annotations
|
|
|
5
5
|
import importlib
|
|
6
6
|
import sys
|
|
7
7
|
from io import StringIO
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import TYPE_CHECKING, Literal, cast
|
|
9
9
|
|
|
10
10
|
from failprint.lazy import lazy
|
|
11
11
|
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from collections.abc import Sequence
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
@lazy(name="safety.check")
|
|
14
17
|
def check(
|
duty/collection.py
CHANGED
|
@@ -6,11 +6,11 @@ import inspect
|
|
|
6
6
|
import sys
|
|
7
7
|
from copy import deepcopy
|
|
8
8
|
from importlib import util as importlib_util
|
|
9
|
-
from typing import Any, Callable, ClassVar,
|
|
9
|
+
from typing import Any, Callable, ClassVar, Union
|
|
10
10
|
|
|
11
11
|
from duty.context import Context
|
|
12
12
|
|
|
13
|
-
DutyListType =
|
|
13
|
+
DutyListType = list[Union[str, Callable, "Duty"]]
|
|
14
14
|
default_duties_file = "duties.py"
|
|
15
15
|
|
|
16
16
|
|
duty/context.py
CHANGED
|
@@ -4,14 +4,17 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
6
|
from contextlib import contextmanager, suppress
|
|
7
|
-
from typing import Any, Callable,
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Callable, Union
|
|
8
8
|
|
|
9
9
|
from failprint.runners import run as failprint_run
|
|
10
10
|
|
|
11
11
|
from duty.exceptions import DutyFailure
|
|
12
12
|
from duty.tools import Tool
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from collections.abc import Iterator
|
|
16
|
+
|
|
17
|
+
CmdType = Union[str, list[str], Callable]
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
class Context:
|
duty/decorator.py
CHANGED
|
@@ -4,11 +4,13 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import inspect
|
|
6
6
|
from functools import wraps
|
|
7
|
-
from typing import TYPE_CHECKING, Any, Callable,
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Callable, overload
|
|
8
8
|
|
|
9
9
|
from duty.collection import Duty, DutyListType
|
|
10
10
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
12
|
+
from collections.abc import Iterable
|
|
13
|
+
|
|
12
14
|
from duty.context import Context
|
|
13
15
|
|
|
14
16
|
|
duty/tools/_blacken_docs.py
CHANGED
|
@@ -4,10 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from
|
|
7
|
+
from re import Pattern
|
|
8
|
+
from typing import TYPE_CHECKING
|
|
8
9
|
|
|
9
10
|
from duty.tools._base import Tool
|
|
10
11
|
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from collections.abc import Sequence
|
|
14
|
+
|
|
11
15
|
|
|
12
16
|
class blacken_docs(Tool): # noqa: N801
|
|
13
17
|
"""Call [blacken-docs](https://github.com/adamchainz/blacken-docs)."""
|
duty/tools/_ruff.py
CHANGED
|
@@ -5,12 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
import os
|
|
6
6
|
import subprocess
|
|
7
7
|
import sys
|
|
8
|
-
from functools import
|
|
8
|
+
from functools import cache
|
|
9
9
|
|
|
10
10
|
from duty.tools._base import Tool
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@
|
|
13
|
+
@cache
|
|
14
14
|
def _find_ruff() -> str:
|
|
15
15
|
from ruff.__main__ import find_ruff_bin
|
|
16
16
|
|
duty/tools/_safety.py
CHANGED
|
@@ -5,10 +5,13 @@ from __future__ import annotations
|
|
|
5
5
|
import importlib
|
|
6
6
|
import sys
|
|
7
7
|
from io import StringIO
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import TYPE_CHECKING, Literal, cast
|
|
9
9
|
|
|
10
10
|
from duty.tools._base import Tool
|
|
11
11
|
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from collections.abc import Sequence
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
class safety(Tool): # noqa: N801
|
|
14
17
|
"""Call [Safety](https://github.com/pyupio/safety)."""
|
duty/validation.py
CHANGED
|
@@ -12,9 +12,12 @@ import textwrap
|
|
|
12
12
|
from contextlib import suppress
|
|
13
13
|
from functools import cached_property, partial
|
|
14
14
|
from inspect import Parameter, Signature, signature
|
|
15
|
-
from typing import Any, Callable, ForwardRef,
|
|
15
|
+
from typing import TYPE_CHECKING, Any, Callable, ForwardRef, Union, get_args, get_origin
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from collections.abc import Sequence
|
|
19
|
+
|
|
20
|
+
# YORE: EOL 3.9: Replace block with lines 6-13.
|
|
18
21
|
if sys.version_info < (3, 10):
|
|
19
22
|
from eval_type_backport import eval_type_backport as eval_type
|
|
20
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: duty
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.3
|
|
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>
|
|
@@ -10,12 +10,12 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Programming Language :: Python
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
19
|
Classifier: Topic :: Documentation
|
|
20
20
|
Classifier: Topic :: Software Development
|
|
21
21
|
Classifier: Topic :: Utilities
|
|
@@ -28,7 +28,7 @@ Project-URL: Issues, https://github.com/pawamoy/duty/issues
|
|
|
28
28
|
Project-URL: Discussions, https://github.com/pawamoy/duty/discussions
|
|
29
29
|
Project-URL: Gitter, https://gitter.im/duty/community
|
|
30
30
|
Project-URL: Funding, https://github.com/sponsors/pawamoy
|
|
31
|
-
Requires-Python: >=3.
|
|
31
|
+
Requires-Python: >=3.9
|
|
32
32
|
Requires-Dist: eval-type-backport; python_version < "3.10"
|
|
33
33
|
Requires-Dist: failprint!=1.0.0,>=0.11
|
|
34
34
|
Requires-Dist: typing-extensions>=4.0; python_version < "3.11"
|
|
@@ -39,7 +39,6 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
[](https://github.com/pawamoy/duty/actions?query=workflow%3Aci)
|
|
40
40
|
[](https://pawamoy.github.io/duty/)
|
|
41
41
|
[](https://pypi.org/project/duty/)
|
|
42
|
-
[](https://gitpod.io/#https://github.com/pawamoy/duty)
|
|
43
42
|
[](https://app.gitter.im/#/room/#duty:gitter.im)
|
|
44
43
|
|
|
45
44
|
A simple task runner.
|
|
@@ -50,17 +49,14 @@ Inspired by [Invoke](https://github.com/pyinvoke/invoke).
|
|
|
50
49
|
|
|
51
50
|
## Installation
|
|
52
51
|
|
|
53
|
-
With `pip`:
|
|
54
|
-
|
|
55
52
|
```bash
|
|
56
53
|
pip install duty
|
|
57
54
|
```
|
|
58
55
|
|
|
59
|
-
With [`
|
|
56
|
+
With [`uv`](https://docs.astral.sh/uv/):
|
|
60
57
|
|
|
61
58
|
```bash
|
|
62
|
-
|
|
63
|
-
pipx install duty
|
|
59
|
+
uv tool install duty
|
|
64
60
|
```
|
|
65
61
|
|
|
66
62
|
## Quick start
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
duty-1.4.
|
|
2
|
-
duty-1.4.
|
|
3
|
-
duty-1.4.
|
|
4
|
-
duty-1.4.
|
|
1
|
+
duty-1.4.3.dist-info/METADATA,sha256=v58pX-GBakOWoOGNVIUkNkkA66B3UcO1Zbjtm3yazyo,2710
|
|
2
|
+
duty-1.4.3.dist-info/WHEEL,sha256=pM0IBB6ZwH3nkEPhtcp50KvKNX-07jYtnb1g1m6Z4Co,90
|
|
3
|
+
duty-1.4.3.dist-info/entry_points.txt,sha256=XZTh9yTgC9GDFmNoVeOqgKT6BCMifkCToilIj77B9ss,55
|
|
4
|
+
duty-1.4.3.dist-info/licenses/LICENSE,sha256=nQxdYSduhkgEpOTmg4yyIMmFPzcr2qrlUl8Tf9QZPug,754
|
|
5
5
|
duty/__init__.py,sha256=2fdBMNEBXYSCnV1GQm56VGe8VuvMp79-Hj3SHrAb5MM,144
|
|
6
6
|
duty/__main__.py,sha256=4YvloGDKmyVzOsE6ZdyCQyY0Jsl0LSlbqkO2UDExgmI,333
|
|
7
7
|
duty/callables/__init__.py,sha256=R42f1qpIy7m2MMbs6Xc_OnQiEARr4g2Pghpp9ry4JFI,1042
|
|
8
8
|
duty/callables/_io.py,sha256=vrMLd7ggCFDy8coWUqntmxgKC9BvFu8smK4pK2S7EeA,367
|
|
9
9
|
duty/callables/autoflake.py,sha256=5IUL2TUfrbWUs_-TBjzqsSHJOxGFiGtBuWBV6AIYdu4,4699
|
|
10
10
|
duty/callables/black.py,sha256=c2gWuhESEWRi1JGKAlMF_ZLoVJ5_bHLd7c4Lg0qyuX8,7153
|
|
11
|
-
duty/callables/blacken_docs.py,sha256=
|
|
11
|
+
duty/callables/blacken_docs.py,sha256=OMKrfIZ1ZN6_h8SFGCBcnFCnlonQkkuRY7Vl-B2eGB0,3497
|
|
12
12
|
duty/callables/build.py,sha256=_cF8B3HKy3BWsTSLfpKwhxkZ0JVhfB3v1Zh2eO1FnQw,2150
|
|
13
13
|
duty/callables/coverage.py,sha256=3F2DeHyB-L-Y4v_qJU3TIGPNISnX_Nwn79JtmdE-a-0,23843
|
|
14
14
|
duty/callables/flake8.py,sha256=3uqFdZUF3B35Zc-otjrZfUQgEQkQ3ecZd0ZlEH83sZc,8476
|
|
@@ -19,22 +19,22 @@ duty/callables/isort.py,sha256=WutuLM1CZiobHK4Kl2N22xbZg7d0JU6MBZV2muvyG94,26437
|
|
|
19
19
|
duty/callables/mkdocs.py,sha256=laaToR_KGsPYX7zcVa9u0fC7mMbKR5PYi5g_5pBW_J8,7902
|
|
20
20
|
duty/callables/mypy.py,sha256=qtdOxX4x1VeEXCgY_Mw9EzKs0flBU86Ih4PKgf1WyT4,19797
|
|
21
21
|
duty/callables/pytest.py,sha256=GJHRZCeRhItqOA-ikcFmr9WdpN7ohwTRIIgKl7pWKyw,18345
|
|
22
|
-
duty/callables/ruff.py,sha256=
|
|
23
|
-
duty/callables/safety.py,sha256=
|
|
22
|
+
duty/callables/ruff.py,sha256=ZBjl1_MxaZ1-atHVB6YOFNf3QAm6GTw7Xj3hX8jnofo,13314
|
|
23
|
+
duty/callables/safety.py,sha256=ClwwAnDdZFG71_Fbh5X2XEGSPI8PZRy4-Jz6zq2amV4,2454
|
|
24
24
|
duty/callables/ssort.py,sha256=Lqak-xfJtKkj3AaI4_jPeaRkZ9SbvMCYhoUIVVHE6s8,842
|
|
25
25
|
duty/callables/twine.py,sha256=hsp8TcOYlbHCCqRwglDmNHS55LdnXFd-n2tFaJkMafs,9511
|
|
26
26
|
duty/cli.py,sha256=9uca96F31uTzWJuREU0ReWGhXntvjQaoSW6ZkUxBTV4,8521
|
|
27
|
-
duty/collection.py,sha256=
|
|
28
|
-
duty/context.py,sha256=
|
|
27
|
+
duty/collection.py,sha256=Xp85w6R4Lxv9A3IcdG2ZRtOJdyf1CXSlYr6-N0wBzwo,6584
|
|
28
|
+
duty/context.py,sha256=YVF68a2w3SMEM0AsN1mBCvlOZ5jTEZ9OYCxDZvv_soI,3250
|
|
29
29
|
duty/debug.py,sha256=9stdqxNJ9zA2HWsYfmy3C9BrWOXLlHYRGsQ6dHfCUfM,2813
|
|
30
|
-
duty/decorator.py,sha256=
|
|
30
|
+
duty/decorator.py,sha256=3puIe45Q_5vOVXlr71eFayHS1Swz6YdNANHOnDnHDk0,2984
|
|
31
31
|
duty/exceptions.py,sha256=gTtqtqOiMroP5-83kC5jakuwBfYKpzCQHE9RWfAGRv0,358
|
|
32
32
|
duty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
duty/tools/__init__.py,sha256=soQxh0HEwSV5zZhfv5DEIpBonk53-JRE0YvcXfWvPI8,1179
|
|
34
34
|
duty/tools/_autoflake.py,sha256=wDqNyfuC6rju9LqyTTimaQZs_8v7YvYECzdltO5rof0,5285
|
|
35
35
|
duty/tools/_base.py,sha256=MpjsSguxu_O6HAOkIy0hZdP2RkguS-NGVhYQHPnurWA,1474
|
|
36
36
|
duty/tools/_black.py,sha256=avo5-J2gHeXlOneYC0j1PSV7J-QFfPFUTdbwczsMvrA,7907
|
|
37
|
-
duty/tools/_blacken_docs.py,sha256=
|
|
37
|
+
duty/tools/_blacken_docs.py,sha256=szKBSsAfQNoZVzTxtm7bZd9bCFe-UzL65XM3MZUJoZI,4972
|
|
38
38
|
duty/tools/_build.py,sha256=QbOZzeR9T_mWkF9poalOkCWuYe22E1liMUC7aBQTJ5k,2567
|
|
39
39
|
duty/tools/_coverage.py,sha256=UKCu-DLyW_-en_Hn9qsh4kXyfrL7DK82VOw9Hblkh_g,26341
|
|
40
40
|
duty/tools/_flake8.py,sha256=ZmV_1Hy773fzP40LDNmj8YJslWatldl0qfr_g2pcgrI,9371
|
|
@@ -45,9 +45,9 @@ duty/tools/_isort.py,sha256=VbQbK4iPVNWNYlmOPDEnEcFVB6fJ66W-8s36bS9HziQ,28352
|
|
|
45
45
|
duty/tools/_mkdocs.py,sha256=GfhXUScTjGQK5Djg6fAGtLSSssdbhebL2AonG5FGPV0,9027
|
|
46
46
|
duty/tools/_mypy.py,sha256=6La6BTfTfMlpA4-JO8dn1O0QQ1zaVEUEp5M6cRmPr7k,21555
|
|
47
47
|
duty/tools/_pytest.py,sha256=HG5jmRbdCKMK6-6i8cDd4MZ1CsDhHa0TQyjls0vy1WU,20064
|
|
48
|
-
duty/tools/_ruff.py,sha256=
|
|
49
|
-
duty/tools/_safety.py,sha256=
|
|
48
|
+
duty/tools/_ruff.py,sha256=LftbwvIahvjZQPc3ksLmP34a26dK22rafkpL7VQyoXc,15224
|
|
49
|
+
duty/tools/_safety.py,sha256=D0ID65aeSCx6ZG01jZVSik075YkojjoYb8DoRtaz4X8,3206
|
|
50
50
|
duty/tools/_ssort.py,sha256=xhh5eYq16BC8KTSKDCxA10mR8RZoQuN10-xUjhu3QlE,1097
|
|
51
51
|
duty/tools/_twine.py,sha256=9y7-X9fqZ6wbOddGtxBMePI7hgq9QldYyMHxRBy_JXg,10347
|
|
52
|
-
duty/validation.py,sha256=
|
|
53
|
-
duty-1.4.
|
|
52
|
+
duty/validation.py,sha256=z0CLIsc-2AYbh-zqm3XMhWwE9JlVYmIJkrbo_bjmqVw,8241
|
|
53
|
+
duty-1.4.3.dist-info/RECORD,,
|
|
File without changes
|