duty 1.5.0__tar.gz → 1.6.1__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 (138) hide show
  1. {duty-1.5.0 → duty-1.6.1}/CHANGELOG.md +27 -0
  2. duty-1.6.1/CODE_OF_CONDUCT.md +84 -0
  3. {duty-1.5.0 → duty-1.6.1}/CONTRIBUTING.md +13 -41
  4. {duty-1.5.0 → duty-1.6.1}/PKG-INFO +4 -3
  5. {duty-1.5.0 → duty-1.6.1}/config/ruff.toml +9 -2
  6. {duty-1.5.0 → duty-1.6.1}/config/vscode/launch.json +11 -1
  7. {duty-1.5.0 → duty-1.6.1}/docs/.overrides/partials/comments.html +1 -1
  8. duty-1.6.1/docs/.overrides/partials/path-item.html +22 -0
  9. duty-1.6.1/docs/changelog.md +5 -0
  10. duty-1.6.1/docs/code_of_conduct.md +5 -0
  11. duty-1.6.1/docs/contributing.md +5 -0
  12. {duty-1.5.0 → duty-1.6.1}/docs/credits.md +1 -2
  13. duty-1.6.1/docs/css/mkdocstrings.css +72 -0
  14. {duty-1.5.0 → duty-1.6.1}/docs/index.md +1 -0
  15. {duty-1.5.0 → duty-1.6.1}/docs/license.md +1 -0
  16. duty-1.6.1/docs/reference/api.md +9 -0
  17. {duty-1.5.0 → duty-1.6.1}/docs/usage.md +8 -10
  18. {duty-1.5.0 → duty-1.6.1}/duties.py +14 -5
  19. {duty-1.5.0 → duty-1.6.1}/mkdocs.yml +15 -11
  20. {duty-1.5.0 → duty-1.6.1}/pyproject.toml +24 -11
  21. {duty-1.5.0 → duty-1.6.1}/scripts/gen_credits.py +2 -2
  22. {duty-1.5.0 → duty-1.6.1}/scripts/get_version.py +7 -3
  23. {duty-1.5.0 → duty-1.6.1}/scripts/make.py +16 -6
  24. duty-1.6.1/src/duty/__init__.py +57 -0
  25. {duty-1.5.0 → duty-1.6.1}/src/duty/__main__.py +1 -1
  26. duty-1.6.1/src/duty/_internal/callables/__init__.py +34 -0
  27. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/_io.py +2 -0
  28. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/autoflake.py +4 -4
  29. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/black.py +3 -3
  30. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/blacken_docs.py +4 -4
  31. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/build.py +3 -3
  32. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/coverage.py +3 -3
  33. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/flake8.py +3 -3
  34. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/git_changelog.py +3 -3
  35. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/griffe.py +3 -3
  36. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/interrogate.py +3 -3
  37. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/isort.py +3 -3
  38. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/mkdocs.py +3 -3
  39. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/mypy.py +4 -4
  40. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/pytest.py +3 -3
  41. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/ruff.py +3 -3
  42. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/safety.py +7 -7
  43. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/ssort.py +3 -3
  44. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/callables/twine.py +3 -3
  45. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/cli.py +8 -9
  46. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/collection.py +16 -3
  47. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/context.py +4 -5
  48. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/debug.py +13 -15
  49. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/decorator.py +2 -4
  50. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/exceptions.py +1 -3
  51. duty-1.6.1/src/duty/_internal/tools/__init__.py +41 -0
  52. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_autoflake.py +8 -4
  53. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_base.py +15 -2
  54. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_black.py +5 -5
  55. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_blacken_docs.py +10 -5
  56. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_build.py +4 -4
  57. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_coverage.py +8 -4
  58. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_flake8.py +10 -12
  59. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_git_changelog.py +8 -4
  60. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_griffe.py +8 -4
  61. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_interrogate.py +4 -4
  62. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_isort.py +8 -6
  63. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_mkdocs.py +8 -4
  64. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_mypy.py +5 -5
  65. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_pytest.py +8 -4
  66. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_ruff.py +11 -5
  67. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_safety.py +13 -8
  68. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_ssort.py +10 -6
  69. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/tools/_twine.py +11 -5
  70. duty-1.6.1/src/duty/_internal/tools/_yore.py +96 -0
  71. {duty-1.5.0/src/duty → duty-1.6.1/src/duty/_internal}/validation.py +13 -14
  72. {duty-1.5.0 → duty-1.6.1}/src/duty/callables/__init__.py +4 -4
  73. duty-1.6.1/src/duty/callables/autoflake.py +17 -0
  74. duty-1.6.1/src/duty/callables/black.py +17 -0
  75. duty-1.6.1/src/duty/callables/blacken_docs.py +17 -0
  76. duty-1.6.1/src/duty/callables/build.py +17 -0
  77. duty-1.6.1/src/duty/callables/coverage.py +17 -0
  78. duty-1.6.1/src/duty/callables/flake8.py +17 -0
  79. duty-1.6.1/src/duty/callables/git_changelog.py +17 -0
  80. duty-1.6.1/src/duty/callables/griffe.py +17 -0
  81. duty-1.6.1/src/duty/callables/interrogate.py +17 -0
  82. duty-1.6.1/src/duty/callables/isort.py +17 -0
  83. duty-1.6.1/src/duty/callables/mkdocs.py +17 -0
  84. duty-1.6.1/src/duty/callables/mypy.py +17 -0
  85. duty-1.6.1/src/duty/callables/pytest.py +17 -0
  86. duty-1.6.1/src/duty/callables/ruff.py +17 -0
  87. duty-1.6.1/src/duty/callables/safety.py +17 -0
  88. duty-1.6.1/src/duty/callables/ssort.py +17 -0
  89. duty-1.6.1/src/duty/callables/twine.py +17 -0
  90. duty-1.6.1/src/duty/cli.py +17 -0
  91. duty-1.6.1/src/duty/collection.py +17 -0
  92. {duty-1.5.0 → duty-1.6.1}/src/duty/completions.bash +9 -9
  93. duty-1.6.1/src/duty/context.py +17 -0
  94. duty-1.6.1/src/duty/decorator.py +17 -0
  95. duty-1.6.1/src/duty/exceptions.py +17 -0
  96. duty-1.6.1/src/duty/py.typed +0 -0
  97. duty-1.6.1/src/duty/tools.py +63 -0
  98. duty-1.6.1/src/duty/validation.py +17 -0
  99. duty-1.6.1/tests/test_api.py +186 -0
  100. {duty-1.5.0 → duty-1.6.1}/tests/test_cli.py +27 -26
  101. {duty-1.5.0 → duty-1.6.1}/tests/test_collection.py +3 -3
  102. {duty-1.5.0 → duty-1.6.1}/tests/test_context.py +2 -2
  103. {duty-1.5.0 → duty-1.6.1}/tests/test_decorator.py +3 -3
  104. {duty-1.5.0 → duty-1.6.1}/tests/test_running.py +3 -3
  105. {duty-1.5.0 → duty-1.6.1}/tests/test_validation.py +2 -2
  106. duty-1.5.0/CODE_OF_CONDUCT.md +0 -133
  107. duty-1.5.0/docs/changelog.md +0 -1
  108. duty-1.5.0/docs/code_of_conduct.md +0 -1
  109. duty-1.5.0/docs/contributing.md +0 -1
  110. duty-1.5.0/docs/css/mkdocstrings.css +0 -27
  111. duty-1.5.0/scripts/gen_ref_nav.py +0 -37
  112. duty-1.5.0/src/duty/__init__.py +0 -10
  113. duty-1.5.0/src/duty/tools/__init__.py +0 -48
  114. {duty-1.5.0 → duty-1.6.1}/LICENSE +0 -0
  115. {duty-1.5.0 → duty-1.6.1}/README.md +0 -0
  116. {duty-1.5.0 → duty-1.6.1}/config/coverage.ini +0 -0
  117. {duty-1.5.0 → duty-1.6.1}/config/git-changelog.toml +0 -0
  118. {duty-1.5.0 → duty-1.6.1}/config/mypy.ini +0 -0
  119. {duty-1.5.0 → duty-1.6.1}/config/pytest.ini +0 -0
  120. {duty-1.5.0 → duty-1.6.1}/config/vscode/settings.json +0 -0
  121. {duty-1.5.0 → duty-1.6.1}/config/vscode/tasks.json +0 -0
  122. {duty-1.5.0 → duty-1.6.1}/docs/.overrides/main.html +0 -0
  123. {duty-1.5.0 → duty-1.6.1}/docs/css/material.css +0 -0
  124. {duty-1.5.0 → duty-1.6.1}/docs/demo.svg +0 -0
  125. {duty-1.5.0 → duty-1.6.1}/docs/gen_credits.py +0 -0
  126. {duty-1.5.0 → duty-1.6.1}/docs/js/feedback.js +0 -0
  127. {duty-1.5.0 → duty-1.6.1}/scripts/make +0 -0
  128. /duty-1.5.0/src/duty/py.typed → /duty-1.6.1/src/duty/_internal/__init__.py +0 -0
  129. {duty-1.5.0 → duty-1.6.1}/tests/__init__.py +0 -0
  130. {duty-1.5.0 → duty-1.6.1}/tests/conftest.py +0 -0
  131. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/arguments.py +0 -0
  132. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/basic.py +0 -0
  133. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/booleans.py +0 -0
  134. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/code.py +0 -0
  135. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/list.py +0 -0
  136. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/multiple.py +0 -0
  137. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/precedence.py +0 -0
  138. {duty-1.5.0 → duty-1.6.1}/tests/fixtures/validation.py +0 -0
