duty 1.6.0__tar.gz → 1.6.2__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.
- {duty-1.6.0 → duty-1.6.2}/CHANGELOG.md +28 -1
- duty-1.6.2/CODE_OF_CONDUCT.md +84 -0
- {duty-1.6.0 → duty-1.6.2}/CONTRIBUTING.md +13 -41
- {duty-1.6.0 → duty-1.6.2}/PKG-INFO +5 -4
- {duty-1.6.0 → duty-1.6.2}/config/ruff.toml +9 -2
- {duty-1.6.0 → duty-1.6.2}/config/vscode/launch.json +11 -1
- {duty-1.6.0 → duty-1.6.2}/docs/.overrides/partials/comments.html +1 -1
- duty-1.6.2/docs/.overrides/partials/path-item.html +22 -0
- duty-1.6.2/docs/changelog.md +5 -0
- duty-1.6.2/docs/code_of_conduct.md +5 -0
- duty-1.6.2/docs/contributing.md +5 -0
- {duty-1.6.0 → duty-1.6.2}/docs/credits.md +1 -2
- duty-1.6.2/docs/css/mkdocstrings.css +72 -0
- {duty-1.6.0 → duty-1.6.2}/docs/index.md +1 -0
- {duty-1.6.0 → duty-1.6.2}/docs/license.md +1 -0
- duty-1.6.2/docs/reference/api.md +9 -0
- {duty-1.6.0 → duty-1.6.2}/docs/usage.md +2 -2
- {duty-1.6.0 → duty-1.6.2}/duties.py +14 -5
- {duty-1.6.0 → duty-1.6.2}/mkdocs.yml +15 -11
- {duty-1.6.0 → duty-1.6.2}/pyproject.toml +25 -12
- {duty-1.6.0 → duty-1.6.2}/scripts/gen_credits.py +2 -2
- {duty-1.6.0 → duty-1.6.2}/scripts/get_version.py +7 -3
- {duty-1.6.0 → duty-1.6.2}/scripts/make.py +16 -6
- duty-1.6.2/src/duty/__init__.py +57 -0
- {duty-1.6.0 → duty-1.6.2}/src/duty/__main__.py +1 -1
- duty-1.6.2/src/duty/_internal/callables/__init__.py +34 -0
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/_io.py +2 -0
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/autoflake.py +4 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/black.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/blacken_docs.py +4 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/build.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/coverage.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/flake8.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/git_changelog.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/griffe.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/interrogate.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/isort.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/mkdocs.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/mypy.py +4 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/pytest.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/ruff.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/safety.py +7 -7
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/ssort.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/callables/twine.py +3 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/cli.py +8 -9
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/collection.py +16 -3
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/context.py +4 -5
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/debug.py +13 -15
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/decorator.py +2 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/exceptions.py +1 -3
- duty-1.6.2/src/duty/_internal/tools/__init__.py +41 -0
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_autoflake.py +8 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_base.py +15 -2
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_black.py +5 -5
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_blacken_docs.py +10 -5
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_build.py +4 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_coverage.py +8 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_flake8.py +10 -12
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_git_changelog.py +8 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_griffe.py +8 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_interrogate.py +4 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_isort.py +8 -6
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_mkdocs.py +8 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_mypy.py +5 -5
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_pytest.py +8 -4
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_ruff.py +11 -5
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_safety.py +13 -8
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_ssort.py +10 -6
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/tools/_twine.py +11 -5
- duty-1.6.2/src/duty/_internal/tools/_yore.py +96 -0
- {duty-1.6.0/src/duty → duty-1.6.2/src/duty/_internal}/validation.py +13 -14
- {duty-1.6.0 → duty-1.6.2}/src/duty/callables/__init__.py +4 -4
- duty-1.6.2/src/duty/callables/autoflake.py +17 -0
- duty-1.6.2/src/duty/callables/black.py +17 -0
- duty-1.6.2/src/duty/callables/blacken_docs.py +17 -0
- duty-1.6.2/src/duty/callables/build.py +17 -0
- duty-1.6.2/src/duty/callables/coverage.py +17 -0
- duty-1.6.2/src/duty/callables/flake8.py +17 -0
- duty-1.6.2/src/duty/callables/git_changelog.py +17 -0
- duty-1.6.2/src/duty/callables/griffe.py +17 -0
- duty-1.6.2/src/duty/callables/interrogate.py +17 -0
- duty-1.6.2/src/duty/callables/isort.py +17 -0
- duty-1.6.2/src/duty/callables/mkdocs.py +17 -0
- duty-1.6.2/src/duty/callables/mypy.py +17 -0
- duty-1.6.2/src/duty/callables/pytest.py +17 -0
- duty-1.6.2/src/duty/callables/ruff.py +17 -0
- duty-1.6.2/src/duty/callables/safety.py +17 -0
- duty-1.6.2/src/duty/callables/ssort.py +17 -0
- duty-1.6.2/src/duty/callables/twine.py +17 -0
- duty-1.6.2/src/duty/cli.py +17 -0
- duty-1.6.2/src/duty/collection.py +17 -0
- duty-1.6.2/src/duty/context.py +17 -0
- duty-1.6.2/src/duty/decorator.py +17 -0
- duty-1.6.2/src/duty/exceptions.py +17 -0
- duty-1.6.2/src/duty/py.typed +0 -0
- duty-1.6.2/src/duty/tools.py +63 -0
- duty-1.6.2/src/duty/validation.py +17 -0
- duty-1.6.2/tests/test_api.py +186 -0
- {duty-1.6.0 → duty-1.6.2}/tests/test_cli.py +27 -26
- {duty-1.6.0 → duty-1.6.2}/tests/test_collection.py +3 -3
- {duty-1.6.0 → duty-1.6.2}/tests/test_context.py +2 -2
- {duty-1.6.0 → duty-1.6.2}/tests/test_decorator.py +3 -3
- {duty-1.6.0 → duty-1.6.2}/tests/test_running.py +3 -3
- {duty-1.6.0 → duty-1.6.2}/tests/test_validation.py +2 -2
- duty-1.6.0/CODE_OF_CONDUCT.md +0 -133
- duty-1.6.0/docs/changelog.md +0 -1
- duty-1.6.0/docs/code_of_conduct.md +0 -1
- duty-1.6.0/docs/contributing.md +0 -1
- duty-1.6.0/docs/css/mkdocstrings.css +0 -27
- duty-1.6.0/scripts/gen_ref_nav.py +0 -37
- duty-1.6.0/src/duty/__init__.py +0 -10
- duty-1.6.0/src/duty/tools/__init__.py +0 -50
- duty-1.6.0/src/duty/tools/_yore.py +0 -54
- {duty-1.6.0 → duty-1.6.2}/LICENSE +0 -0
- {duty-1.6.0 → duty-1.6.2}/README.md +0 -0
- {duty-1.6.0 → duty-1.6.2}/config/coverage.ini +0 -0
- {duty-1.6.0 → duty-1.6.2}/config/git-changelog.toml +0 -0
- {duty-1.6.0 → duty-1.6.2}/config/mypy.ini +0 -0
- {duty-1.6.0 → duty-1.6.2}/config/pytest.ini +0 -0
- {duty-1.6.0 → duty-1.6.2}/config/vscode/settings.json +0 -0
- {duty-1.6.0 → duty-1.6.2}/config/vscode/tasks.json +0 -0
- {duty-1.6.0 → duty-1.6.2}/docs/.overrides/main.html +0 -0
- {duty-1.6.0 → duty-1.6.2}/docs/css/material.css +0 -0
- {duty-1.6.0 → duty-1.6.2}/docs/demo.svg +0 -0
- {duty-1.6.0 → duty-1.6.2}/docs/gen_credits.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/docs/js/feedback.js +0 -0
- {duty-1.6.0 → duty-1.6.2}/scripts/make +0 -0
- /duty-1.6.0/src/duty/py.typed → /duty-1.6.2/src/duty/_internal/__init__.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/src/duty/completions.bash +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/__init__.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/conftest.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/arguments.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/basic.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/booleans.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/code.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/list.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/multiple.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/precedence.py +0 -0
- {duty-1.6.0 → duty-1.6.2}/tests/fixtures/validation.py +0 -0
|
@@ -5,13 +5,40 @@ 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.2](https://github.com/pawamoy/duty/releases/tag/1.6.2) - 2025-07-22
|
|
9
|
+
|
|
10
|
+
<small>[Compare with 1.6.1](https://github.com/pawamoy/duty/compare/1.6.1...1.6.2)</small>
|
|
11
|
+
|
|
12
|
+
### Build
|
|
13
|
+
|
|
14
|
+
- Depend on failprint 1.0.5 ([cc8475c](https://github.com/pawamoy/duty/commit/cc8475c917282228087dc41836b282018d96a2ef) by Timothée Mazzucotelli).
|
|
15
|
+
|
|
16
|
+
## [1.6.1](https://github.com/pawamoy/duty/releases/tag/1.6.1) - 2025-07-22
|
|
17
|
+
|
|
18
|
+
<small>[Compare with 1.6.0](https://github.com/pawamoy/duty/compare/1.6.0...1.6.1)</small>
|
|
19
|
+
|
|
20
|
+
### Deprecations
|
|
21
|
+
|
|
22
|
+
- API is now exposed at the top-level, except for the `tools` (and deprecated `callables`) submodules.
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
- Add missing `rule` parameter to `ruff rule` tool ([44e60f8](https://github.com/pawamoy/duty/commit/44e60f8719aac35d1841ab8865a6535826dd7281) by Timothée Mazzucotelli).
|
|
27
|
+
|
|
28
|
+
### Code Refactoring
|
|
29
|
+
|
|
30
|
+
- Re-add public (deprecated) modules ([f0920e8](https://github.com/pawamoy/duty/commit/f0920e83e9b9f89d8106072f8659c48163a611ef) by Timothée Mazzucotelli).
|
|
31
|
+
- Import from failprint directly ([285a1f7](https://github.com/pawamoy/duty/commit/285a1f7653838d33b3b8715ddc920237b33ec2e6) by Timothée Mazzucotelli).
|
|
32
|
+
- Re-export API ([c6ef6fe](https://github.com/pawamoy/duty/commit/c6ef6fe1dd7b04f518425d0fc901dacc3bf440fc) by Timothée Mazzucotelli).
|
|
33
|
+
- Move modules into internal folder ([54c2879](https://github.com/pawamoy/duty/commit/54c2879f45aad3855407612970c69bdf0b7487a5) by Timothée Mazzucotelli).
|
|
34
|
+
|
|
8
35
|
## [1.6.0](https://github.com/pawamoy/duty/releases/tag/1.6.0) - 2025-03-01
|
|
9
36
|
|
|
10
37
|
<small>[Compare with 1.5.0](https://github.com/pawamoy/duty/compare/1.5.0...1.6.0)</small>
|
|
11
38
|
|
|
12
39
|
### Features
|
|
13
40
|
|
|
14
|
-
- Add Yore tool ([
|
|
41
|
+
- Add Yore tool ([5adf1a9](https://github.com/pawamoy/duty/commit/5adf1a9f6a303a6af03ce207e236a7b1824f52c9) by Timothée Mazzucotelli).
|
|
15
42
|
|
|
16
43
|
## [1.5.0](https://github.com/pawamoy/duty/releases/tag/1.5.0) - 2025-02-02
|
|
17
44
|
|
|
@@ -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
|
-
|
|
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
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: duty
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.2
|
|
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
|
|
@@ -30,7 +31,7 @@ Project-URL: Gitter, https://gitter.im/duty/community
|
|
|
30
31
|
Project-URL: Funding, https://github.com/sponsors/pawamoy
|
|
31
32
|
Requires-Python: >=3.9
|
|
32
33
|
Requires-Dist: eval-type-backport; python_version < "3.10"
|
|
33
|
-
Requires-Dist: failprint
|
|
34
|
+
Requires-Dist: failprint>=1.0.5
|
|
34
35
|
Requires-Dist: typing-extensions>=4.0; python_version < "3.11"
|
|
35
36
|
Description-Content-Type: text/markdown
|
|
36
37
|
|
|
@@ -47,17 +47,24 @@ ignore = [
|
|
|
47
47
|
]
|
|
48
48
|
|
|
49
49
|
[lint.per-file-ignores]
|
|
50
|
-
"src
|
|
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
|
|
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",
|
|
@@ -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,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
|
+
}
|
|
@@ -90,8 +90,8 @@ as well as improving readability and writability.
|
|
|
90
90
|
|
|
91
91
|
**[See all our tools in the Code reference][duty.tools].**
|
|
92
92
|
|
|
93
|
-
You can also create your own lazy callables with [`duty.
|
|
94
|
-
and [`duty.
|
|
93
|
+
You can also create your own lazy callables with [`duty.Tool`][]
|
|
94
|
+
and [`duty.lazy`][].
|
|
95
95
|
Check out our tools to see how to create your own.
|
|
96
96
|
|
|
97
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
|
|
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:
|
|
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]:
|
|
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
|
-
|
|
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.
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|