Skip to content

Commit fa36cb9

Browse files
ci: single-source Python version via pyproject.toml + add uv-lock pre-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.
1 parent 74f8c78 commit fa36cb9

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
cache-dependency-glob: uv.lock
1818
- uses: actions/setup-python@v7
1919
with:
20-
python-version: 3.14
20+
python-version-file: pyproject.toml
2121
allow-prereleases: true
2222
- run: uv sync --group=test
2323
- name: Run tests

.github/workflows/directory_writer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fetch-depth: 0
1212
- uses: actions/setup-python@v7
1313
with:
14-
python-version: 3.14
14+
python-version-file: pyproject.toml
1515
allow-prereleases: true
1616
- name: Write DIRECTORY.md
1717
run: |

.github/workflows/project_euler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: astral-sh/setup-uv@v7
2626
- uses: actions/setup-python@v7
2727
with:
28-
python-version: 3.14
28+
python-version-file: pyproject.toml
2929
allow-prereleases: true
3030
- run: uv sync --group=euler-validate --group=test
3131
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
@@ -43,7 +43,7 @@ jobs:
4343
- uses: astral-sh/setup-uv@v7
4444
- uses: actions/setup-python@v7
4545
with:
46-
python-version: 3.14
46+
python-version-file: pyproject.toml
4747
allow-prereleases: true
4848
- run: uv sync --group=euler-validate --group=test
4949
- run: uv run pytest scripts/validate_solutions.py

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: astral-sh/setup-uv@v7
3737
- uses: actions/setup-python@v7
3838
with:
39-
python-version: 3.14
39+
python-version-file: pyproject.toml
4040
allow-prereleases: true
4141
- run: uv sync --group=docs
4242
- uses: actions/configure-pages@v6

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ repos:
1818
hooks:
1919
- id: auto-walrus
2020

21+
- repo: https://github.com/astral-sh/uv-pre-commit
22+
rev: 0.12.7
23+
hooks:
24+
- id: uv-lock
25+
2126
- repo: https://github.com/astral-sh/ruff-pre-commit
2227
rev: v0.16.1
2328
hooks:

0 commit comments

Comments
 (0)