keep-github-workflows-active 2.3.3__tar.gz → 2.3.5__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.
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/workflows/default_cicd_public.yml +42 -6
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.gitignore +8 -5
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/CHANGELOG.md +21 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/Makefile +38 -4
- keep_github_workflows_active-2.3.5/OPEN-WORK.md +5 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/PKG-INFO +42 -12
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/README.md +29 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/docs/systemdesign/module_reference.md +5 -13
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/pyproject.toml +15 -12
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/__init__conf__.py +1 -1
- keep_github_workflows_active-2.3.5/src/keep_github_workflows_active/__main__.py +13 -0
- keep_github_workflows_active-2.3.5/tests/test_module_entry.py +79 -0
- keep_github_workflows_active-2.3.5/uv.lock +1950 -0
- keep_github_workflows_active-2.3.3/src/keep_github_workflows_active/__main__.py +0 -117
- keep_github_workflows_active-2.3.3/tests/test_module_entry.py +0 -166
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.devcontainer/devcontainer.json +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.devcontainer/settings.json +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.env.example +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.gitattributes +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/actions/extract-metadata/action.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/dependabot.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/workflows/activate_workflows.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/workflows/activate_workflows_priv.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/workflows/codeql.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.github/workflows/default_release_public.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.qlty/qlty.toml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/.snyk +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/CONTRIBUTING.md +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/DEVELOPMENT.md +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/INSTALL.md +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/LICENSE +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/codecov.yml +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/concept.md +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/docs/systemdesign/SECURITY.md +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/notebooks/Quickstart.ipynb +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/__init__.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/behaviors.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/cli.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/doctest.env +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/keep_github_workflow_active.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/py.typed +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/sanitization.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/src/keep_github_workflows_active/typed_click.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/tests/conftest.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/tests/test_behaviors.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/tests/test_cli.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/tests/test_github_integration.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/tests/test_metadata.py +0 -0
- {keep_github_workflows_active-2.3.3 → keep_github_workflows_active-2.3.5}/tests/test_sanitization.py +0 -0
|
@@ -124,9 +124,36 @@ jobs:
|
|
|
124
124
|
print("No CI system dependencies configured for macOS.")
|
|
125
125
|
|
|
126
126
|
- name: Install dev deps
|
|
127
|
-
shell:
|
|
127
|
+
shell: python
|
|
128
128
|
run: |
|
|
129
|
-
|
|
129
|
+
import os, subprocess, tempfile
|
|
130
|
+
from pathlib import Path
|
|
131
|
+
try:
|
|
132
|
+
import tomllib
|
|
133
|
+
except ModuleNotFoundError:
|
|
134
|
+
import pip._vendor.tomli as tomllib
|
|
135
|
+
|
|
136
|
+
# Push and pull_request runs install exactly the tree uv.lock pins - versions
|
|
137
|
+
# plus file hashes, which uv verifies - so CI tests what the lock ships and no
|
|
138
|
+
# release published upstream since the last lock refresh can enter the build.
|
|
139
|
+
# The nightly schedule run resolves afresh instead (still inside the project's
|
|
140
|
+
# [tool.uv] exclude-newer cooldown, which uv honours here): it is the canary
|
|
141
|
+
# that reports upstream breakage before a lock refresh adopts it. A project
|
|
142
|
+
# without a uv.lock keeps the unlocked install.
|
|
143
|
+
with open("pyproject.toml", "rb") as f:
|
|
144
|
+
data = tomllib.load(f)
|
|
145
|
+
# Asking uv for an extra the project does not declare is a hard error.
|
|
146
|
+
extra = ["--extra", "dev"] if "dev" in data.get("project", {}).get("optional-dependencies", {}) else []
|
|
147
|
+
target = ["--system"] # setup-python's interpreter; the job runs no venv
|
|
148
|
+
locked = Path("uv.lock").is_file() and os.environ["GITHUB_EVENT_NAME"] != "schedule"
|
|
149
|
+
if locked:
|
|
150
|
+
req = Path(tempfile.mkdtemp()) / "locked-requirements.txt"
|
|
151
|
+
# --locked fails when pyproject.toml changed without a lock refresh.
|
|
152
|
+
subprocess.check_call(["uv", "export", "--locked", "--no-emit-project", *extra, "-o", str(req), "--quiet"])
|
|
153
|
+
subprocess.check_call(["uv", "pip", "install", *target, "-r", str(req)])
|
|
154
|
+
subprocess.check_call(["uv", "pip", "install", *target, "--no-deps", "-e", "."])
|
|
155
|
+
else:
|
|
156
|
+
subprocess.check_call(["uv", "pip", "install", *target, "-e", ".[dev]" if extra else "."])
|
|
130
157
|
|
|
131
158
|
- name: Install CI system dependencies (Windows/choco)
|
|
132
159
|
if: runner.os == 'Windows'
|
|
@@ -236,7 +263,7 @@ jobs:
|
|
|
236
263
|
continue-on-error: true
|
|
237
264
|
shell: python
|
|
238
265
|
run: |
|
|
239
|
-
import subprocess, sys, tempfile
|
|
266
|
+
import os, subprocess, sys, tempfile
|
|
240
267
|
import rtoml
|
|
241
268
|
from pathlib import Path
|
|
242
269
|
|
|
@@ -263,9 +290,18 @@ jobs:
|
|
|
263
290
|
|
|
264
291
|
tmp = Path(tempfile.mkdtemp())
|
|
265
292
|
req = tmp / "compiled-requirements.txt"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
293
|
+
# With a uv.lock the install step put exactly the locked tree on the
|
|
294
|
+
# runner, so audit that tree; the schedule canary and lock-less
|
|
295
|
+
# projects resolve pyproject.toml afresh, as their install did.
|
|
296
|
+
if Path("uv.lock").is_file() and os.environ["GITHUB_EVENT_NAME"] != "schedule":
|
|
297
|
+
subprocess.check_call(
|
|
298
|
+
["uv", "export", "--locked", "--no-emit-project", "--no-hashes", *selector,
|
|
299
|
+
"-o", str(req), "--quiet"]
|
|
300
|
+
)
|
|
301
|
+
else:
|
|
302
|
+
subprocess.check_call(
|
|
303
|
+
["uv", "pip", "compile", *selector, "pyproject.toml", "-o", str(req), "--quiet"]
|
|
304
|
+
)
|
|
269
305
|
|
|
270
306
|
# Drop direct URL references ("pkg @ git+https://...") before auditing.
|
|
271
307
|
# pip-audit cannot audit those (they are not on PyPI) but, given a
|
|
@@ -46,7 +46,8 @@ tmp_*
|
|
|
46
46
|
# *.py[cod]: catches .pyc, .pyo, .pyd
|
|
47
47
|
__pycache__/
|
|
48
48
|
*.py[cod]
|
|
49
|
-
|
|
49
|
+
# other compiled artifacts
|
|
50
|
+
*$py.class
|
|
50
51
|
|
|
51
52
|
# pytest, coverage, MyPy, Hypothesis
|
|
52
53
|
.pytest_cache/
|
|
@@ -72,12 +73,15 @@ coverage.xml
|
|
|
72
73
|
# source/package builds
|
|
73
74
|
build/
|
|
74
75
|
dist/
|
|
75
|
-
|
|
76
|
+
# metadata for pip installs
|
|
77
|
+
*.egg-info/
|
|
76
78
|
*.egg
|
|
77
79
|
*.whl
|
|
78
80
|
pip-wheel-metadata/
|
|
79
|
-
|
|
80
|
-
*.
|
|
81
|
+
# PyInstaller metadata
|
|
82
|
+
*.manifest
|
|
83
|
+
# PyInstaller spec files
|
|
84
|
+
*.spec
|
|
81
85
|
|
|
82
86
|
# Eggs, parts, wheels, sdist, etc.
|
|
83
87
|
develop-eggs/
|
|
@@ -177,7 +181,6 @@ result
|
|
|
177
181
|
# Optional lockfiles (for alternative managers)
|
|
178
182
|
poetry.lock
|
|
179
183
|
pdm.lock
|
|
180
|
-
uv.lock
|
|
181
184
|
/.github.bak/
|
|
182
185
|
.claude/
|
|
183
186
|
CLAUDE.md
|
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.3.5] 2026-10-12 22:50:01
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Python 3.15 is a supported version: declared in the classifiers, so CI and `make test-all` run it.
|
|
9
|
+
- `uv.lock` is committed, and `[tool.uv] exclude-newer` sets a cooldown that keeps releases younger
|
|
10
|
+
than it out of the lock. CI installs exactly the locked tree on push and pull request; the nightly
|
|
11
|
+
scheduled run still resolves afresh to catch upstream breakage early.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- The install section explains why installing with uv protects against supply-chain attacks and why
|
|
15
|
+
a plain `pip install` from PyPI does not.
|
|
16
|
+
- `rtoml` floor raised to 0.14.0, the first release with Python 3.15 wheels.
|
|
17
|
+
|
|
18
|
+
## [2.3.4] 2026-10-05 19:35:58
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- `python -m keep_github_workflows_active` now runs `cli.main()` like the console scripts; a usage error (bad flag, unknown command) exits 2 instead of 1.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Raised dependency and dev tool floors to their current releases.
|
|
25
|
+
|
|
5
26
|
## [2.3.3] 2026-07-24
|
|
6
27
|
|
|
7
28
|
### Changed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# BMK MAKEFILE 3.
|
|
1
|
+
# BMK MAKEFILE 3.21.0
|
|
2
2
|
# do not alter this file - it might be overwritten on new versions of BMK
|
|
3
3
|
# if You want to alter it, remove the first line # BMK MAKEFILE 1.0 - then it is a custom makefile and will not be overwritten
|
|
4
4
|
# bmk Makefile - thin wrapper using `uv tool upgrade` for persistent bmk
|
|
@@ -186,16 +186,50 @@ endif
|
|
|
186
186
|
# BMK_MIN floors the FALLBACK install. The upgrade path does not consult it: uv re-resolves
|
|
187
187
|
# the requirement recorded at install time, which is itself a `bmk>=...`, so it always lands
|
|
188
188
|
# on the newest release and clears the floor anyway.
|
|
189
|
-
BMK_MIN := 3.
|
|
189
|
+
BMK_MIN := 3.21.0
|
|
190
190
|
|
|
191
191
|
# Absent env, missing check, or damaged env - all three mean "do not upgrade, rebuild".
|
|
192
192
|
# `test -x` keeps a fresh machine quiet: there is no interpreter to run yet.
|
|
193
193
|
BMK_INTACT := $(if $(BMK_PY),test -x "$(BMK_PY)" && "$(BMK_PY)" -m bmk_selfcheck,false)
|
|
194
194
|
|
|
195
|
+
# The env this recipe mutates is shared by EVERY repo on the machine, so the mutation has to
|
|
196
|
+
# wait for the bmk processes running out of it. Every bmk started from that env holds a
|
|
197
|
+
# SHARED lock on <uv tool dir>/.bmk-tool.lock for its whole lifetime; these wrappers take
|
|
198
|
+
# the same lock EXCLUSIVE for the length of the upgrade. Without it, a make here deleted the
|
|
199
|
+
# site-packages out from under a bmk minutes into a test suite in an UNRELATED repo, and it
|
|
200
|
+
# surfaced as an ImportError inside bmk's OWN dependencies that cleared on a re-run - so it
|
|
201
|
+
# read as a flake rather than as the environment vanishing mid-gate.
|
|
202
|
+
#
|
|
203
|
+
# `bmk_toollock` is a second stdlib-only TOP-LEVEL module bmk ships, run on the tool env's
|
|
204
|
+
# own interpreter. That is not circular: a uv tool env's bin/python is a SYMLINK to a base
|
|
205
|
+
# interpreter OUTSIDE the tool dir, so the stdlib the guard runs on is not part of the tree
|
|
206
|
+
# uv is about to replace, and the guard is read and compiled before uv is ever spawned.
|
|
207
|
+
#
|
|
208
|
+
# NOT uv's own <uv tool dir>/.lock, which uv does honour: `uv tool upgrade` and `uv tool
|
|
209
|
+
# list` block on it too (measured), and the upgrade runs before every target - so a
|
|
210
|
+
# gate-lifetime shared lock there would make every make on the machine, and every unrelated
|
|
211
|
+
# `uv tool install`, wait for the longest-running gate.
|
|
212
|
+
#
|
|
213
|
+
# $(wildcard) rather than a shell test: on a machine with no tool env yet these expand to
|
|
214
|
+
# NOTHING and the install runs bare, which is exactly what a first install needs.
|
|
215
|
+
#
|
|
216
|
+
# The bounded wait is load-bearing in both directions. An unbounded one would serialise
|
|
217
|
+
# every repo's make behind the longest gate on the machine. A SKIPPED upgrade costs nothing
|
|
218
|
+
# (the next make picks it up), so the upgrade skips. The REPAIR may not skip: proceeding
|
|
219
|
+
# would leave a damaged env in place, so it fails and drops through to the retry.
|
|
220
|
+
#
|
|
221
|
+
# The LAST attempt is deliberately NEVER guarded, and a test pins that. The guard lives
|
|
222
|
+
# inside the env being repaired, so on the path where that env is absent or broken the guard
|
|
223
|
+
# may be broken too; an unguarded last resort is what stops a defective guard from making
|
|
224
|
+
# `make` unrunnable in every repo at once. If bmk_toollock ever falls out of the wheel, every
|
|
225
|
+
# make everywhere drops to a full reinstall - there is a packaging test for exactly that.
|
|
226
|
+
BMK_LOCK := $(if $(wildcard $(BMK_PY)),"$(BMK_PY)" -m bmk_toollock --exclusive --timeout 10 --on-timeout skip --,)
|
|
227
|
+
BMK_LOCK_REPAIR := $(if $(wildcard $(BMK_PY)),"$(BMK_PY)" -m bmk_toollock --exclusive --timeout 60 --on-timeout fail --,)
|
|
228
|
+
|
|
195
229
|
.PHONY: _ensure_bmk
|
|
196
230
|
_ensure_bmk:
|
|
197
|
-
@$(BMK_INTACT) && uv tool upgrade bmk \
|
|
198
|
-
|| uv tool install --reinstall --force "bmk>=$(BMK_MIN)" \
|
|
231
|
+
@$(BMK_INTACT) && $(BMK_LOCK) uv tool upgrade bmk \
|
|
232
|
+
|| $(BMK_LOCK_REPAIR) uv tool install --reinstall --force "bmk>=$(BMK_MIN)" \
|
|
199
233
|
|| uv tool install --reinstall --force "bmk>=$(BMK_MIN)"
|
|
200
234
|
|
|
201
235
|
# ──────────────────────────────────────────────────────────────
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: keep_github_workflows_active
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.5
|
|
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
|
|
@@ -15,25 +15,26 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
19
|
Classifier: Typing :: Typed
|
|
19
20
|
Requires-Python: >=3.10
|
|
20
|
-
Requires-Dist: lib-cli-exit-tools>=2.
|
|
21
|
-
Requires-Dist: pydantic>=2.
|
|
21
|
+
Requires-Dist: lib-cli-exit-tools>=2.4.1
|
|
22
|
+
Requires-Dist: pydantic>=2.14.1
|
|
22
23
|
Requires-Dist: requests>=2.34.2
|
|
23
|
-
Requires-Dist: rich-click>=1.9.
|
|
24
|
+
Requires-Dist: rich-click>=1.9.9
|
|
24
25
|
Provides-Extra: dev
|
|
25
26
|
Requires-Dist: bandit>=1.9.4; extra == 'dev'
|
|
26
|
-
Requires-Dist: build>=1.
|
|
27
|
-
Requires-Dist: click>=8.
|
|
28
|
-
Requires-Dist: import-linter>=2.
|
|
27
|
+
Requires-Dist: build>=1.6.1; extra == 'dev'
|
|
28
|
+
Requires-Dist: click>=8.5.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: import-linter>=2.15; extra == 'dev'
|
|
29
30
|
Requires-Dist: pip-audit>=2.10.1; extra == 'dev'
|
|
30
|
-
Requires-Dist: pyright[nodejs]>=1.1.
|
|
31
|
+
Requires-Dist: pyright[nodejs]>=1.1.414; extra == 'dev'
|
|
31
32
|
Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
|
|
32
33
|
Requires-Dist: pytest>=9.1.1; extra == 'dev'
|
|
33
|
-
Requires-Dist: rtoml>=0.
|
|
34
|
-
Requires-Dist: ruff>=0.
|
|
34
|
+
Requires-Dist: rtoml>=0.14.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.17.0; extra == 'dev'
|
|
35
36
|
Requires-Dist: textual>=8.2.8; extra == 'dev'
|
|
36
|
-
Requires-Dist: twine>=
|
|
37
|
+
Requires-Dist: twine>=7.0.0; extra == 'dev'
|
|
37
38
|
Description-Content-Type: text/markdown
|
|
38
39
|
|
|
39
40
|
# keep_github_workflows_active
|
|
@@ -148,6 +149,35 @@ your `PATH`.
|
|
|
148
149
|
`macos-latest`, `windows-latest`) on CPython 3.13 in addition to the most
|
|
149
150
|
recent 3.x release Actions makes available.
|
|
150
151
|
|
|
152
|
+
### Why we recommend uv: supply-chain protection
|
|
153
|
+
|
|
154
|
+
This repository commits a `uv.lock`. It pins every package the project needs, transitive
|
|
155
|
+
dependencies included, to an exact version and to the hashes of that version's files. The
|
|
156
|
+
`exclude-newer` setting under `[tool.uv]` in `pyproject.toml` adds a cooldown: uv leaves any
|
|
157
|
+
release younger than that out of the lock. CI installs from the lock, so a hijacked release that
|
|
158
|
+
gets pulled again within the cooldown never reaches our builds, and a file whose hash does not
|
|
159
|
+
match is refused.
|
|
160
|
+
|
|
161
|
+
That protection stays in this repository. The installable package declares only lower bounds
|
|
162
|
+
(`>=`) for its dependencies, so a plain `pip install` takes the newest release of every transitive
|
|
163
|
+
dependency at the moment you run it. If one of them was hijacked an hour earlier, you get the
|
|
164
|
+
hijacked version. `pipx install` and `uv tool install` without options do the same.
|
|
165
|
+
|
|
166
|
+
To install the command line tool with a cooldown of your own (uv then skips any release younger
|
|
167
|
+
than 7 days, transitive ones included), or to run the exact tree our CI tests:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
uv tool install --exclude-newer "7 days" keep_github_workflows_active
|
|
171
|
+
git clone https://github.com/bitranox/keep_github_workflows_active.git && cd keep_github_workflows_active && uv sync --locked && uv run keep_github_workflows_active --help
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
If you depend on keep_github_workflows_active in your own project, give that project the same cooldown (7 days here, as
|
|
175
|
+
an example) and commit the `uv.lock` that `uv add keep_github_workflows_active` writes:
|
|
176
|
+
|
|
177
|
+
```toml
|
|
178
|
+
[tool.uv]
|
|
179
|
+
exclude-newer = "7 days"
|
|
180
|
+
```
|
|
151
181
|
|
|
152
182
|
## Usage
|
|
153
183
|
|
|
@@ -110,6 +110,35 @@ your `PATH`.
|
|
|
110
110
|
`macos-latest`, `windows-latest`) on CPython 3.13 in addition to the most
|
|
111
111
|
recent 3.x release Actions makes available.
|
|
112
112
|
|
|
113
|
+
### Why we recommend uv: supply-chain protection
|
|
114
|
+
|
|
115
|
+
This repository commits a `uv.lock`. It pins every package the project needs, transitive
|
|
116
|
+
dependencies included, to an exact version and to the hashes of that version's files. The
|
|
117
|
+
`exclude-newer` setting under `[tool.uv]` in `pyproject.toml` adds a cooldown: uv leaves any
|
|
118
|
+
release younger than that out of the lock. CI installs from the lock, so a hijacked release that
|
|
119
|
+
gets pulled again within the cooldown never reaches our builds, and a file whose hash does not
|
|
120
|
+
match is refused.
|
|
121
|
+
|
|
122
|
+
That protection stays in this repository. The installable package declares only lower bounds
|
|
123
|
+
(`>=`) for its dependencies, so a plain `pip install` takes the newest release of every transitive
|
|
124
|
+
dependency at the moment you run it. If one of them was hijacked an hour earlier, you get the
|
|
125
|
+
hijacked version. `pipx install` and `uv tool install` without options do the same.
|
|
126
|
+
|
|
127
|
+
To install the command line tool with a cooldown of your own (uv then skips any release younger
|
|
128
|
+
than 7 days, transitive ones included), or to run the exact tree our CI tests:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
uv tool install --exclude-newer "7 days" keep_github_workflows_active
|
|
132
|
+
git clone https://github.com/bitranox/keep_github_workflows_active.git && cd keep_github_workflows_active && uv sync --locked && uv run keep_github_workflows_active --help
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If you depend on keep_github_workflows_active in your own project, give that project the same cooldown (7 days here, as
|
|
136
|
+
an example) and commit the `uv.lock` that `uv add keep_github_workflows_active` writes:
|
|
137
|
+
|
|
138
|
+
```toml
|
|
139
|
+
[tool.uv]
|
|
140
|
+
exclude-newer = "7 days"
|
|
141
|
+
```
|
|
113
142
|
|
|
114
143
|
## Usage
|
|
115
144
|
|
|
@@ -125,20 +125,12 @@ stand-in domain.
|
|
|
125
125
|
or the exit code produced by ``lib_cli_exit_tools``.
|
|
126
126
|
* **Location:** src/keep_github_workflows_active/cli.py
|
|
127
127
|
|
|
128
|
-
### __main__
|
|
128
|
+
### __main__
|
|
129
129
|
|
|
130
|
-
* **Purpose:** Provide ``python -m`` entry point
|
|
131
|
-
|
|
132
|
-
* **
|
|
133
|
-
* **
|
|
134
|
-
|
|
135
|
-
### __main__._open_cli_session / _command_to_run / _command_name
|
|
136
|
-
|
|
137
|
-
* **Purpose:** Describe the session wiring and command selection used by the
|
|
138
|
-
module entry point so tests and documentation can reason about the
|
|
139
|
-
composition.
|
|
140
|
-
* **Output:** Context manager yielding the command runner, the Click command
|
|
141
|
-
itself, and the shell-facing name.
|
|
130
|
+
* **Purpose:** Provide the ``python -m`` entry point; runs ``cli.main`` exactly
|
|
131
|
+
as the console scripts do.
|
|
132
|
+
* **Input:** None (argv comes from ``sys.argv``).
|
|
133
|
+
* **Output:** ``SystemExit`` carrying the exit code returned by ``cli.main``.
|
|
142
134
|
* **Location:** src/keep_github_workflows_active/__main__.py
|
|
143
135
|
|
|
144
136
|
### __init__conf__.print_info
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "keep_github_workflows_active"
|
|
3
|
-
version = "2.3.
|
|
3
|
+
version = "2.3.5"
|
|
4
4
|
description = "Template for python apps with registered cli commands"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
|
-
dependencies = ["rich-click>=1.9.
|
|
7
|
+
dependencies = ["rich-click>=1.9.9", "lib_cli_exit_tools>=2.4.1", "requests>=2.34.2", "pydantic>=2.14.1"]
|
|
8
8
|
license = { text = "MIT" }
|
|
9
9
|
authors = [{ name = "bitranox", email = "bitranox@gmail.com" }]
|
|
10
10
|
keywords = ["logging", "rich", "cli", "terminal", "ansi"]
|
|
@@ -17,6 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Typing :: Typed",
|
|
18
18
|
"Programming Language :: Python :: 3",
|
|
19
19
|
"Programming Language :: Python :: 3.14",
|
|
20
|
+
"Programming Language :: Python :: 3.15",
|
|
20
21
|
]
|
|
21
22
|
|
|
22
23
|
# System packages required for CI runners (read by GitHub Actions workflow template)
|
|
@@ -37,13 +38,11 @@ Issues = "https://github.com/bitranox/keep_github_workflows_active/issues"
|
|
|
37
38
|
dev = [
|
|
38
39
|
"pytest>=9.1.1",
|
|
39
40
|
"pytest-cov>=7.1.0",
|
|
40
|
-
"ruff>=0.
|
|
41
|
-
"pyright[nodejs]>=1.1.
|
|
41
|
+
"ruff>=0.17.0",
|
|
42
|
+
"pyright[nodejs]>=1.1.414",
|
|
42
43
|
"bandit>=1.9.4",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"build>=1.5.0",
|
|
46
|
-
"twine>=6.2.0",
|
|
44
|
+
"build>=1.6.1",
|
|
45
|
+
"twine>=7.0.0",
|
|
47
46
|
# codecov-cli is disabled, not dropped: it requires click<8.3.0, which drags click back to
|
|
48
47
|
# 8.2.1 - the version with CVE-2026-7246 (command injection in click.edit(), fixed in 8.3.3).
|
|
49
48
|
# Nothing else here caps click, so with this line active the audit gate goes red on every
|
|
@@ -52,11 +51,11 @@ dev = [
|
|
|
52
51
|
# Re-enable once codecov-cli relaxes its click<8.3.0 pin.
|
|
53
52
|
# "codecov-cli>=11.2.8",
|
|
54
53
|
# Transitive CVE pins
|
|
55
|
-
"click>=8.
|
|
54
|
+
"click>=8.5.0", # CVE-2026-7246
|
|
56
55
|
"pip-audit>=2.10.1",
|
|
57
56
|
"textual>=8.2.8",
|
|
58
|
-
"import-linter>=2.
|
|
59
|
-
"rtoml>=0.
|
|
57
|
+
"import-linter>=2.15",
|
|
58
|
+
"rtoml>=0.14.0"
|
|
60
59
|
]
|
|
61
60
|
|
|
62
61
|
[project.scripts]
|
|
@@ -64,7 +63,7 @@ keep_github_workflows_active = "keep_github_workflows_active.cli:main"
|
|
|
64
63
|
keep-github-workflows-active = "keep_github_workflows_active.cli:main"
|
|
65
64
|
|
|
66
65
|
[build-system]
|
|
67
|
-
requires = ["hatchling>=1.
|
|
66
|
+
requires = ["hatchling>=1.32.4"]
|
|
68
67
|
build-backend = "hatchling.build"
|
|
69
68
|
|
|
70
69
|
|
|
@@ -216,3 +215,7 @@ layers = [
|
|
|
216
215
|
# CVE-2026-44405: paramiko 4.0.0 rsakey.py allows SHA-1 (local bmk toolchain dep, no fix released yet)
|
|
217
216
|
# CVE-2026-44431/CVE-2026-44432: urllib3 2.6.3 (local bmk toolchain dep, fix in 2.7.0)
|
|
218
217
|
ignore-vulns = ["CVE-2026-3219", "CVE-2026-6357", "PYSEC-2022-42969", "CVE-2026-44405", "CVE-2026-44431", "CVE-2026-44432"]
|
|
218
|
+
|
|
219
|
+
[tool.uv]
|
|
220
|
+
exclude-newer = "1 day"
|
|
221
|
+
exclude-newer-package = {lib-cli-exit-tools = false, rtoml = "2026-10-12T00:17:16Z"}
|
|
@@ -26,7 +26,7 @@ name = "keep_github_workflows_active"
|
|
|
26
26
|
#: Human-readable summary shown in CLI help output.
|
|
27
27
|
title = "Template for python apps with registered cli commands"
|
|
28
28
|
#: Current release version pulled from ``pyproject.toml`` by automation.
|
|
29
|
-
version = "2.3.
|
|
29
|
+
version = "2.3.5"
|
|
30
30
|
#: Repository homepage presented to users.
|
|
31
31
|
homepage = "https://github.com/bitranox/keep_github_workflows_active"
|
|
32
32
|
#: Author attribution surfaced in CLI output.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Provide the ``python -m keep_github_workflows_active`` entry point.
|
|
2
|
+
|
|
3
|
+
Runs :func:`keep_github_workflows_active.cli.main`, the function the console
|
|
4
|
+
scripts run, so exit codes and traceback handling are identical however the
|
|
5
|
+
CLI is started.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from . import cli
|
|
11
|
+
|
|
12
|
+
if __name__ == "__main__":
|
|
13
|
+
raise SystemExit(cli.main())
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""Module entry stories ensuring `python -m` mirrors the CLI."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
import runpy
|
|
7
|
+
import sys
|
|
8
|
+
from typing import TYPE_CHECKING
|
|
9
|
+
|
|
10
|
+
import lib_cli_exit_tools
|
|
11
|
+
import pytest
|
|
12
|
+
|
|
13
|
+
from keep_github_workflows_active import cli as cli_mod
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from collections.abc import Callable
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@pytest.mark.os_agnostic
|
|
20
|
+
@pytest.mark.parametrize(
|
|
21
|
+
"argv",
|
|
22
|
+
[["--bad-flag"], ["no-such-command"], ["info", "--bad-flag"], ["--help"], ["info"]],
|
|
23
|
+
ids=["bad-flag", "unknown-command", "bad-subcommand-flag", "help", "info"],
|
|
24
|
+
)
|
|
25
|
+
def test_module_entry_exits_with_the_code_the_console_script_gives(monkeypatch: pytest.MonkeyPatch, isolated_traceback_config: None, argv: list[str]) -> None:
|
|
26
|
+
script_code = cli_mod.main(argv)
|
|
27
|
+
monkeypatch.setattr(sys, "argv", ["keep_github_workflows_active", *argv])
|
|
28
|
+
|
|
29
|
+
with pytest.raises(SystemExit) as exc:
|
|
30
|
+
runpy.run_module("keep_github_workflows_active.__main__", run_name="__main__")
|
|
31
|
+
|
|
32
|
+
assert exc.value.code == script_code
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@pytest.mark.os_agnostic
|
|
36
|
+
def test_a_usage_error_exits_with_the_click_usage_code_via_module_entry(monkeypatch: pytest.MonkeyPatch, isolated_traceback_config: None) -> None:
|
|
37
|
+
monkeypatch.setattr(sys, "argv", ["keep_github_workflows_active", "--bad-flag"])
|
|
38
|
+
|
|
39
|
+
with pytest.raises(SystemExit) as exc:
|
|
40
|
+
runpy.run_module("keep_github_workflows_active.__main__", run_name="__main__")
|
|
41
|
+
|
|
42
|
+
assert exc.value.code == 2
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@pytest.mark.os_agnostic
|
|
46
|
+
def test_when_traceback_flag_is_used_via_module_entry_the_full_poem_is_printed(
|
|
47
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
48
|
+
capsys: pytest.CaptureFixture[str],
|
|
49
|
+
strip_ansi: Callable[[str], str],
|
|
50
|
+
) -> None:
|
|
51
|
+
monkeypatch.setattr(sys, "argv", ["keep_github_workflows_active", "--traceback", "fail"])
|
|
52
|
+
monkeypatch.setattr(lib_cli_exit_tools.config, "traceback", False, raising=False)
|
|
53
|
+
monkeypatch.setattr(lib_cli_exit_tools.config, "traceback_force_color", False, raising=False)
|
|
54
|
+
|
|
55
|
+
with pytest.raises(SystemExit) as exc:
|
|
56
|
+
runpy.run_module("keep_github_workflows_active.__main__", run_name="__main__")
|
|
57
|
+
|
|
58
|
+
plain_err = strip_ansi(capsys.readouterr().err)
|
|
59
|
+
|
|
60
|
+
assert exc.value.code != 0
|
|
61
|
+
assert "Traceback (most recent call last)" in plain_err
|
|
62
|
+
assert "RuntimeError: I should fail" in plain_err
|
|
63
|
+
assert "[TRUNCATED" not in plain_err
|
|
64
|
+
assert lib_cli_exit_tools.config.traceback is False
|
|
65
|
+
assert lib_cli_exit_tools.config.traceback_force_color is False
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@pytest.mark.os_agnostic
|
|
69
|
+
def test_when_the_module_is_imported_it_runs_nothing() -> None:
|
|
70
|
+
# Left imported, every later runpy of the module warns that it is already loaded.
|
|
71
|
+
previous = sys.modules.pop("keep_github_workflows_active.__main__", None)
|
|
72
|
+
try:
|
|
73
|
+
module = importlib.import_module("keep_github_workflows_active.__main__")
|
|
74
|
+
|
|
75
|
+
assert module.cli is cli_mod
|
|
76
|
+
finally:
|
|
77
|
+
sys.modules.pop("keep_github_workflows_active.__main__", None)
|
|
78
|
+
if previous is not None:
|
|
79
|
+
sys.modules["keep_github_workflows_active.__main__"] = previous
|