Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
---
default_stages: [pre-commit, pre-push]
default_install_hook_types: [pre-commit, commit-msg]
minimum_prek_version: '0.3.4'
minimum_prek_version: '0.4.8'
default_language_version:
python: python3
node: 22.19.0
golang: 1.25.0
default_env:
# Unless overridden, no hook defined in this file should change the resolutions in uv.lock; they use
# the committed ones. Hooks in nested configs do not inherit this and must pass --frozen to uv themselves.
UV_FROZEN: "1"
Comment thread
ashb marked this conversation as resolved.
exclude: ^.*/.*_vendor/
repos:
- repo: meta
Expand Down Expand Up @@ -565,6 +569,7 @@ repos:
name: Upgrade important versions (manual)
entry: ./scripts/ci/prek/upgrade_important_versions.py
stages: ['manual']
env: {UV_FROZEN: "0"}
language: python
files: >
(?x)
Expand All @@ -577,6 +582,7 @@ repos:
name: Upgrade curated dependency floors (manual)
entry: ./scripts/ci/prek/upgrade_dependency_floors.py
stages: ['manual']
env: {UV_FROZEN: "0"}
language: python
files: >
(?x)
Expand Down Expand Up @@ -1585,13 +1591,15 @@ repos:
files: ^dev/breeze/src/airflow_breeze/global_constants\.py$
require_serial: true
# This is a fast regular hook that runs when any pyproject.toml changes.
# It runs locally with `--frozen` so the lock is only verified against pyproject.toml,
# never silently rewritten during a commit. If a pyproject.toml change makes the lock
# stale, the hook fails and the contributor must run `uv lock` explicitly and commit
# the refreshed uv.lock — which keeps lock updates intentional and reviewable.
# It runs `uv lock --check`, so the lock is verified against pyproject.toml but never
# rewritten during a commit. If a pyproject.toml change makes the lock stale, the hook
# fails and the contributor must run `uv lock` explicitly and commit the refreshed
# uv.lock — which keeps lock updates intentional and reviewable. UV_FROZEN is disabled
# because under it `--check` only validates the lock, it does not detect staleness.
- id: update-uv-lock
name: Update uv.lock
entry: uv lock --frozen
entry: uv lock --check
env: {UV_FROZEN: "0"}
language: system
files: >
(?x)
Expand Down
8 changes: 6 additions & 2 deletions contributing-docs/07_local_virtualenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,12 @@ or when running tests), you can pass the ``--frozen`` flag:

uv sync --frozen

This will fail if the lock file is out of date with respect to ``pyproject.toml``, rather than
silently updating it. This is useful when you want to guarantee fully reproducible environments.
This never resolves or writes to the lock file, even when it is out of date with respect to
``pyproject.toml``. Use ``--locked`` (or ``uv lock --check``) to fail on a stale lock file instead.

A change to a ``pyproject.toml`` (including a workspace member's version) must be committed together
with the refreshed ``uv.lock``: run ``uv lock``. The ``update-uv-lock`` prek hook, which also runs in CI,
fails otherwise. All other prek hooks run ``uv`` frozen and never change ``uv.lock``.
Comment thread
ashb marked this conversation as resolved.

Cooldown via ``exclude-newer``
..............................
Expand Down
1 change: 0 additions & 1 deletion dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,6 @@ def docs_list_as_string(self) -> str | None:
def skip_prek_hooks(self) -> str:
prek_hooks_to_skip = set()
prek_hooks_to_skip.add("identity")
prek_hooks_to_skip.add("update-uv-lock")
if self._default_branch != "main":
# Skip those tests on all "release" branches
prek_hooks_to_skip.update(
Expand Down
Loading
Loading