duty 1.5.0__py3-none-any.whl → 1.6.0__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/completions.bash CHANGED
@@ -1,18 +1,18 @@
1
- # Invoke tab-completion script to be sourced with Bash shell.
2
- # Known to work on Bash 3.x, untested on 4.x.
1
+ # Taken and adapted from pyinvoke:
2
+ # Copyright (c) 2020 Jeff Forcier.
3
+ # All rights reserved.
3
4
 
4
5
  _complete_duty() {
5
6
  local candidates
6
7
 
7
- # COMP_WORDS contains the entire command string up til now (including
8
- # program name).
9
- # We hand it to Invoke so it can figure out the current context: spit back
10
- # core options, task names, the current task's options, or some combo.
8
+ # COMP_WORDS contains the entire command string up til now (including # program name).
9
+ # We hand it to Invoke so it can figure out the current context:
10
+ # spit back core options, task names, the current task's options, or some combo.
11
11
  candidates=$(duty --complete -- "${COMP_WORDS[@]}")
12
12
 
13
- # `compgen -W` takes list of valid options & a partial word & spits back
14
- # possible matches. Necessary for any partial word completions (vs
15
- # completions performed when no partial words are present).
13
+ # `compgen -W` takes list of valid options & a partial word & spits back possible matches.
14
+ # Necessary for any partial word completions
15
+ # (vs. completions performed when no partial words are present).
16
16
  #
17
17
  # $2 is the current word or token being tabbed on, either empty string or a
18
18
  # partial word, and thus wants to be compgen'd to arrive at some subset of
duty/tools/__init__.py CHANGED
@@ -22,6 +22,7 @@ from duty.tools._ruff import ruff
22
22
  from duty.tools._safety import safety
23
23
  from duty.tools._ssort import ssort
24
24
  from duty.tools._twine import twine
25
+ from duty.tools._yore import yore
25
26
 
26
27
  __all__ = [
27
28
  "LazyStderr",
@@ -45,4 +46,5 @@ __all__ = [
45
46
  "safety",
46
47
  "ssort",
47
48
  "twine",
49
+ "yore",
48
50
  ]
duty/tools/_yore.py ADDED
@@ -0,0 +1,54 @@
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: duty
3
- Version: 1.5.0
3
+ Version: 1.6.0
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>
@@ -1,7 +1,7 @@
1
- duty-1.5.0.dist-info/METADATA,sha256=CeSruNp_c1LB1AERsGqjy0UwRiww5pivOXdon_fRz7g,2710
2
- duty-1.5.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- duty-1.5.0.dist-info/entry_points.txt,sha256=XZTh9yTgC9GDFmNoVeOqgKT6BCMifkCToilIj77B9ss,55
4
- duty-1.5.0.dist-info/licenses/LICENSE,sha256=nQxdYSduhkgEpOTmg4yyIMmFPzcr2qrlUl8Tf9QZPug,754
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
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
@@ -25,13 +25,13 @@ 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=XnkVQAmHCf5QAykZ4foiLvBrsSD22dhSljXmLdFhWM4,9273
27
27
  duty/collection.py,sha256=cg_rInuTErP7HTrUJsHenOSdtFZtzIw8cIIsr5g-0T8,7500
28
- duty/completions.bash,sha256=xXtsZoF1bxhfG4vEuh8hwyYkzNBNlDRxKC9myHV4LPA,1311
28
+ duty/completions.bash,sha256=7-JMwnzlvRLGv3eK55dIahDsuQCqmAGSLvxXRyeQ60M,1293
29
29
  duty/context.py,sha256=YVF68a2w3SMEM0AsN1mBCvlOZ5jTEZ9OYCxDZvv_soI,3250
30
30
  duty/debug.py,sha256=9stdqxNJ9zA2HWsYfmy3C9BrWOXLlHYRGsQ6dHfCUfM,2813
31
31
  duty/decorator.py,sha256=3puIe45Q_5vOVXlr71eFayHS1Swz6YdNANHOnDnHDk0,2984
32
32
  duty/exceptions.py,sha256=gTtqtqOiMroP5-83kC5jakuwBfYKpzCQHE9RWfAGRv0,358
33
33
  duty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- duty/tools/__init__.py,sha256=X-DqE9t47ybEhDf3eboxOEM0vVMQQsqKEOdmDafcuvc,1179
34
+ duty/tools/__init__.py,sha256=btCGiw-6e2CD_VPbUCvmZFNqGvmkwaw6gnkpNQBJm6Y,1225
35
35
  duty/tools/_autoflake.py,sha256=wDqNyfuC6rju9LqyTTimaQZs_8v7YvYECzdltO5rof0,5285
36
36
  duty/tools/_base.py,sha256=MpjsSguxu_O6HAOkIy0hZdP2RkguS-NGVhYQHPnurWA,1474
37
37
  duty/tools/_black.py,sha256=avo5-J2gHeXlOneYC0j1PSV7J-QFfPFUTdbwczsMvrA,7907
@@ -50,5 +50,6 @@ duty/tools/_ruff.py,sha256=LftbwvIahvjZQPc3ksLmP34a26dK22rafkpL7VQyoXc,15224
50
50
  duty/tools/_safety.py,sha256=D0ID65aeSCx6ZG01jZVSik075YkojjoYb8DoRtaz4X8,3206
51
51
  duty/tools/_ssort.py,sha256=xhh5eYq16BC8KTSKDCxA10mR8RZoQuN10-xUjhu3QlE,1097
52
52
  duty/tools/_twine.py,sha256=9y7-X9fqZ6wbOddGtxBMePI7hgq9QldYyMHxRBy_JXg,10347
53
+ duty/tools/_yore.py,sha256=lS8ZrK3KH71X3yevIylT7U0PtV-3ik2GNuEU2cOWgNQ,1888
53
54
  duty/validation.py,sha256=z0CLIsc-2AYbh-zqm3XMhWwE9JlVYmIJkrbo_bjmqVw,8241
54
- duty-1.5.0.dist-info/RECORD,,
55
+ duty-1.6.0.dist-info/RECORD,,
File without changes