duty 1.6.0__py3-none-any.whl → 1.6.1__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.
Files changed (82) hide show
  1. duty/__init__.py +49 -2
  2. duty/__main__.py +1 -1
  3. duty/_internal/__init__.py +0 -0
  4. duty/_internal/callables/__init__.py +34 -0
  5. duty/{callables → _internal/callables}/_io.py +2 -0
  6. duty/_internal/callables/autoflake.py +132 -0
  7. duty/_internal/callables/black.py +176 -0
  8. duty/_internal/callables/blacken_docs.py +92 -0
  9. duty/_internal/callables/build.py +76 -0
  10. duty/_internal/callables/coverage.py +716 -0
  11. duty/_internal/callables/flake8.py +222 -0
  12. duty/_internal/callables/git_changelog.py +178 -0
  13. duty/_internal/callables/griffe.py +227 -0
  14. duty/_internal/callables/interrogate.py +152 -0
  15. duty/_internal/callables/isort.py +573 -0
  16. duty/_internal/callables/mkdocs.py +256 -0
  17. duty/_internal/callables/mypy.py +496 -0
  18. duty/_internal/callables/pytest.py +475 -0
  19. duty/_internal/callables/ruff.py +399 -0
  20. duty/_internal/callables/safety.py +82 -0
  21. duty/_internal/callables/ssort.py +38 -0
  22. duty/_internal/callables/twine.py +284 -0
  23. duty/_internal/cli.py +322 -0
  24. duty/_internal/collection.py +246 -0
  25. duty/_internal/context.py +111 -0
  26. duty/{debug.py → _internal/debug.py} +13 -15
  27. duty/_internal/decorator.py +111 -0
  28. duty/_internal/exceptions.py +12 -0
  29. duty/_internal/tools/__init__.py +41 -0
  30. duty/{tools → _internal/tools}/_autoflake.py +8 -4
  31. duty/{tools → _internal/tools}/_base.py +15 -2
  32. duty/{tools → _internal/tools}/_black.py +5 -5
  33. duty/{tools → _internal/tools}/_blacken_docs.py +10 -5
  34. duty/{tools → _internal/tools}/_build.py +4 -4
  35. duty/{tools → _internal/tools}/_coverage.py +8 -4
  36. duty/{tools → _internal/tools}/_flake8.py +10 -12
  37. duty/{tools → _internal/tools}/_git_changelog.py +8 -4
  38. duty/{tools → _internal/tools}/_griffe.py +8 -4
  39. duty/{tools → _internal/tools}/_interrogate.py +4 -4
  40. duty/{tools → _internal/tools}/_isort.py +8 -6
  41. duty/{tools → _internal/tools}/_mkdocs.py +8 -4
  42. duty/{tools → _internal/tools}/_mypy.py +5 -5
  43. duty/{tools → _internal/tools}/_pytest.py +8 -4
  44. duty/{tools → _internal/tools}/_ruff.py +11 -5
  45. duty/{tools → _internal/tools}/_safety.py +13 -8
  46. duty/{tools → _internal/tools}/_ssort.py +10 -6
  47. duty/{tools → _internal/tools}/_twine.py +11 -5
  48. duty/_internal/tools/_yore.py +96 -0
  49. duty/_internal/validation.py +266 -0
  50. duty/callables/__init__.py +4 -4
  51. duty/callables/autoflake.py +11 -126
  52. duty/callables/black.py +12 -171
  53. duty/callables/blacken_docs.py +11 -86
  54. duty/callables/build.py +12 -71
  55. duty/callables/coverage.py +12 -711
  56. duty/callables/flake8.py +12 -217
  57. duty/callables/git_changelog.py +12 -173
  58. duty/callables/griffe.py +12 -222
  59. duty/callables/interrogate.py +12 -147
  60. duty/callables/isort.py +12 -568
  61. duty/callables/mkdocs.py +12 -251
  62. duty/callables/mypy.py +11 -490
  63. duty/callables/pytest.py +12 -470
  64. duty/callables/ruff.py +12 -394
  65. duty/callables/safety.py +11 -76
  66. duty/callables/ssort.py +12 -33
  67. duty/callables/twine.py +12 -279
  68. duty/cli.py +10 -316
  69. duty/collection.py +12 -228
  70. duty/context.py +12 -107
  71. duty/decorator.py +12 -108
  72. duty/exceptions.py +13 -10
  73. duty/tools.py +63 -0
  74. duty/validation.py +12 -262
  75. {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/METADATA +4 -3
  76. duty-1.6.1.dist-info/RECORD +81 -0
  77. {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/WHEEL +1 -1
  78. {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/entry_points.txt +1 -1
  79. duty/tools/__init__.py +0 -50
  80. duty/tools/_yore.py +0 -54
  81. duty-1.6.0.dist-info/RECORD +0 -55
  82. {duty-1.6.0.dist-info → duty-1.6.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,152 +1,17 @@
1
- """Callable for [Interrogate](https://github.com/econchick/interrogate)."""
1
+ """Deprecated. Use [`duty.tools.interrogate`][] instead."""
2
2
 
3
- from __future__ import annotations
3
+ # YORE: Bump 2: Remove file.
4
4
 
5
- from typing import Literal
5
+ import warnings
6
+ from typing import Any
6
7
 
7
- from failprint.lazy import lazy
8
+ from duty._internal.callables import interrogate as _interrogate
8
9
 
9
- _BADGE_STYLE = Literal["flat", "flat-square", "flat-square-modified", "for-the-badge", "plastic", "social"]
10
10
 
11
-
12
- @lazy(name="interrogate")
13
- def run(
14
- *src: str,
15
- verbose: int | None = None,
16
- quiet: bool | None = None,
17
- fail_under: float | None = None,
18
- exclude: str | None = None,
19
- ignore_init_method: bool | None = None,
20
- ignore_init_module: bool | None = None,
21
- ignore_magic: bool | None = None,
22
- ignore_module: bool | None = None,
23
- ignore_nested_functions: bool | None = None,
24
- ignore_nested_classes: bool | None = None,
25
- ignore_private: bool | None = None,
26
- ignore_property_decorators: bool | None = None,
27
- ignore_setters: bool | None = None,
28
- ignore_semiprivate: bool | None = None,
29
- ignore_regex: str | None = None,
30
- whitelist_regex: str | None = None,
31
- output: str | None = None,
32
- config: str | None = None,
33
- color: bool | None = None,
34
- omit_covered_files: bool | None = None,
35
- generate_badge: str | None = None,
36
- badge_format: Literal["png", "svg"] | None = None,
37
- badge_style: _BADGE_STYLE | None = None,
38
- ) -> None:
39
- """Run `interrogate`.
40
-
41
- Args:
42
- src: Format the directories and file paths.
43
- verbose: Level of verbosity.
44
- quiet: Do not print output.
45
- fail_under: Fail when coverage % is less than a given amount.
46
- exclude: Exclude PATHs of files and/or directories.
47
- ignore_init_method: Ignore `__init__` method of classes.
48
- ignore_init_module: Ignore `__init__.py` modules.
49
- ignore_magic: Ignore all magic methods of classes.
50
- ignore_module: Ignore module-level docstrings.
51
- ignore_nested_functions: Ignore nested functions and methods.
52
- ignore_nested_classes: Ignore nested classes.
53
- ignore_private: Ignore private classes, methods, and functions starting with two underscores.
54
- ignore_property_decorators: Ignore methods with property setter/getter decorators.
55
- ignore_setters: Ignore methods with property setter decorators.
56
- ignore_semiprivate: Ignore semiprivate classes, methods, and functions starting with a single underscore.
57
- ignore_regex: Regex identifying class, method, and function names to ignore.
58
- whitelist_regex: Regex identifying class, method, and function names to include.
59
- output: Write output to a given FILE.
60
- config: Read configuration from pyproject.toml or setup.cfg.
61
- color: Toggle color output on/off when printing to stdout.
62
- omit_covered_files: Omit reporting files that have 100% documentation coverage.
63
- generate_badge: Generate a shields.io status badge (an SVG image) in at a given file or directory.
64
- badge_format: File format for the generated badge.
65
- badge_style: Desired style of shields.io badge.
66
- """
67
- from interrogate.cli import main as interrogate
68
-
69
- cli_args: list[str] = list(src)
70
-
71
- if verbose:
72
- cli_args.append("--verbose")
73
- cli_args.append(str(verbose))
74
-
75
- if quiet:
76
- cli_args.append("--quiet")
77
-
78
- if fail_under:
79
- cli_args.append("--fail-under")
80
- cli_args.append(str(fail_under))
81
-
82
- if exclude:
83
- cli_args.append("--exclude")
84
- cli_args.append(exclude)
85
-
86
- if ignore_init_method:
87
- cli_args.append("--ignore-init-method")
88
-
89
- if ignore_init_module:
90
- cli_args.append("--ignore-init-module")
91
-
92
- if ignore_magic:
93
- cli_args.append("--ignore-magic")
94
-
95
- if ignore_module:
96
- cli_args.append("--ignore-module")
97
-
98
- if ignore_nested_functions:
99
- cli_args.append("--ignore-nested-functions")
100
-
101
- if ignore_nested_classes:
102
- cli_args.append("--ignore-nested-classes")
103
-
104
- if ignore_private:
105
- cli_args.append("--ignore-private")
106
-
107
- if ignore_property_decorators:
108
- cli_args.append("--ignore-property-decorators")
109
-
110
- if ignore_setters:
111
- cli_args.append("--ignore-setters")
112
-
113
- if ignore_semiprivate:
114
- cli_args.append("--ignore-semiprivate")
115
-
116
- if ignore_regex:
117
- cli_args.append("--ignore-regex")
118
- cli_args.append(ignore_regex)
119
-
120
- if whitelist_regex:
121
- cli_args.append("--whitelist-regex")
122
- cli_args.append(whitelist_regex)
123
-
124
- if output:
125
- cli_args.append("--output")
126
- cli_args.append(output)
127
-
128
- if omit_covered_files:
129
- cli_args.append("--omit-covered-files")
130
-
131
- if generate_badge:
132
- cli_args.append("--generate-badge")
133
- cli_args.append(generate_badge)
134
-
135
- if badge_format:
136
- cli_args.append("--badge-format")
137
- cli_args.append(badge_format)
138
-
139
- if badge_style:
140
- cli_args.append("--badge-style")
141
- cli_args.append(badge_style)
142
-
143
- if config:
144
- cli_args.append("--config")
145
- cli_args.append(config)
146
-
147
- if color is True:
148
- cli_args.append("--color")
149
- elif color is False:
150
- cli_args.append("--no-color")
151
-
152
- interrogate(cli_args)
11
+ def __getattr__(name: str) -> Any:
12
+ warnings.warn(
13
+ "Callables are deprecated in favor of tools, use `duty.tools.interrogate` instead of `duty.callables.interrogate`.",
14
+ DeprecationWarning,
15
+ stacklevel=2,
16
+ )
17
+ return getattr(_interrogate, name)