ci: single-source the Python version via pyproject.toml + add uv-lock pre-commit hook - #15111
Merged
cclauss merged 1 commit intoAug 28, 2026
Conversation
…-commit hook - Add astral-sh/uv-pre-commit (uv-lock) so uv.lock stays in sync with pyproject.toml automatically instead of relying on manual relocks. - Replace 'python-version: 3.14' with 'python-version-file: pyproject.toml' in every workflow that uses actions/setup-python (build, project_euler, sphinx, directory_writer), making requires-python the single source of truth for the interpreter version.
Closing this pull request as invalid@priya-sundaram-dev, this pull request is being closed as none of the checkboxes have been marked. It is important that you go through the checklist and mark the ones relevant to this pull request. Please read the Contributing guidelines. If you're facing any problem on how to mark a checkbox, please read the following instructions:
NOTE: Only |
This was referenced Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #15081 and #15104 (comment), this does the two follow-ups:
1. Add
astral-sh/uv-pre-commit(uv-lockhook)Keeps
uv.lockautomatically in sync withpyproject.toml. Right now the lockfile only gets refreshed by hand, so it can silently drift (e.g. after a dependency bump). With this hook, pre-commit.ci relocks and auto-commits wheneverpyproject.tomlchanges, souv syncin CI always sees a consistent lock.2.
python-version-file: pyproject.tomlon everyactions/setup-pythonReplaces the hard-coded
python-version: 3.14inbuild.yml,project_euler.yml(both jobs),sphinx.yml, anddirectory_writer.ymlwithpython-version-file: pyproject.toml.actions/setup-python@v7readsproject.requires-python(>=3.14), so the interpreter version now has a single source of truth — bumpingrequires-pythonmoves all of CI at once and there's no chance of a workflow being left behind.No behavioural change today (still resolves to 3.14); this is a maintainability cleanup. Happy to adjust the pin style if you'd prefer a
.python-versionfile instead.