duty 1.3.0__py3-none-any.whl → 1.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
duty/tools/_twine.py ADDED
@@ -0,0 +1,289 @@
1
+ """Callable for [Twine](https://github.com/pypa/twine)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from duty.tools._base import Tool
6
+
7
+
8
+ class twine(Tool): # noqa: N801
9
+ """Call [Twine](https://github.com/pypa/twine)."""
10
+
11
+ cli_name = "twine"
12
+
13
+ @classmethod
14
+ def check(
15
+ cls,
16
+ *dists: str,
17
+ strict: bool = False,
18
+ version: bool = False,
19
+ no_color: bool = False,
20
+ ) -> twine:
21
+ """Checks whether your distribution's long description will render correctly on PyPI.
22
+
23
+ Parameters:
24
+ dists: The distribution files to check, usually `dist/*`.
25
+ strict: Fail on warnings.
26
+ version: Show program's version number and exit.
27
+ no_color: Disable colored output.
28
+ """
29
+ cli_args = ["check", *dists]
30
+
31
+ if version:
32
+ cli_args.append("--version")
33
+
34
+ if no_color:
35
+ cli_args.append("--no-color")
36
+
37
+ if strict is True:
38
+ cli_args.append("--strict")
39
+
40
+ return cls(cli_args)
41
+
42
+ @classmethod
43
+ def register(
44
+ cls,
45
+ package: str,
46
+ *,
47
+ repository: str = "pypi",
48
+ repository_url: str | None = None,
49
+ attestations: bool = False,
50
+ sign: bool = False,
51
+ sign_with: str | None = None,
52
+ identity: str | None = None,
53
+ username: str | None = None,
54
+ password: str | None = None,
55
+ non_interactive: bool = False,
56
+ comment: str | None = None,
57
+ config_file: str | None = None,
58
+ skip_existing: bool = False,
59
+ cert: str | None = None,
60
+ client_cert: str | None = None,
61
+ verbose: bool = False,
62
+ disable_progress_bar: bool = False,
63
+ version: bool = False,
64
+ no_color: bool = False,
65
+ ) -> twine:
66
+ """Pre-register a name with a repository before uploading a distribution.
67
+
68
+ Pre-registration is not supported on PyPI, so the register command
69
+ is only necessary if you are using a different repository that requires it.
70
+
71
+ Parameters:
72
+ package: File from which we read the package metadata.
73
+ repository: The repository (package index) to upload the package to.
74
+ Should be a section in the config file (default: `pypi`).
75
+ Can also be set via `TWINE_REPOSITORY` environment variable.
76
+ repository_url: The repository (package index) URL to upload the package to. This overrides `--repository`.
77
+ Can also be set via `TWINE_REPOSITORY_URL` environment variable.
78
+ attestations: Upload each file's associated attestations.
79
+ sign: Sign files to upload using GPG.
80
+ sign_with: GPG program used to sign uploads (default: `gpg`).
81
+ identity: GPG identity used to sign files.
82
+ username: The username to authenticate to the repository (package index) as.
83
+ Can also be set via `TWINE_USERNAME` environment variable.
84
+ password: The password to authenticate to the repository (package index) with.
85
+ Can also be set via `TWINE_PASSWORD` environment variable.
86
+ non_interactive: Do not interactively prompt for username/password if the required credentials are missing.
87
+ Can also be set via `TWINE_NON_INTERACTIVE` environment variable.
88
+ comment: The comment to include with the distribution file.
89
+ config_file: The `.pypirc` config file to use.
90
+ skip_existing: Continue uploading files if one already exists.
91
+ Only valid when uploading to PyPI. Other implementations may not support this.
92
+ cert: Path to alternate CA bundle (can also be set via `TWINE_CERT` environment variable).
93
+ client_cert: Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
94
+ verbose: Show verbose output.
95
+ disable_progress_bar: Disable the progress bar.
96
+ version: Show program's version number and exit.
97
+ no_color: Disable colored output.
98
+ """
99
+ cli_args = ["register", package]
100
+
101
+ if version:
102
+ cli_args.append("--version")
103
+
104
+ if no_color:
105
+ cli_args.append("--no-color")
106
+
107
+ if repository:
108
+ cli_args.append("--repository")
109
+ cli_args.append(repository)
110
+
111
+ if repository_url:
112
+ cli_args.append("--repository-url")
113
+ cli_args.append(repository_url)
114
+
115
+ if attestations:
116
+ cli_args.append("--attestations")
117
+
118
+ if sign:
119
+ cli_args.append("--sign")
120
+
121
+ if sign_with:
122
+ cli_args.append("--sign-with")
123
+ cli_args.append(sign_with)
124
+
125
+ if identity:
126
+ cli_args.append("--identity")
127
+ cli_args.append(identity)
128
+
129
+ if username:
130
+ cli_args.append("--username")
131
+ cli_args.append(username)
132
+
133
+ if password:
134
+ cli_args.append("--password")
135
+ cli_args.append(password)
136
+
137
+ if non_interactive:
138
+ cli_args.append("--non-interactive")
139
+
140
+ if comment:
141
+ cli_args.append("--repository")
142
+
143
+ if config_file:
144
+ cli_args.append("--config-file")
145
+ cli_args.append(config_file)
146
+
147
+ if skip_existing:
148
+ cli_args.append("--skip-existing")
149
+
150
+ if cert:
151
+ cli_args.append("--cert")
152
+ cli_args.append(cert)
153
+
154
+ if client_cert:
155
+ cli_args.append("--client-cert")
156
+ cli_args.append(client_cert)
157
+
158
+ if verbose:
159
+ cli_args.append("--verbose")
160
+
161
+ if disable_progress_bar:
162
+ cli_args.append("--disable-progress-bar")
163
+
164
+ return cls(cli_args)
165
+
166
+ @classmethod
167
+ def upload(
168
+ cls,
169
+ *dists: str,
170
+ repository: str = "pypi",
171
+ repository_url: str | None = None,
172
+ attestations: bool = False,
173
+ sign: bool = False,
174
+ sign_with: str | None = None,
175
+ identity: str | None = None,
176
+ username: str | None = None,
177
+ password: str | None = None,
178
+ non_interactive: bool = False,
179
+ comment: str | None = None,
180
+ config_file: str | None = None,
181
+ skip_existing: bool = False,
182
+ cert: str | None = None,
183
+ client_cert: str | None = None,
184
+ verbose: bool = False,
185
+ disable_progress_bar: bool = False,
186
+ version: bool = False,
187
+ no_color: bool = False,
188
+ ) -> twine:
189
+ """Uploads one or more distributions to a repository.
190
+
191
+ Parameters:
192
+ dists: The distribution files to check, usually `dist/*`.
193
+ repository: The repository (package index) to upload the package to.
194
+ Should be a section in the config file (default: `pypi`).
195
+ Can also be set via `TWINE_REPOSITORY` environment variable.
196
+ repository_url: The repository (package index) URL to upload the package to. This overrides `--repository`.
197
+ Can also be set via `TWINE_REPOSITORY_URL` environment variable.
198
+ attestations: Upload each file's associated attestations.
199
+ sign: Sign files to upload using GPG.
200
+ sign_with: GPG program used to sign uploads (default: `gpg`).
201
+ identity: GPG identity used to sign files.
202
+ username: The username to authenticate to the repository (package index) as.
203
+ Can also be set via `TWINE_USERNAME` environment variable.
204
+ password: The password to authenticate to the repository (package index) with.
205
+ Can also be set via `TWINE_PASSWORD` environment variable.
206
+ non_interactive: Do not interactively prompt for username/password if the required credentials are missing.
207
+ Can also be set via `TWINE_NON_INTERACTIVE` environment variable.
208
+ comment: The comment to include with the distribution file.
209
+ config_file: The `.pypirc` config file to use.
210
+ skip_existing: Continue uploading files if one already exists.
211
+ Only valid when uploading to PyPI. Other implementations may not support this.
212
+ cert: Path to alternate CA bundle (can also be set via `TWINE_CERT` environment variable).
213
+ client_cert: Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
214
+ verbose: Show verbose output.
215
+ disable_progress_bar: Disable the progress bar.
216
+ version: Show program's version number and exit.
217
+ no_color: Disable colored output.
218
+ """
219
+ cli_args = ["upload", *dists]
220
+
221
+ if version:
222
+ cli_args.append("--version")
223
+
224
+ if no_color:
225
+ cli_args.append("--no-color")
226
+
227
+ if repository:
228
+ cli_args.append("--repository")
229
+ cli_args.append(repository)
230
+
231
+ if repository_url:
232
+ cli_args.append("--repository-url")
233
+ cli_args.append(repository_url)
234
+
235
+ if attestations:
236
+ cli_args.append("--attestations")
237
+
238
+ if sign:
239
+ cli_args.append("--sign")
240
+
241
+ if sign_with:
242
+ cli_args.append("--sign-with")
243
+ cli_args.append(sign_with)
244
+
245
+ if identity:
246
+ cli_args.append("--identity")
247
+ cli_args.append(identity)
248
+
249
+ if username:
250
+ cli_args.append("--username")
251
+ cli_args.append(username)
252
+
253
+ if password:
254
+ cli_args.append("--password")
255
+ cli_args.append(password)
256
+
257
+ if non_interactive:
258
+ cli_args.append("--non-interactive")
259
+
260
+ if comment:
261
+ cli_args.append("--repository")
262
+
263
+ if config_file:
264
+ cli_args.append("--config-file")
265
+ cli_args.append(config_file)
266
+
267
+ if skip_existing:
268
+ cli_args.append("--skip-existing")
269
+
270
+ if cert:
271
+ cli_args.append("--cert")
272
+ cli_args.append(cert)
273
+
274
+ if client_cert:
275
+ cli_args.append("--client-cert")
276
+ cli_args.append(client_cert)
277
+
278
+ if verbose:
279
+ cli_args.append("--verbose")
280
+
281
+ if disable_progress_bar:
282
+ cli_args.append("--disable-progress-bar")
283
+
284
+ return cls(cli_args)
285
+
286
+ def __call__(self) -> None:
287
+ from twine.cli import dispatch as run_twine
288
+
289
+ return run_twine(self.cli_args)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: duty
3
- Version: 1.3.0
3
+ Version: 1.4.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>
@@ -31,6 +31,7 @@ Project-URL: Funding, https://github.com/sponsors/pawamoy
31
31
  Requires-Python: >=3.8
32
32
  Requires-Dist: eval-type-backport; python_version < "3.10"
33
33
  Requires-Dist: failprint!=1.0.0,>=0.11
34
+ Requires-Dist: typing-extensions>=4.0; python_version < "3.11"
34
35
  Description-Content-Type: text/markdown
35
36
 
36
37
  # duty
@@ -0,0 +1,53 @@
1
+ duty-1.4.0.dist-info/METADATA,sha256=-Slc5ZJnaArw095POkMTHNg-UyEIXgCzE79Iu--xWZc,2900
2
+ duty-1.4.0.dist-info/WHEEL,sha256=vnE8JVcI2Wz7GRKorsPArnBdnW2SWKWGow5gu5tHlRU,90
3
+ duty-1.4.0.dist-info/entry_points.txt,sha256=gxDUGvj_bg7DA77MogNmnGQSc2__ri9kAEp2RJ1p60Q,40
4
+ duty-1.4.0.dist-info/licenses/LICENSE,sha256=nQxdYSduhkgEpOTmg4yyIMmFPzcr2qrlUl8Tf9QZPug,754
5
+ duty/__init__.py,sha256=2fdBMNEBXYSCnV1GQm56VGe8VuvMp79-Hj3SHrAb5MM,144
6
+ duty/__main__.py,sha256=4YvloGDKmyVzOsE6ZdyCQyY0Jsl0LSlbqkO2UDExgmI,333
7
+ duty/callables/__init__.py,sha256=R42f1qpIy7m2MMbs6Xc_OnQiEARr4g2Pghpp9ry4JFI,1042
8
+ duty/callables/_io.py,sha256=vrMLd7ggCFDy8coWUqntmxgKC9BvFu8smK4pK2S7EeA,367
9
+ duty/callables/autoflake.py,sha256=5IUL2TUfrbWUs_-TBjzqsSHJOxGFiGtBuWBV6AIYdu4,4699
10
+ duty/callables/black.py,sha256=c2gWuhESEWRi1JGKAlMF_ZLoVJ5_bHLd7c4Lg0qyuX8,7153
11
+ duty/callables/blacken_docs.py,sha256=Ydd5Xhyo9LX9BCaSa5LwC2_76iG0TtA-LrrPFjSk3z8,3221
12
+ duty/callables/build.py,sha256=_cF8B3HKy3BWsTSLfpKwhxkZ0JVhfB3v1Zh2eO1FnQw,2150
13
+ duty/callables/coverage.py,sha256=3F2DeHyB-L-Y4v_qJU3TIGPNISnX_Nwn79JtmdE-a-0,23843
14
+ duty/callables/flake8.py,sha256=3uqFdZUF3B35Zc-otjrZfUQgEQkQ3ecZd0ZlEH83sZc,8476
15
+ duty/callables/git_changelog.py,sha256=UVojhK44Qx6wFVDQIDaqd2aMl7m3iZxQTErHVZpBMfQ,7455
16
+ duty/callables/griffe.py,sha256=J1ji2OFuGXvg-Pa9a1LXeolesk2EViiToNtrV4WBuuM,7391
17
+ duty/callables/interrogate.py,sha256=ZtpryCRAHXVumRJ5SUBib8lBxAcXmdZxGZvIXiiZ2C8,5060
18
+ duty/callables/isort.py,sha256=WutuLM1CZiobHK4Kl2N22xbZg7d0JU6MBZV2muvyG94,26437
19
+ duty/callables/mkdocs.py,sha256=laaToR_KGsPYX7zcVa9u0fC7mMbKR5PYi5g_5pBW_J8,7902
20
+ duty/callables/mypy.py,sha256=qtdOxX4x1VeEXCgY_Mw9EzKs0flBU86Ih4PKgf1WyT4,19797
21
+ duty/callables/pytest.py,sha256=GJHRZCeRhItqOA-ikcFmr9WdpN7ohwTRIIgKl7pWKyw,18345
22
+ duty/callables/ruff.py,sha256=kK4FtxEZSz5D3Evc-BLpk1GscR73m4kpXHeacC7plPc,13312
23
+ duty/callables/safety.py,sha256=sTjBad1y3Cly__QOT_z29e8KD4YOPi9FFAV1UlW-niM,2389
24
+ duty/callables/ssort.py,sha256=Lqak-xfJtKkj3AaI4_jPeaRkZ9SbvMCYhoUIVVHE6s8,842
25
+ duty/callables/twine.py,sha256=hsp8TcOYlbHCCqRwglDmNHS55LdnXFd-n2tFaJkMafs,9511
26
+ duty/cli.py,sha256=9uca96F31uTzWJuREU0ReWGhXntvjQaoSW6ZkUxBTV4,8521
27
+ duty/collection.py,sha256=cri--t6aUmOw3c17yCy9tAp_ceHfEQMhf4tMqPssNa0,6590
28
+ duty/context.py,sha256=T5PNPY6lqXQ088EriWljveFn1SWfrQNVicFbDcnk0GU,3191
29
+ duty/debug.py,sha256=9stdqxNJ9zA2HWsYfmy3C9BrWOXLlHYRGsQ6dHfCUfM,2813
30
+ duty/decorator.py,sha256=1IVYNOeVhLv4OkFtXAXcFKyy8xypfQBh3WM8aJLKohU,2986
31
+ duty/exceptions.py,sha256=gTtqtqOiMroP5-83kC5jakuwBfYKpzCQHE9RWfAGRv0,358
32
+ duty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ duty/tools/__init__.py,sha256=soQxh0HEwSV5zZhfv5DEIpBonk53-JRE0YvcXfWvPI8,1179
34
+ duty/tools/_autoflake.py,sha256=wDqNyfuC6rju9LqyTTimaQZs_8v7YvYECzdltO5rof0,5285
35
+ duty/tools/_base.py,sha256=MpjsSguxu_O6HAOkIy0hZdP2RkguS-NGVhYQHPnurWA,1474
36
+ duty/tools/_black.py,sha256=avo5-J2gHeXlOneYC0j1PSV7J-QFfPFUTdbwczsMvrA,7907
37
+ duty/tools/_blacken_docs.py,sha256=OgOSBINydrwLoITy4aoYulaQ7yE4-wCzAZ8ILN5GFng,4632
38
+ duty/tools/_build.py,sha256=QbOZzeR9T_mWkF9poalOkCWuYe22E1liMUC7aBQTJ5k,2567
39
+ duty/tools/_coverage.py,sha256=UKCu-DLyW_-en_Hn9qsh4kXyfrL7DK82VOw9Hblkh_g,26341
40
+ duty/tools/_flake8.py,sha256=ZmV_1Hy773fzP40LDNmj8YJslWatldl0qfr_g2pcgrI,9371
41
+ duty/tools/_git_changelog.py,sha256=rqpNDt2xoEKePQHxtQ3ReumsSjrcvUlaop1NsO_w-9E,8247
42
+ duty/tools/_griffe.py,sha256=ZMmreXk6iQbXtoiObwyPEWiQ5P89BpRDg-A00isvr_A,7944
43
+ duty/tools/_interrogate.py,sha256=7A9qlWsoQRk2NUlJzE_0_OiG5Infl5IF8ehEiWfqZno,5730
44
+ duty/tools/_isort.py,sha256=VbQbK4iPVNWNYlmOPDEnEcFVB6fJ66W-8s36bS9HziQ,28352
45
+ duty/tools/_mkdocs.py,sha256=GfhXUScTjGQK5Djg6fAGtLSSssdbhebL2AonG5FGPV0,9027
46
+ duty/tools/_mypy.py,sha256=6La6BTfTfMlpA4-JO8dn1O0QQ1zaVEUEp5M6cRmPr7k,21555
47
+ duty/tools/_pytest.py,sha256=HG5jmRbdCKMK6-6i8cDd4MZ1CsDhHa0TQyjls0vy1WU,20064
48
+ duty/tools/_ruff.py,sha256=9GTG4lgN1SJQFP_tg2CmqYo5hh735KkYWG8CevmavQU,15226
49
+ duty/tools/_safety.py,sha256=3kQOko-z07w8S-zq3Qs1FdVXSdY3F13QgRsx1NPPxOg,3141
50
+ duty/tools/_ssort.py,sha256=xhh5eYq16BC8KTSKDCxA10mR8RZoQuN10-xUjhu3QlE,1097
51
+ duty/tools/_twine.py,sha256=9y7-X9fqZ6wbOddGtxBMePI7hgq9QldYyMHxRBy_JXg,10347
52
+ duty/validation.py,sha256=1teu9-04anIShuOeWVcqhXLfvWOFKTSRdrclsGMZxdU,8052
53
+ duty-1.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.2.1)
2
+ Generator: pdm-backend (2.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,30 +0,0 @@
1
- duty-1.3.0.dist-info/METADATA,sha256=Z_a3NfoAhbBn6wUHNHWIa9oJ5-l5t3CeSeoqv247WME,2837
2
- duty-1.3.0.dist-info/WHEEL,sha256=7sv5iXvIiTVJSnAxCz2tGBm9DHsb2vPSzeYeT7pvGUY,90
3
- duty-1.3.0.dist-info/entry_points.txt,sha256=gxDUGvj_bg7DA77MogNmnGQSc2__ri9kAEp2RJ1p60Q,40
4
- duty-1.3.0.dist-info/licenses/LICENSE,sha256=nQxdYSduhkgEpOTmg4yyIMmFPzcr2qrlUl8Tf9QZPug,754
5
- duty/__init__.py,sha256=2fdBMNEBXYSCnV1GQm56VGe8VuvMp79-Hj3SHrAb5MM,144
6
- duty/__main__.py,sha256=4YvloGDKmyVzOsE6ZdyCQyY0Jsl0LSlbqkO2UDExgmI,333
7
- duty/callables/__init__.py,sha256=U1vfn41ZtDDdje9yLwmrdcoJ8jxANARdTCvZ8paX8W0,1661
8
- duty/callables/_io.py,sha256=vrMLd7ggCFDy8coWUqntmxgKC9BvFu8smK4pK2S7EeA,367
9
- duty/callables/autoflake.py,sha256=5IUL2TUfrbWUs_-TBjzqsSHJOxGFiGtBuWBV6AIYdu4,4699
10
- duty/callables/black.py,sha256=c2gWuhESEWRi1JGKAlMF_ZLoVJ5_bHLd7c4Lg0qyuX8,7153
11
- duty/callables/blacken_docs.py,sha256=Ydd5Xhyo9LX9BCaSa5LwC2_76iG0TtA-LrrPFjSk3z8,3221
12
- duty/callables/coverage.py,sha256=3F2DeHyB-L-Y4v_qJU3TIGPNISnX_Nwn79JtmdE-a-0,23843
13
- duty/callables/flake8.py,sha256=3uqFdZUF3B35Zc-otjrZfUQgEQkQ3ecZd0ZlEH83sZc,8476
14
- duty/callables/interrogate.py,sha256=ZtpryCRAHXVumRJ5SUBib8lBxAcXmdZxGZvIXiiZ2C8,5060
15
- duty/callables/isort.py,sha256=WutuLM1CZiobHK4Kl2N22xbZg7d0JU6MBZV2muvyG94,26437
16
- duty/callables/mkdocs.py,sha256=laaToR_KGsPYX7zcVa9u0fC7mMbKR5PYi5g_5pBW_J8,7902
17
- duty/callables/mypy.py,sha256=qtdOxX4x1VeEXCgY_Mw9EzKs0flBU86Ih4PKgf1WyT4,19797
18
- duty/callables/pytest.py,sha256=GJHRZCeRhItqOA-ikcFmr9WdpN7ohwTRIIgKl7pWKyw,18345
19
- duty/callables/ruff.py,sha256=kK4FtxEZSz5D3Evc-BLpk1GscR73m4kpXHeacC7plPc,13312
20
- duty/callables/safety.py,sha256=sTjBad1y3Cly__QOT_z29e8KD4YOPi9FFAV1UlW-niM,2389
21
- duty/callables/ssort.py,sha256=Lqak-xfJtKkj3AaI4_jPeaRkZ9SbvMCYhoUIVVHE6s8,842
22
- duty/cli.py,sha256=s62m0HO4PwdxutVX1P0H_a0yPN-mVOE5VYEJkRvJCRA,8436
23
- duty/collection.py,sha256=cri--t6aUmOw3c17yCy9tAp_ceHfEQMhf4tMqPssNa0,6590
24
- duty/context.py,sha256=aH1CPLnlHMnMaHc-cGTBv-xZioSLQxNIDo1xcQGuiO8,2985
25
- duty/debug.py,sha256=9stdqxNJ9zA2HWsYfmy3C9BrWOXLlHYRGsQ6dHfCUfM,2813
26
- duty/decorator.py,sha256=1IVYNOeVhLv4OkFtXAXcFKyy8xypfQBh3WM8aJLKohU,2986
27
- duty/exceptions.py,sha256=gTtqtqOiMroP5-83kC5jakuwBfYKpzCQHE9RWfAGRv0,358
28
- duty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- duty/validation.py,sha256=1teu9-04anIShuOeWVcqhXLfvWOFKTSRdrclsGMZxdU,8052
30
- duty-1.3.0.dist-info/RECORD,,