Repository navigation
chore(hooks): install the latest stable Python from .python-version with mise - #247
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🟡 Changes recommended
scripts/py.sh discards the patch suffix before validation, allowing malformed Python version values to pass and hooks to proceed instead of reporting a configuration error.
1 open issue
What changed in this PR
Centralizes the hooks’ minimum Python version in .python-version, aligning interpreter selection, Windows CI, and manual Renovate updates. Also isolates external-skill test repositories from Git environment variables inherited by commit hooks.
Changes:
- Makes the launcher and Windows CI read one shared Python minimum.
- Adds parsing and drift checks, manual Renovate handling, and contributor documentation.
- Routes the external-skills hook through the launcher and adds Git-environment isolation coverage.
| File | Description |
|---|---|
tests/test_py_launcher.py |
Adds version-file parsing, error handling, and drift checks. |
tests/test_apm_external_skills.py |
Isolates fixture repositories from inherited Git variables. |
scripts/py.sh |
Reads the minimum version from .python-version. |
renovate.json5 |
Keeps Python minimum updates separate and manually merged. |
CONTRIBUTING.md |
Documents the shared minimum and external-skills hook. |
.python-version |
Defines the Python minimum as 3.12. |
.lefthook.toml |
Routes the external-skills hook through the Python launcher. |
.github/workflows/windows-hooks.yml |
Uses the shared minimum and derives launcher configuration. |
.github/workflows/markdown-validation.yml |
Triggers validation when the minimum or Windows workflow changes. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
The new pre-commit tests require unprovisioned jq, causing feature-branch push checks to fail and block commits on systems without it even after the documented setup.
1 open issue
1 resolved since last review
Review effort: Balanced
d447ec3 to
86b8390
Compare
86b8390 to
f3670a0
Compare
f3670a0 to
73ef87b
Compare
73ef87b to
749893c
Compare
…ith mise Make .python-version the single source of the Python the hooks and CI use: the latest stable minor that has been out for 90 days (3.14; 3.15 is only 38 days old). mise installs it from the file (idiomatic version file) for contributors and Windows CI. scripts/py.sh parses its major.minor, prefers mise's Python, rejects malformed values and points to `mise install`. The Ubuntu test job sets it up via python-version-file. test_py_launcher.py fails if py.sh, mise or CI stop reading the file. Renovate looks the version up on endoflife.date, which dates each minor by its x.y.0 release (the Docker tag the pyenv manager uses is re-pushed with every patch), and auto-merges a newer minor 90 days after release in its own PR. Closes #246 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
749893c to
3ef974d
Compare

Summary
.python-versionis the single source for the Python the git hooks and CI use. It holds the latest stable Python minor that has been out for 90 days, mise installs it for every contributor, and Renovate moves it forward automatically. It is currently 3.14: 3.15 was released on 2026-10-09 and is only 38 days old..python-version→3.14(major.minor). mise installs the latest patch of that minor, so patch releases need no PR..mise.toml:[settings] idiomatic_version_file_enable_tools = ["python"], somise installinstalls Python from.python-version. It is a mise idiomatic version file, with no second pin in[tools]. On Windows mise downloads a prebuilt CPython: it installedcpython-3.14.10 … aarch64-pc-windows-msvchere. The Dev Container'smise installpicks it up too.scripts/py.shtries mise's Python first (mise -C <repo> which python, which works withoutmise activate). Otherwise it uses the first ofpython3,py -3andpythonthat is at least that version, skipping the Microsoft Store stub. When nothing fits, the error says to runmise install. It still parses.python-versionwith shell builtins and rejects malformed values.install_args: lefthook python), just as a contributor would, andsetup-pythonand thePY_PYTHON3workaround are gone. Markdown Validation's test job now runs on the same Python throughsetup-python'spython-version-file, instead of ubuntu-latest'spython3.minimumReleaseAge: "90 days"in its own PR (groupName: null), outside the weekly non-major group. The shared autoMerge preset merges it once CI passes, and a Python 4 major would stay manual like every other major. The pyenv manager normally looks Python up as thepythonDocker image, but tags like3.14are re-pushed with every patch and image rebuild, so their timestamp never ages 90 days.overrideDatasource: endoflife-dateuses endoflife.date instead, which dates each minor by its x.y.0 release (releaseDate; Renovate's datasource reportsreleaseTimestampSupport).extractVersionturns itslatestvalue (3.14.10) into the minor (3.14), so docker versioning compares like with like.tests/test_py_launcher.py: uses a fakemiseto test that mise's Python is preferred and that the launcher falls back when mise's is missing or too old. Single-source checks fail if:.python-versionisn't major.minor;py.shhard-codes a version;.mise.tomlstops reading the file or pins Python in[tools];actions/setup-pythonstep uses something other thanpython-version-file: .python-version.mise installafter a bump.Stack
Stacked on #256 (lint workflow v3.7.1 +
pipx:yamllint: the old shared lint jobs installpipx:tools without the configured Python, so they fail here) and #252 (hook-fixture isolation, #251), which was split out of this PR because it's urgent:main's hook fixtures wrotecore.bare = trueto the main checkout's config. Order: #252 ← #256 ← this PR.Validation (native Windows ARM64, no WSL)
Each check ran in a fresh testing context, separate from implementation. The hooks used the user's mise Python 3.14.8. The fresh-contributor flow used a throwaway
MISE_DATA_DIRand was deleted afterwards. Nothing was installed system-wide.py.shpicks mise's Python (…\mise\installs\python\3.14.8\python.exe)mise: Python 3.14 not installed+ "Runmise install"; aftermise install python(3.14.10)py.shpicks ittest_py_launcher.pytest_hook_git_env.py(from #252)pythonpinned in[tools];install_argswithoutpython; literalpython-version:lefthook run pre-commit --all-files(10 hooks, incl.hook-git-env)validate-prompts.shartipackedfindings on untouchedmarkdown-validation.ymlcheckouts)renovate-config-validatorcan't run locally (npm remote fetching is blocked). The rule only uses documentedpackageRulesoptions:overrideDatasource,overridePackageName,extractVersion,minimumReleaseAgeandgroupName.All commits are signed (1Password SSH) and passed every pre-commit hook.
Closes #246