From db30449b09601c6347cdaab4418701e3293a37f0 Mon Sep 17 00:00:00 2001 From: Holden Date: Thu, 18 Jun 2026 20:29:43 +0000 Subject: [PATCH 1/3] chore: replace lockfile auto-update with uv lock --check --- .github/workflows/test.yml | 3 ++ .github/workflows/update-lockfile.yml | 63 --------------------------- 2 files changed, 3 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/update-lockfile.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4df253..f757851 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,9 @@ jobs: - name: Set up Python run: uv python install 3.13 + - name: Check lockfile is up to date + run: uv lock --check + - name: Install dependencies run: uv sync --extra cpu diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml deleted file mode 100644 index 46f983c..0000000 --- a/.github/workflows/update-lockfile.yml +++ /dev/null @@ -1,63 +0,0 @@ -# .github/workflows/update-lockfile.yml -name: Update lockfile - -on: - push: - branches: - - '**' - - '!main' - paths: - - 'pyproject.toml' - workflow_dispatch: - -jobs: - update-lockfile: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - - - name: Install uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 - - - name: Set up Python - run: uv python install 3.13 - - - name: Regenerate lockfile - run: uv lock - - - name: Check for changes - id: diff - run: | - if git diff --quiet uv.lock; then - echo "changed=false" >> "$GITHUB_OUTPUT" - else - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - - name: Commit and push updated lockfile - if: steps.diff.outputs.changed == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add uv.lock - git commit -m "chore: update lockfile" - - if [ "$GITHUB_REF_NAME" = "dev" ]; then - # dev is protected — open a PR rather than pushing directly - BRANCH="chore/lockfile-$(git rev-parse --short HEAD)" - git checkout -b "$BRANCH" - git push origin "$BRANCH" - gh pr create \ - --base dev \ - --head "$BRANCH" \ - --title "chore: update lockfile" \ - --body "Automated lockfile update triggered by a \`pyproject.toml\` change on \`dev\`." - else - git push - fi From 0ac02c31081ff0ad717b76a773b7cad55a922b62 Mon Sep 17 00:00:00 2001 From: Holden Date: Thu, 18 Jun 2026 20:31:36 +0000 Subject: [PATCH 2/3] chore: update lockfile for v0.6.6 --- uv.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uv.lock b/uv.lock index 0c3f5ba..9e9377f 100644 --- a/uv.lock +++ b/uv.lock @@ -905,7 +905,7 @@ wheels = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.6" source = { editable = "." } dependencies = [ { name = "croniter" }, From e281ac01e1e19ea28ebda0df47a9ebf7cf98342e Mon Sep 17 00:00:00 2001 From: Holden Date: Thu, 18 Jun 2026 20:33:58 +0000 Subject: [PATCH 3/3] chore: add pre-commit hook to auto-update lockfile on pyproject.toml changes --- .githooks/pre-commit | 7 +++++++ CONTRIBUTING.md | 3 +++ 2 files changed, 10 insertions(+) create mode 100755 .githooks/pre-commit diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..5d23f5d --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euo pipefail + +if git diff --cached --name-only | grep -q "^pyproject\.toml$"; then + uv lock + git add uv.lock +fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 943f2c6..5b00940 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,11 @@ git clone https://github.com/sudolulo/winnow.git cd winnow git checkout dev uv sync +git config core.hooksPath .githooks ``` +The last line activates the project's git hooks. The pre-commit hook automatically runs `uv lock` and stages the result whenever `pyproject.toml` is part of a commit, keeping the lockfile in sync without any extra steps. + ## Running Tests and Lint ```bash