Skip to content

Commit f6e8c10

Browse files
committed
ci: install uv.lock as committed instead of re-resolving
CI ran `uv sync --all-extras --dev` without `--locked`, so a stale or inconsistent uv.lock never failed and the release build could test versions other than the pinned ones. Both workflows now sync with `--locked` and set `UV_LOCKED=1` so later `uv run` steps do not re-lock. The committed lock records a 7-day `exclude-newer` span that only existed in a contributor's global uv config, so `--locked` would fail in CI. Declaring the cooldown in `[tool.uv]` makes the lock reproducible from the project alone. Fixes #677 Signed-off-by: Fernando Macedo <fgmacedo@gmail.com>
1 parent 73bf57c commit f6e8c10

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎.github/workflows/python-package.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ permissions:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18+
env:
19+
UV_LOCKED: 1
1820
strategy:
1921
fail-fast: false
2022
matrix:
@@ -34,7 +36,7 @@ jobs:
3436
enable-cache: true
3537
cache-suffix: "python${{ matrix.python-version }}"
3638
- name: Install the project
37-
run: uv sync --all-extras --dev
39+
run: uv sync --locked --all-extras --dev
3840
#----------------------------------------------
3941
# run ruff
4042
#----------------------------------------------

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
release-build:
88
name: Build release artifacts
99
runs-on: ubuntu-latest
10+
env:
11+
UV_LOCKED: 1
1012

1113
permissions:
1214
id-token: write
@@ -27,7 +29,7 @@ jobs:
2729
enable-cache: true
2830

2931
- name: Install the project
30-
run: uv sync --all-extras --dev
32+
run: uv sync --locked --all-extras --dev
3133

3234
- name: Test
3335
run: |

‎docs/contributing.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ Ready to contribute? Here's how to set up `python-statemachine` for local develo
8787

8888
1. Install dependencies.
8989
1. [graphviz](https://graphviz.org/download/#linux)
90-
1. [uv](https://docs.astral.sh/uv/getting-started/installation/)
90+
1. [uv](https://docs.astral.sh/uv/getting-started/installation/) 0.9.17 or newer
91+
(older releases ignore the `[tool.uv]` settings in `pyproject.toml` and rewrite `uv.lock`).
92+
The project resolves with a 7-day `exclude-newer` cooldown; to take a release younger
93+
than that, use uv's `exclude-newer-package` setting.
9194

9295
1. Fork the `python-statemachine` repository on GitHub.
9396

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ dev = [
6969
requires = ["hatchling"]
7070
build-backend = "hatchling.build"
7171

72+
[tool.uv]
73+
exclude-newer = "7 days"
74+
7275
[tool.hatch.build.targets.wheel]
7376
packages = ["statemachine/"]
7477

0 commit comments

Comments
 (0)