keep-github-workflows-active 2.3.0__py3-none-any.whl → 2.3.2__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.
- keep_github_workflows_active/__init__conf__.py +1 -1
- keep_github_workflows_active/cli.py +8 -7
- keep_github_workflows_active/keep_github_workflow_active.py +5 -5
- keep_github_workflows_active/typed_click.py +32 -0
- {keep_github_workflows_active-2.3.0.dist-info → keep_github_workflows_active-2.3.2.dist-info}/METADATA +10 -10
- {keep_github_workflows_active-2.3.0.dist-info → keep_github_workflows_active-2.3.2.dist-info}/RECORD +9 -8
- {keep_github_workflows_active-2.3.0.dist-info → keep_github_workflows_active-2.3.2.dist-info}/WHEEL +1 -1
- {keep_github_workflows_active-2.3.0.dist-info → keep_github_workflows_active-2.3.2.dist-info}/entry_points.txt +0 -0
- {keep_github_workflows_active-2.3.0.dist-info → keep_github_workflows_active-2.3.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -24,7 +24,7 @@ name = "keep_github_workflows_active"
|
|
|
24
24
|
#: Human-readable summary shown in CLI help output.
|
|
25
25
|
title = "Template for python apps with registered cli commands"
|
|
26
26
|
#: Current release version pulled from ``pyproject.toml`` by automation.
|
|
27
|
-
version = "2.3.
|
|
27
|
+
version = "2.3.2"
|
|
28
28
|
#: Repository homepage presented to users.
|
|
29
29
|
homepage = "https://github.com/bitranox/keep_github_workflows_active"
|
|
30
30
|
#: Author attribution surfaced in CLI output.
|
|
@@ -44,6 +44,7 @@ from dataclasses import dataclass
|
|
|
44
44
|
from typing import Final, NamedTuple
|
|
45
45
|
|
|
46
46
|
import rich_click as click
|
|
47
|
+
from .typed_click import option, version_option
|
|
47
48
|
|
|
48
49
|
import lib_cli_exit_tools
|
|
49
50
|
from click.core import ParameterSource
|
|
@@ -397,12 +398,12 @@ def _run_cli_via_exit_tools(
|
|
|
397
398
|
context_settings=CLICK_CONTEXT_SETTINGS,
|
|
398
399
|
invoke_without_command=True,
|
|
399
400
|
)
|
|
400
|
-
@
|
|
401
|
+
@version_option(
|
|
401
402
|
version=__init__conf__.version,
|
|
402
403
|
prog_name=__init__conf__.shell_command,
|
|
403
404
|
message=f"{__init__conf__.shell_command} version {__init__conf__.version}",
|
|
404
405
|
)
|
|
405
|
-
@
|
|
406
|
+
@option(
|
|
406
407
|
"--traceback/--no-traceback",
|
|
407
408
|
is_flag=True,
|
|
408
409
|
default=False,
|
|
@@ -489,12 +490,12 @@ def cli_fail() -> None:
|
|
|
489
490
|
|
|
490
491
|
|
|
491
492
|
@cli.command("enable-all-workflows", context_settings=CLICK_CONTEXT_SETTINGS)
|
|
492
|
-
@
|
|
493
|
+
@option(
|
|
493
494
|
"--owner",
|
|
494
495
|
metavar="OWNER",
|
|
495
496
|
help="GitHub username owning the repositories (defaults to environment/.env)",
|
|
496
497
|
)
|
|
497
|
-
@
|
|
498
|
+
@option(
|
|
498
499
|
"--token",
|
|
499
500
|
metavar="TOKEN",
|
|
500
501
|
help="Fine-grained personal access token (defaults to environment/.env)",
|
|
@@ -508,17 +509,17 @@ def cli_enable_all_workflows(owner: str | None, token: str | None) -> None:
|
|
|
508
509
|
|
|
509
510
|
|
|
510
511
|
@cli.command("delete-old-workflow-runs", context_settings=CLICK_CONTEXT_SETTINGS)
|
|
511
|
-
@
|
|
512
|
+
@option(
|
|
512
513
|
"--owner",
|
|
513
514
|
metavar="OWNER",
|
|
514
515
|
help="GitHub username owning the repositories (defaults to environment/.env)",
|
|
515
516
|
)
|
|
516
|
-
@
|
|
517
|
+
@option(
|
|
517
518
|
"--token",
|
|
518
519
|
metavar="TOKEN",
|
|
519
520
|
help="Fine-grained personal access token (defaults to environment/.env)",
|
|
520
521
|
)
|
|
521
|
-
@
|
|
522
|
+
@option(
|
|
522
523
|
"--keep",
|
|
523
524
|
metavar="COUNT",
|
|
524
525
|
type=int,
|
|
@@ -495,7 +495,7 @@ def get_repositories(owner: str, github_token: str) -> list[str]:
|
|
|
495
495
|
|
|
496
496
|
"""
|
|
497
497
|
repositories: list[str] = []
|
|
498
|
-
headers = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
498
|
+
headers: dict[str, str | bytes] = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
499
499
|
|
|
500
500
|
# Try the org endpoint first (returns private repos too), fall back to user endpoint.
|
|
501
501
|
org_url = f"https://api.github.com/orgs/{owner}/repos?per_page=100"
|
|
@@ -556,7 +556,7 @@ def get_workflows(owner: str, repository: str, github_token: str) -> list[str]:
|
|
|
556
556
|
"""
|
|
557
557
|
workflows: list[str] = []
|
|
558
558
|
url: str | None = f"https://api.github.com/repos/{owner}/{repository}/actions/workflows?per_page=100"
|
|
559
|
-
headers = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
559
|
+
headers: dict[str, str | bytes] = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
560
560
|
|
|
561
561
|
while url:
|
|
562
562
|
try:
|
|
@@ -599,7 +599,7 @@ def get_workflow_runs(owner: str, repository: str, github_token: str) -> list[in
|
|
|
599
599
|
|
|
600
600
|
"""
|
|
601
601
|
url: str | None = f"https://api.github.com/repos/{owner}/{repository}/actions/runs?per_page=100"
|
|
602
|
-
headers = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
602
|
+
headers: dict[str, str | bytes] = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
603
603
|
|
|
604
604
|
workflow_run_ids: list[int] = []
|
|
605
605
|
while url:
|
|
@@ -635,7 +635,7 @@ def delete_workflow_run(owner: str, repository: str, github_token: str, run_id_t
|
|
|
635
635
|
:return: None
|
|
636
636
|
"""
|
|
637
637
|
url = f"https://api.github.com/repos/{owner}/{repository}/actions/runs/{run_id_to_delete}"
|
|
638
|
-
headers = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
638
|
+
headers: dict[str, str | bytes] = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
|
|
639
639
|
|
|
640
640
|
try:
|
|
641
641
|
response = requests.delete(url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
|
|
@@ -690,7 +690,7 @@ def enable_workflow(owner: str, repository: str, workflow_filename: str, github_
|
|
|
690
690
|
|
|
691
691
|
"""
|
|
692
692
|
url = f"https://api.github.com/repos/{owner}/{repository}/actions/workflows/{workflow_filename}/enable"
|
|
693
|
-
headers = {"Accept": "application/vnd.github.v3+json", "Authorization": f"Bearer {github_token}"}
|
|
693
|
+
headers: dict[str, str | bytes] = {"Accept": "application/vnd.github.v3+json", "Authorization": f"Bearer {github_token}"}
|
|
694
694
|
|
|
695
695
|
response: requests.Response | None = None
|
|
696
696
|
try:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Strictly-typed wrappers for rich_click decorators with partially-unknown types.
|
|
2
|
+
|
|
3
|
+
rich_click ships ``py.typed`` but re-exports click's decorators, whose
|
|
4
|
+
``ParamType[Unknown]`` parameters make pyright (strict mode) report
|
|
5
|
+
``reportUnknownMemberType`` at every call site. Wrapping the affected decorators
|
|
6
|
+
here behind explicit, fully-known signatures keeps the rest of the code
|
|
7
|
+
strict-clean without disabling the rule. This module is the single boundary that
|
|
8
|
+
touches the untyped surface, so the only ``# pyright: ignore`` for this gap lives here.
|
|
9
|
+
|
|
10
|
+
Other click members (``command``, ``group``, ``Path`` …) type cleanly and are
|
|
11
|
+
still used directly as ``click.X`` at call sites.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from collections.abc import Callable
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
import rich_click as click
|
|
18
|
+
|
|
19
|
+
_CommandDecorator = Callable[[Callable[..., Any]], Callable[..., Any]]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def option(*param_decls: str, **attrs: Any) -> _CommandDecorator:
|
|
23
|
+
"""Typed wrapper over :func:`rich_click.option`. See module docstring."""
|
|
24
|
+
return click.option(*param_decls, **attrs) # pyright: ignore[reportUnknownMemberType]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def version_option(*param_decls: str, **attrs: Any) -> _CommandDecorator:
|
|
28
|
+
"""Typed wrapper over :func:`rich_click.version_option`. See module docstring."""
|
|
29
|
+
return click.version_option(*param_decls, **attrs) # pyright: ignore[reportUnknownMemberType]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
__all__ = ["option", "version_option"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: keep_github_workflows_active
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2
|
|
4
4
|
Summary: Template for python apps with registered cli commands
|
|
5
5
|
Project-URL: Homepage, https://github.com/bitranox/keep_github_workflows_active
|
|
6
6
|
Project-URL: Repository, https://github.com/bitranox/keep_github_workflows_active.git
|
|
@@ -17,22 +17,22 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
18
18
|
Classifier: Typing :: Typed
|
|
19
19
|
Requires-Python: >=3.10
|
|
20
|
-
Requires-Dist: lib-cli-exit-tools>=2.3.
|
|
21
|
-
Requires-Dist: pydantic>=2.13.
|
|
22
|
-
Requires-Dist: requests>=2.
|
|
23
|
-
Requires-Dist: rich-click>=1.9.
|
|
20
|
+
Requires-Dist: lib-cli-exit-tools>=2.3.2
|
|
21
|
+
Requires-Dist: pydantic>=2.13.4
|
|
22
|
+
Requires-Dist: requests>=2.34.2
|
|
23
|
+
Requires-Dist: rich-click>=1.9.8
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: bandit>=1.9.4; extra == 'dev'
|
|
26
26
|
Requires-Dist: build>=1.5.0; extra == 'dev'
|
|
27
27
|
Requires-Dist: codecov-cli>=11.2.8; extra == 'dev'
|
|
28
28
|
Requires-Dist: import-linter>=2.11; extra == 'dev'
|
|
29
|
-
Requires-Dist: pip-audit>=2.10.
|
|
30
|
-
Requires-Dist: pyright[nodejs]>=1.1.
|
|
29
|
+
Requires-Dist: pip-audit>=2.10.1; extra == 'dev'
|
|
30
|
+
Requires-Dist: pyright[nodejs]>=1.1.410; extra == 'dev'
|
|
31
31
|
Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
|
|
32
|
-
Requires-Dist: pytest>=9.0
|
|
32
|
+
Requires-Dist: pytest>=9.1.0; extra == 'dev'
|
|
33
33
|
Requires-Dist: rtoml>=0.13.0; extra == 'dev'
|
|
34
|
-
Requires-Dist: ruff>=0.15.
|
|
35
|
-
Requires-Dist: textual>=8.2.
|
|
34
|
+
Requires-Dist: ruff>=0.15.17; extra == 'dev'
|
|
35
|
+
Requires-Dist: textual>=8.2.7; extra == 'dev'
|
|
36
36
|
Requires-Dist: twine>=6.2.0; extra == 'dev'
|
|
37
37
|
Description-Content-Type: text/markdown
|
|
38
38
|
|
{keep_github_workflows_active-2.3.0.dist-info → keep_github_workflows_active-2.3.2.dist-info}/RECORD
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
keep_github_workflows_active/__init__.py,sha256=tAEJPhRW07E84IzHijcwAf-iu8fhAf3TsvBUQqGz-fY,399
|
|
2
|
-
keep_github_workflows_active/__init__conf__.py,sha256=
|
|
2
|
+
keep_github_workflows_active/__init__conf__.py,sha256=UFtHXaX8-YSHnd1vjmjAwo8lXbwMzt2Lp1N6t4eA2zg,2562
|
|
3
3
|
keep_github_workflows_active/__main__.py,sha256=79coRxvGs07uGBSdbw_HpcIv_rqogXvoEkv3lNEEIjE,3552
|
|
4
4
|
keep_github_workflows_active/behaviors.py,sha256=PYDhp_ubXhLud2IVFLIJKylStu36W4Qm7E_daT2dOAM,3741
|
|
5
|
-
keep_github_workflows_active/cli.py,sha256=
|
|
5
|
+
keep_github_workflows_active/cli.py,sha256=5JvgQSG7vdCD33WB31hLCWaeOjcFmFzSIeECCKBipeE,19013
|
|
6
6
|
keep_github_workflows_active/doctest.env,sha256=WmDSq0QN1PFXpP4jq7JW_Kz-k5PT5uS8KzLrAEmJNC8,25
|
|
7
|
-
keep_github_workflows_active/keep_github_workflow_active.py,sha256=
|
|
7
|
+
keep_github_workflows_active/keep_github_workflow_active.py,sha256=Ri4xOS-Cbg1qO2EasRzlvV59Du0WBruiCnpntVN8cBI,25779
|
|
8
8
|
keep_github_workflows_active/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
keep_github_workflows_active/sanitization.py,sha256=zyPybyYLBWd__nITF8nyrubA3NJWXjyGkznw-4kJtyA,9801
|
|
10
|
-
keep_github_workflows_active
|
|
11
|
-
keep_github_workflows_active-2.3.
|
|
12
|
-
keep_github_workflows_active-2.3.
|
|
13
|
-
keep_github_workflows_active-2.3.
|
|
14
|
-
keep_github_workflows_active-2.3.
|
|
10
|
+
keep_github_workflows_active/typed_click.py,sha256=IT7GkOwnlq4ZlnGEKHl-nqkzN0Fd6YqjWOBdYFH96uU,1380
|
|
11
|
+
keep_github_workflows_active-2.3.2.dist-info/METADATA,sha256=Xda34BPNWHukVnVvRTj9zWqnbnEo39P-NPTMZPQjWBs,9413
|
|
12
|
+
keep_github_workflows_active-2.3.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
13
|
+
keep_github_workflows_active-2.3.2.dist-info/entry_points.txt,sha256=6B8ytwKR2VIAj6IXUYhF957dlfulwTPPLR39RBXwCM0,156
|
|
14
|
+
keep_github_workflows_active-2.3.2.dist-info/licenses/LICENSE,sha256=6s9SL2InRrwynPjJYiER7ONHBshbGj_yC5EBzfo7l9I,1072
|
|
15
|
+
keep_github_workflows_active-2.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|