duty 1.5.0__tar.gz → 1.6.0__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.
Files changed (102) hide show
  1. {duty-1.5.0 → duty-1.6.0}/CHANGELOG.md +8 -0
  2. {duty-1.5.0 → duty-1.6.0}/PKG-INFO +1 -1
  3. {duty-1.5.0 → duty-1.6.0}/docs/usage.md +6 -8
  4. {duty-1.5.0 → duty-1.6.0}/pyproject.toml +1 -1
  5. {duty-1.5.0 → duty-1.6.0}/src/duty/completions.bash +9 -9
  6. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/__init__.py +2 -0
  7. duty-1.6.0/src/duty/tools/_yore.py +54 -0
  8. {duty-1.5.0 → duty-1.6.0}/CODE_OF_CONDUCT.md +0 -0
  9. {duty-1.5.0 → duty-1.6.0}/CONTRIBUTING.md +0 -0
  10. {duty-1.5.0 → duty-1.6.0}/LICENSE +0 -0
  11. {duty-1.5.0 → duty-1.6.0}/README.md +0 -0
  12. {duty-1.5.0 → duty-1.6.0}/config/coverage.ini +0 -0
  13. {duty-1.5.0 → duty-1.6.0}/config/git-changelog.toml +0 -0
  14. {duty-1.5.0 → duty-1.6.0}/config/mypy.ini +0 -0
  15. {duty-1.5.0 → duty-1.6.0}/config/pytest.ini +0 -0
  16. {duty-1.5.0 → duty-1.6.0}/config/ruff.toml +0 -0
  17. {duty-1.5.0 → duty-1.6.0}/config/vscode/launch.json +0 -0
  18. {duty-1.5.0 → duty-1.6.0}/config/vscode/settings.json +0 -0
  19. {duty-1.5.0 → duty-1.6.0}/config/vscode/tasks.json +0 -0
  20. {duty-1.5.0 → duty-1.6.0}/docs/.overrides/main.html +0 -0
  21. {duty-1.5.0 → duty-1.6.0}/docs/.overrides/partials/comments.html +0 -0
  22. {duty-1.5.0 → duty-1.6.0}/docs/changelog.md +0 -0
  23. {duty-1.5.0 → duty-1.6.0}/docs/code_of_conduct.md +0 -0
  24. {duty-1.5.0 → duty-1.6.0}/docs/contributing.md +0 -0
  25. {duty-1.5.0 → duty-1.6.0}/docs/credits.md +0 -0
  26. {duty-1.5.0 → duty-1.6.0}/docs/css/material.css +0 -0
  27. {duty-1.5.0 → duty-1.6.0}/docs/css/mkdocstrings.css +0 -0
  28. {duty-1.5.0 → duty-1.6.0}/docs/demo.svg +0 -0
  29. {duty-1.5.0 → duty-1.6.0}/docs/gen_credits.py +0 -0
  30. {duty-1.5.0 → duty-1.6.0}/docs/index.md +0 -0
  31. {duty-1.5.0 → duty-1.6.0}/docs/js/feedback.js +0 -0
  32. {duty-1.5.0 → duty-1.6.0}/docs/license.md +0 -0
  33. {duty-1.5.0 → duty-1.6.0}/duties.py +0 -0
  34. {duty-1.5.0 → duty-1.6.0}/mkdocs.yml +0 -0
  35. {duty-1.5.0 → duty-1.6.0}/scripts/gen_credits.py +0 -0
  36. {duty-1.5.0 → duty-1.6.0}/scripts/gen_ref_nav.py +0 -0
  37. {duty-1.5.0 → duty-1.6.0}/scripts/get_version.py +0 -0
  38. {duty-1.5.0 → duty-1.6.0}/scripts/make +0 -0
  39. {duty-1.5.0 → duty-1.6.0}/scripts/make.py +0 -0
  40. {duty-1.5.0 → duty-1.6.0}/src/duty/__init__.py +0 -0
  41. {duty-1.5.0 → duty-1.6.0}/src/duty/__main__.py +0 -0
  42. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/__init__.py +0 -0
  43. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/_io.py +0 -0
  44. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/autoflake.py +0 -0
  45. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/black.py +0 -0
  46. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/blacken_docs.py +0 -0
  47. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/build.py +0 -0
  48. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/coverage.py +0 -0
  49. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/flake8.py +0 -0
  50. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/git_changelog.py +0 -0
  51. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/griffe.py +0 -0
  52. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/interrogate.py +0 -0
  53. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/isort.py +0 -0
  54. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/mkdocs.py +0 -0
  55. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/mypy.py +0 -0
  56. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/pytest.py +0 -0
  57. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/ruff.py +0 -0
  58. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/safety.py +0 -0
  59. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/ssort.py +0 -0
  60. {duty-1.5.0 → duty-1.6.0}/src/duty/callables/twine.py +0 -0
  61. {duty-1.5.0 → duty-1.6.0}/src/duty/cli.py +0 -0
  62. {duty-1.5.0 → duty-1.6.0}/src/duty/collection.py +0 -0
  63. {duty-1.5.0 → duty-1.6.0}/src/duty/context.py +0 -0
  64. {duty-1.5.0 → duty-1.6.0}/src/duty/debug.py +0 -0
  65. {duty-1.5.0 → duty-1.6.0}/src/duty/decorator.py +0 -0
  66. {duty-1.5.0 → duty-1.6.0}/src/duty/exceptions.py +0 -0
  67. {duty-1.5.0 → duty-1.6.0}/src/duty/py.typed +0 -0
  68. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_autoflake.py +0 -0
  69. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_base.py +0 -0
  70. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_black.py +0 -0
  71. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_blacken_docs.py +0 -0
  72. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_build.py +0 -0
  73. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_coverage.py +0 -0
  74. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_flake8.py +0 -0
  75. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_git_changelog.py +0 -0
  76. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_griffe.py +0 -0
  77. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_interrogate.py +0 -0
  78. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_isort.py +0 -0
  79. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_mkdocs.py +0 -0
  80. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_mypy.py +0 -0
  81. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_pytest.py +0 -0
  82. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_ruff.py +0 -0
  83. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_safety.py +0 -0
  84. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_ssort.py +0 -0
  85. {duty-1.5.0 → duty-1.6.0}/src/duty/tools/_twine.py +0 -0
  86. {duty-1.5.0 → duty-1.6.0}/src/duty/validation.py +0 -0
  87. {duty-1.5.0 → duty-1.6.0}/tests/__init__.py +0 -0
  88. {duty-1.5.0 → duty-1.6.0}/tests/conftest.py +0 -0
  89. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/arguments.py +0 -0
  90. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/basic.py +0 -0
  91. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/booleans.py +0 -0
  92. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/code.py +0 -0
  93. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/list.py +0 -0
  94. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/multiple.py +0 -0
  95. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/precedence.py +0 -0
  96. {duty-1.5.0 → duty-1.6.0}/tests/fixtures/validation.py +0 -0
  97. {duty-1.5.0 → duty-1.6.0}/tests/test_cli.py +0 -0
  98. {duty-1.5.0 → duty-1.6.0}/tests/test_collection.py +0 -0
  99. {duty-1.5.0 → duty-1.6.0}/tests/test_context.py +0 -0
  100. {duty-1.5.0 → duty-1.6.0}/tests/test_decorator.py +0 -0
  101. {duty-1.5.0 → duty-1.6.0}/tests/test_running.py +0 -0
  102. {duty-1.5.0 → duty-1.6.0}/tests/test_validation.py +0 -0
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  <!-- insertion marker -->
8
+ ## [1.6.0](https://github.com/pawamoy/duty/releases/tag/1.6.0) - 2025-03-01
9
+
10
+ <small>[Compare with 1.5.0](https://github.com/pawamoy/duty/compare/1.5.0...1.6.0)</small>
11
+
12
+ ### Features
13
+
14
+ - Add Yore tool ([4cbb478](https://github.com/pawamoy/duty/commit/4cbb478ac41258316188fcd3402e5165b0c233ac) by Timothée Mazzucotelli).
15
+
8
16
  ## [1.5.0](https://github.com/pawamoy/duty/releases/tag/1.5.0) - 2025-02-02
9
17
 
10
18
  <small>[Compare with 1.4.3](https://github.com/pawamoy/duty/compare/1.4.3...1.5.0)</small>
@@ -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>
@@ -54,18 +54,17 @@ def docs(ctx):
54
54
  # avoid the overhead of an extra Python process
55
55
  ```
56
56
 
57
- For convenience, `duty` provides callables for many popular Python tools,
57
+ For convenience, `duty` provides callables (called "tools") for many popular Python tools,
58
58
  so that you don't have to read their source and learn how to call them.
59
59
  For example, the `mkdocs build` command can be called like this:
60
60
 
61
61
  ```python
62
- from duty import duty
63
- from duty.callables import mkdocs
62
+ from duty import duty, tools
64
63
 
65
64
 
66
65
  @duty
67
66
  def docs(ctx):
68
- ctx.run(mkdocs.build, kwargs={"strict": True}, title="Building documentation")
67
+ ctx.run(tool.mkdocs.build, kwargs={"strict": True}, title="Building documentation")
69
68
  ```
70
69
 
71
70
  ### Lazy callables
@@ -78,19 +77,18 @@ without passing arguments and keyword arguments
78
77
  with the `args` and `kwargs` parameters of `ctx.run()`:
79
78
 
80
79
  ```python
81
- from duty import duty
82
- from duty.callables import mkdocs
80
+ from duty import duty, tools
83
81
 
84
82
 
85
83
  @duty
86
84
  def docs(ctx):
87
- ctx.run(mkdocs.build(strict=True), title="Building documentation")
85
+ ctx.run(tools.mkdocs.build(strict=True), title="Building documentation")
88
86
  ```
89
87
 
90
88
  The main benefit is that it enables IDE features like help tooltips and auto-completion,
91
89
  as well as improving readability and writability.
92
90
 
93
- **[See all our callables in the Code reference][duty.tools].**
91
+ **[See all our tools in the Code reference][duty.tools].**
94
92
 
95
93
  You can also create your own lazy callables with [`duty.tools.Tool`][]
96
94
  and [`duty.tools.lazy`][failprint.lazy.lazy].
@@ -41,7 +41,7 @@ dependencies = [
41
41
  "failprint>=0.11,!=1.0.0",
42
42
  "typing-extensions>=4.0; python_version < '3.11'",
43
43
  ]
44
- version = "1.5.0"
44
+ version = "1.6.0"
45
45
 
46
46
  [project.license]
47
47
  text = "ISC"
@@ -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
@@ -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
  ]
@@ -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)
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
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
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
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
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
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
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
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
File without changes
File without changes
File without changes
File without changes
File without changes