@@ -5,6 +5,33 @@ 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.1](https://github.com/pawamoy/duty/releases/tag/1.6.1) - 2025-07-22
9
+
10
+ <small>[Compare with 1.6.0](https://github.com/pawamoy/duty/compare/1.6.0...1.6.1)</small>
11
+
12
+ ### Deprecations
13
+
14
+ - API is now exposed at the top-level, except for the `tools` (and deprecated `callables`) submodules.
15
+
16
+ ### Bug Fixes
17
+
18
+ - Add missing `rule` parameter to `ruff rule` tool ([44e60f8](https://github.com/pawamoy/duty/commit/44e60f8719aac35d1841ab8865a6535826dd7281) by Timothée Mazzucotelli).
19
+
20
+ ### Code Refactoring
21
+
22
+ - Re-add public (deprecated) modules ([f0920e8](https://github.com/pawamoy/duty/commit/f0920e83e9b9f89d8106072f8659c48163a611ef) by Timothée Mazzucotelli).
23
+ - Import from failprint directly ([285a1f7](https://github.com/pawamoy/duty/commit/285a1f7653838d33b3b8715ddc920237b33ec2e6) by Timothée Mazzucotelli).
24
+ - Re-export API ([c6ef6fe](https://github.com/pawamoy/duty/commit/c6ef6fe1dd7b04f518425d0fc901dacc3bf440fc) by Timothée Mazzucotelli).
25
+ - Move modules into internal folder ([54c2879](https://github.com/pawamoy/duty/commit/54c2879f45aad3855407612970c69bdf0b7487a5) by Timothée Mazzucotelli).
26
+
27
+ ## [1.6.0](https://github.com/pawamoy/duty/releases/tag/1.6.0) - 2025-03-01
28
+
29
+ <small>[Compare with 1.5.0](https://github.com/pawamoy/duty/compare/1.5.0...1.6.0)</small>
30
+
31
+ ### Features
32
+
33
+ - Add Yore tool ([5adf1a9](https://github.com/pawamoy/duty/commit/5adf1a9f6a303a6af03ce207e236a7b1824f52c9) by Timothée Mazzucotelli).
34
+
8
35
  ## [1.5.0](https://github.com/pawamoy/duty/releases/tag/1.5.0) - 2025-02-02
9
36
 
10
37
  <small>[Compare with 1.4.3](https://github.com/pawamoy/duty/compare/1.4.3...1.5.0)</small>
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ * Trolling, insulting or derogatory comments, and personal or political attacks
23
+ * Public or private harassment
24
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dev@pawamoy.fr. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ ## Enforcement Guidelines
44
+
45
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
+
47
+ ### 1. Correction
48
+
49
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
+
51
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
+
53
+ ### 2. Warning
54
+
55
+ **Community Impact**: A violation through a single incident or series of actions.
56
+
57
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
+
59
+ ### 3. Temporary Ban
60
+
61
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
+
63
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
+
65
+ ### 4. Permanent Ban
66
+
67
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
+
69
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
70
+
71
+ ## Attribution
72
+
73
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74
+
75
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76
+
77
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78
+
79
+ [homepage]: https://www.contributor-covenant.org
80
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81
+ [Mozilla CoC]: https://github.com/mozilla/diversity
82
+ [FAQ]: https://www.contributor-covenant.org/faq
83
+ [translations]: https://www.contributor-covenant.org/translations
84
+
@@ -1,7 +1,6 @@
1
1
  # Contributing
2
2
 
3
- Contributions are welcome, and they are greatly appreciated!
4
- Every little bit helps, and credit will always be given.
3
+ Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
5
4
 
6
5
  ## Environment setup
7
6
 
@@ -14,11 +13,7 @@ cd duty
14
13
  make setup
15
14
  ```
16
15
 
17
- > NOTE:
18
- > If it fails for some reason,
19
- > you'll need to install
20
- > [uv](https://github.com/astral-sh/uv)
21
- > manually.
16
+ > NOTE: If it fails for some reason, you'll need to install [uv](https://github.com/astral-sh/uv) manually.
22
17
  >
23
18
  > You can install it with:
24
19
  >
@@ -26,8 +21,7 @@ make setup
26
21
  > curl -LsSf https://astral.sh/uv/install.sh | sh
27
22
  > ```
28
23
  >
29
- > Now you can try running `make setup` again,
30
- > or simply `uv sync`.
24
+ > Now you can try running `make setup` again, or simply `uv sync`.
31
25
 
32
26
  You now have the dependencies installed.
33
27
 
@@ -37,15 +31,10 @@ Run `make help` to see all the available actions!
37
31
 
38
32
  ## Tasks
39
33
 
40
- The entry-point to run commands and tasks is the `make` Python script,
41
- located in the `scripts` directory. Try running `make` to show the available commands and tasks.
42
- The *commands* do not need the Python dependencies to be installed,
43
- while the *tasks* do.
44
- The cross-platform tasks are written in Python, thanks to [duty](https://github.com/pawamoy/duty).
34
+ The entry-point to run commands and tasks is the `make` Python script, located in the `scripts` directory. Try running `make` to show the available commands and tasks. The *commands* do not need the Python dependencies to be installed,
35
+ while the *tasks* do. The cross-platform tasks are written in Python, thanks to [duty](https://github.com/pawamoy/duty).
45
36
 
46
- If you work in VSCode, we provide
47
- [an action to configure VSCode](https://pawamoy.github.io/copier-uv/work/#vscode-setup)
48
- for the project.
37
+ If you work in VSCode, we provide [an action to configure VSCode](https://pawamoy.github.io/copier-uv/work/#vscode-setup) for the project.
49
38
 
50
39
  ## Development
51
40
 
@@ -64,17 +53,13 @@ As usual:
64
53
  1. go to http://localhost:8000 and check that everything looks good
65
54
  1. follow our [commit message convention](#commit-message-convention)
66
55
 
67
- If you are unsure about how to fix or ignore a warning,
68
- just let the continuous integration fail,
69
- and we will help you during review.
56
+ If you are unsure about how to fix or ignore a warning, just let the continuous integration fail, and we will help you during review.
70
57
 
71
58
  Don't bother updating the changelog, we will take care of this.
72
59
 
73
60
  ## Commit message convention
74
61
 
75
- Commit messages must follow our convention based on the
76
- [Angular style](https://gist.github.com/stephenparish/9941e89d80e2bc58a153#format-of-the-commit-message)
77
- or the [Karma convention](https://karma-runner.github.io/4.0/dev/git-commit-msg.html):
62
+ Commit messages must follow our convention based on the [Angular style](https://gist.github.com/stephenparish/9941e89d80e2bc58a153#format-of-the-commit-message) or the [Karma convention](https://karma-runner.github.io/4.0/dev/git-commit-msg.html):
78
63
 
79
64
  ```
80
65
  <type>[(scope)]: Subject
@@ -82,10 +67,7 @@ or the [Karma convention](https://karma-runner.github.io/4.0/dev/git-commit-msg.
82
67
  [Body]
83
68
  ```
84
69
 
85
- **Subject and body must be valid Markdown.**
86
- Subject must have proper casing (uppercase for first letter
87
- if it makes sense), but no dot at the end, and no punctuation
88
- in general.
70
+ **Subject and body must be valid Markdown.** Subject must have proper casing (uppercase for first letter if it makes sense), but no dot at the end, and no punctuation in general.
89
71
 
90
72
  Scope and body are optional. Type can be:
91
73
 
@@ -101,9 +83,7 @@ Scope and body are optional. Type can be:
101
83
  - `style`: A change in code style/format.
102
84
  - `tests`: About tests.
103
85
 
104
- If you write a body, please add trailers at the end
105
- (for example issues and PR references, or co-authors),
106
- without relying on GitHub's flavored Markdown:
86
+ If you write a body, please add trailers at the end (for example issues and PR references, or co-authors), without relying on GitHub's flavored Markdown:
107
87
 
108
88
  ```
109
89
  Body.
@@ -112,16 +92,9 @@ Issue #10: https://github.com/namespace/project/issues/10
112
92
  Related to PR namespace/other-project#15: https://github.com/namespace/other-project/pull/15
113
93
  ```
114
94
 
115
- These "trailers" must appear at the end of the body,
116
- without any blank lines between them. The trailer title
117
- can contain any character except colons `:`.
118
- We expect a full URI for each trailer, not just GitHub autolinks
119
- (for example, full GitHub URLs for commits and issues,
120
- not the hash or the #issue-number).
95
+ These "trailers" must appear at the end of the body, without any blank lines between them. The trailer title can contain any character except colons `:`. We expect a full URI for each trailer, not just GitHub autolinks (for example, full GitHub URLs for commits and issues, not the hash or the #issue-number).
121
96
 
122
- We do not enforce a line length on commit messages summary and body,
123
- but please avoid very long summaries, and very long lines in the body,
124
- unless they are part of code blocks that must not be wrapped.
97
+ We do not enforce a line length on commit messages summary and body, but please avoid very long summaries, and very long lines in the body, unless they are part of code blocks that must not be wrapped.
125
98
 
126
99
  ## Pull requests guidelines
127
100
 
@@ -146,5 +119,4 @@ And force-push:
146
119
  git push -f
147
120
  ```
148
121
 
149
- If this seems all too complicated, you can push or force-push each new commit,
150
- and we will squash them ourselves if needed, before merging.
122
+ If this seems all too complicated, you can push or force-push each new commit, and we will squash them ourselves if needed, before merging.
@@ -1,10 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: duty
3
- Version: 1.5.0
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
@@ -47,17 +47,24 @@ ignore = [
47
47
  ]
48
48
 
49
49
  [lint.per-file-ignores]
50
- "src/*/cli.py" = [
50
+ "src/**/cli.py" = [
51
51
  "T201", # Print statement
52
52
  ]
53
53
  "src/*/debug.py" = [
54
54
  "T201", # Print statement
55
55
  ]
56
+ "!src/*/*.py" = [
57
+ "D100", # Missing docstring in public module
58
+ ]
59
+ "!src/**.py" = [
60
+ "D101", # Missing docstring in public class
61
+ "D103", # Missing docstring in public function
62
+ ]
56
63
  "scripts/*.py" = [
57
64
  "INP001", # File is part of an implicit namespace package
58
65
  "T201", # Print statement
59
66
  ]
60
- "tests/*.py" = [
67
+ "tests/**.py" = [
61
68
  "ARG005", # Unused lambda argument
62
69
  "FBT001", # Boolean positional arg in function definition
63
70
  "PLR2004", # Magic value used in comparison
@@ -7,7 +7,17 @@
7
7
  "request": "launch",
8
8
  "program": "${file}",
9
9
  "console": "integratedTerminal",
10
- "justMyCode": false
10
+ "justMyCode": false,
11
+ "args": "${command:pickArgs}"
12
+ },
13
+ {
14
+ "name": "run",
15
+ "type": "debugpy",
16
+ "request": "launch",
17
+ "module": "duty",
18
+ "console": "integratedTerminal",
19
+ "justMyCode": false,
20
+ "args": "${command:pickArgs}"
11
21
  },
12
22
  {
13
23
  "name": "docs",
@@ -31,7 +31,7 @@
31
31
  : "light"
32
32
 
33
33
  // Instruct Giscus to set theme
34
- giscus.setAttribute("data-theme", theme)
34
+ giscus.setAttribute("data-theme", theme)
35
35
  }
36
36
 
37
37
  // Register event handlers after documented loaded
@@ -0,0 +1,22 @@
1
+ {# Fix breadcrumbs for when mkdocs-section-index is used. #}
2
+ {# See https://github.com/squidfunk/mkdocs-material/issues/7614. #}
3
+
4
+ <!-- Render navigation link content -->
5
+ {% macro render_content(nav_item) %}
6
+ <span class="md-ellipsis">
7
+ {{ nav_item.title }}
8
+ </span>
9
+ {% endmacro %}
10
+
11
+ <!-- Render navigation item -->
12
+ {% macro render(nav_item, ref=nav_item) %}
13
+ {% if nav_item.is_page %}
14
+ <li class="md-path__item">
15
+ <a href="{{ nav_item.url | url }}" class="md-path__link">
16
+ {{ render_content(ref) }}
17
+ </a>
18
+ </li>
19
+ {% elif nav_item.children %}
20
+ {{ render(nav_item.children | first, ref) }}
21
+ {% endif %}
22
+ {% endmacro %}
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Changelog
3
+ ---
4
+
5
+ --8<-- "CHANGELOG.md"
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Code of Conduct
3
+ ---
4
+
5
+ --8<-- "CODE_OF_CONDUCT.md"
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Contributing
3
+ ---
4
+
5
+ --8<-- "CONTRIBUTING.md"
@@ -1,10 +1,9 @@
1
1
  ---
2
+ title: Credits
2
3
  hide:
3
4
  - toc
4
5
  ---
5
6
 
6
- <!-- blacken-docs:off -->
7
7
  ```python exec="yes"
8
8
  --8<-- "scripts/gen_credits.py"
9
9
  ```
10
- <!-- blacken-docs:on -->
@@ -0,0 +1,72 @@
1
+ /* Indentation. */
2
+ div.doc-contents:not(.first) {
3
+ padding-left: 25px;
4
+ border-left: .05rem solid var(--md-typeset-table-color);
5
+ }
6
+
7
+ /* Mark external links as such. */
8
+ a.external::after,
9
+ a.autorefs-external::after {
10
+ /* https://primer.style/octicons/arrow-up-right-24 */
11
+ mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
12
+ -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
13
+ content: ' ';
14
+
15
+ display: inline-block;
16
+ vertical-align: middle;
17
+ position: relative;
18
+
19
+ height: 1em;
20
+ width: 1em;
21
+ background-color: currentColor;
22
+ }
23
+
24
+ a.external:hover::after,
25
+ a.autorefs-external:hover::after {
26
+ background-color: var(--md-accent-fg-color);
27
+ }
28
+
29
+ /* Tree-like output for backlinks. */
30
+ .doc-backlink-list {
31
+ --tree-clr: var(--md-default-fg-color);
32
+ --tree-font-size: 1rem;
33
+ --tree-item-height: 1;
34
+ --tree-offset: 1rem;
35
+ --tree-thickness: 1px;
36
+ --tree-style: solid;
37
+ display: grid;
38
+ list-style: none !important;
39
+ }
40
+
41
+ .doc-backlink-list li > span:first-child {
42
+ text-indent: .3rem;
43
+ }
44
+ .doc-backlink-list li {
45
+ padding-inline-start: var(--tree-offset);
46
+ border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
47
+ position: relative;
48
+ margin-left: 0 !important;
49
+
50
+ &:last-child {
51
+ border-color: transparent;
52
+ }
53
+ &::before{
54
+ content: '';
55
+ position: absolute;
56
+ top: calc(var(--tree-item-height) / 2 * -1 * var(--tree-font-size) + var(--tree-thickness));
57
+ left: calc(var(--tree-thickness) * -1);
58
+ width: calc(var(--tree-offset) + var(--tree-thickness) * 2);
59
+ height: calc(var(--tree-item-height) * var(--tree-font-size));
60
+ border-left: var(--tree-thickness) var(--tree-style) var(--tree-clr);
61
+ border-bottom: var(--tree-thickness) var(--tree-style) var(--tree-clr);
62
+ }
63
+ &::after{
64
+ content: '';
65
+ position: absolute;
66
+ border-radius: 50%;
67
+ background-color: var(--tree-clr);
68
+ top: calc(var(--tree-item-height) / 2 * 1rem);
69
+ left: var(--tree-offset) ;
70
+ translate: calc(var(--tree-thickness) * -1) calc(var(--tree-thickness) * -1);
71
+ }
72
+ }
@@ -1,4 +1,5 @@
1
1
  ---
2
+ title: Overview
2
3
  hide:
3
4
  - feedback
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ title: License
2
3
  hide:
3
4
  - feedback
4
5
  ---
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: API reference
3
+ hide:
4
+ - navigation
5
+ ---
6
+
7
+ # ::: duty
8
+ options:
9
+ show_submodules: true
@@ -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,22 +77,21 @@ 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
- You can also create your own lazy callables with [`duty.tools.Tool`][]
96
- and [`duty.tools.lazy`][failprint.lazy.lazy].
93
+ You can also create your own lazy callables with [`duty.Tool`][]
94
+ and [`duty.lazy`][].
97
95
  Check out our tools to see how to create your own.
98
96
 
99
97
  The `lazy` function/decorator is a quicker way
@@ -3,18 +3,20 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
+ import re
6
7
  import sys
7
8
  from contextlib import contextmanager
8
9
  from importlib.metadata import version as pkgversion
9
10
  from pathlib import Path
10
11
  from typing import TYPE_CHECKING
11
12
 
12
- from duty import duty, tools
13
+ from duty import duty
14
+ from duty._internal import tools
13
15
 
14
16
  if TYPE_CHECKING:
15
17
  from collections.abc import Iterator
16
18
 
17
- from duty.context import Context
19
+ from duty._internal.context import Context
18
20
 
19
21
 
20
22
  PY_SRC_PATHS = (Path(_) for _ in ("src", "tests", "duties.py", "scripts"))
@@ -26,7 +28,7 @@ PTY = not WINDOWS and not CI
26
28
  MULTIRUN = os.environ.get("MULTIRUN", "0") == "1"
27
29
 
28
30
 
29
- def pyprefix(title: str) -> str: # noqa: D103
31
+ def pyprefix(title: str) -> str:
30
32
  if MULTIRUN:
31
33
  prefix = f"(python{sys.version_info.major}.{sys.version_info.minor})"
32
34
  return f"{prefix:14}{title}"
@@ -34,7 +36,7 @@ def pyprefix(title: str) -> str: # noqa: D103
34
36
 
35
37
 
36
38
  @contextmanager
37
- def material_insiders() -> Iterator[bool]: # noqa: D103
39
+ def material_insiders() -> Iterator[bool]:
38
40
  if "+insiders" in pkgversion("mkdocs-material"):
39
41
  os.environ["MATERIAL_INSIDERS"] = "true"
40
42
  try:
@@ -45,6 +47,12 @@ def material_insiders() -> Iterator[bool]: # noqa: D103
45
47
  yield False
46
48
 
47
49
 
50
+ def _get_changelog_version() -> str:
51
+ changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$")
52
+ with Path(__file__).parent.joinpath("CHANGELOG.md").open("r", encoding="utf8") as file:
53
+ return next(filter(bool, map(changelog_version_re.match, file))).group(1) # type: ignore[union-attr]
54
+
55
+
48
56
  @duty
49
57
  def changelog(ctx: Context, bump: str = "") -> None:
50
58
  """Update the changelog in-place with latest commits.
@@ -53,6 +61,7 @@ def changelog(ctx: Context, bump: str = "") -> None:
53
61
  bump: Bump option passed to git-changelog.
54
62
  """
55
63
  ctx.run(tools.git_changelog(bump=bump or None), title="Updating changelog")
64
+ ctx.run(tools.yore.check(bump=bump or _get_changelog_version()), title="Checking legacy code")
56
65
 
57
66
 
58
67
  @duty(pre=["check-quality", "check-types", "check-docs", "check-api"])
@@ -185,7 +194,7 @@ def coverage(ctx: Context) -> None:
185
194
 
186
195
 
187
196
  @duty
188
- def test(ctx: Context, *cli_args: str, match: str = "") -> None:
197
+ def test(ctx: Context, *cli_args: str, match: str = "") -> None: # noqa: PT028
189
198
  """Run the test suite.
190
199
 
191
200
  Parameters:
@@ -20,9 +20,7 @@ nav:
20
20
  - Credits: credits.md
21
21
  - License: license.md
22
22
  - Usage: usage.md
23
- # defer to gen-files + literate-nav
24
- - API reference:
25
- - duty: reference/
23
+ - API reference: reference/api.md
26
24
  - Development:
27
25
  - Contributing: contributing.md
28
26
  - Code of Conduct: code_of_conduct.md
@@ -42,7 +40,8 @@ theme:
42
40
  - content.code.copy
43
41
  - content.tooltips
44
42
  - navigation.footer
45
- - navigation.indexes
43
+ - navigation.instant.preview
44
+ - navigation.path
46
45
  - navigation.sections
47
46
  - navigation.tabs
48
47
  - navigation.tabs.sticky
@@ -104,27 +103,25 @@ plugins:
104
103
  - search
105
104
  - autorefs
106
105
  - markdown-exec
107
- - gen-files:
108
- scripts:
109
- - scripts/gen_ref_nav.py
110
- - literate-nav:
111
- nav_file: SUMMARY.md
106
+ - section-index
112
107
  - coverage
113
108
  - mkdocstrings:
114
109
  handlers:
115
110
  python:
116
- import:
111
+ inventories:
117
112
  - https://docs.python.org/3/objects.inv
118
113
  - https://pawamoy.github.io/failprint/objects.inv
119
114
  paths: [src]
120
115
  options:
116
+ backlinks: tree
121
117
  docstring_options:
122
118
  ignore_init_summary: true
123
119
  docstring_section_style: list
124
- filters: ["!^_"]
120
+ filters: public
125
121
  heading_level: 1
126
122
  inherited_members: true
127
123
  merge_init_into_class: true
124
+ preload_modules: [failprint]
128
125
  separate_signature: true
129
126
  show_root_heading: true
130
127
  show_root_full_path: false
@@ -134,6 +131,13 @@ plugins:
134
131
  show_symbol_type_toc: true
135
132
  signature_crossrefs: true
136
133
  summary: true
134
+ - llmstxt:
135
+ full_output: llms-full.txt
136
+ sections:
137
+ Usage:
138
+ - index.md
139
+ API:
140
+ - reference/api.md
137
141
  - git-revision-date-localized:
138
142
  enabled: !ENV [DEPLOY, false]
139
143
  enable_creation_date: true