Skip to content

Hooks: use uv lock instead of sync#63796

Merged
potiuk merged 1 commit intoapache:mainfrom
Dev-iL:2603/uv_lock
Mar 17, 2026
Merged

Hooks: use uv lock instead of sync#63796
potiuk merged 1 commit intoapache:mainfrom
Dev-iL:2603/uv_lock

Conversation

@Dev-iL
Copy link
Collaborator

@Dev-iL Dev-iL commented Mar 17, 2026

Summary

  • Change the update-uv-lock pre-commit hook from uv sync to uv lock

Motivation

The update-uv-lock hook's purpose is to ensure uv.lock stays up-to-date when
dependency files change — it does not need to actually install (sync) packages into
the local environment.

uv sync resolves dependencies and builds/installs them, which is problematic
in several scenarios:

  1. OOM on resource-constrained machines. Building packages that are unrelated to
    the contributor's current work can exhaust memory on older or smaller laptops,
    forcing them to skip the hook entirely (--no-verify).
  2. Python-version mismatch. uv sync builds against the local Python version,
    which may differ from what CI uses. A local pass/fail therefore does not predict
    CI behavior, making the build step pure overhead.
  3. Unnecessary cost for a lockfile check. This is analogous to why mypy was
    removed as a hook — the compilation/build price should not be paid at commit
    time when the hook's only goal is keeping the lockfile consistent.

uv lock performs the same dependency resolution and lockfile update but skips
building and installing
, so it is both faster and less resource-intensive while
still catching lockfile drift.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 4.6 following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Mar 17, 2026
@Dev-iL Dev-iL requested a review from potiuk March 17, 2026 08:50
@potiuk potiuk merged commit 210158e into apache:main Mar 17, 2026
74 checks passed
@github-actions
Copy link

Backport failed to create: v3-1-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-1-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 210158e v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

@Dev-iL Dev-iL deleted the 2603/uv_lock branch March 17, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants