Skip to content

chore: enforce uv lockfile consistency in CI and pre-commit#1398

Open
mesejo wants to merge 2 commits intoapache:mainfrom
mesejo:chore/update-uv-lock
Open

chore: enforce uv lockfile consistency in CI and pre-commit#1398
mesejo wants to merge 2 commits intoapache:mainfrom
mesejo:chore/update-uv-lock

Conversation

@mesejo
Copy link
Copy Markdown
Contributor

@mesejo mesejo commented Feb 26, 2026

Which issue does this PR close?

N/A

Rationale for this change

The uv.lock is out of sync

Add UV_LOCKED=True to uv sync in CI to fail if uv.lock is out of sync,
and add the uv-lock pre-commit hook to automatically keep uv.lock
up to date when pyproject.toml changes.

Are there any user-facing changes?

No

@mesejo mesejo marked this pull request as draft February 26, 2026 10:45
@mesejo mesejo force-pushed the chore/update-uv-lock branch from 33bbd9b to 3706f1c Compare February 26, 2026 10:47
@mesejo mesejo changed the title Chore/update uv lock chore: update uv lock Feb 26, 2026
@mesejo mesejo force-pushed the chore/update-uv-lock branch from 3706f1c to 05c492c Compare March 3, 2026 07:43
@mesejo mesejo marked this pull request as ready for review March 3, 2026 07:50
@mesejo mesejo changed the title chore: update uv lock chore: enforce uv lockfile consistency in CI and pre-commit Mar 3, 2026
Copy link
Copy Markdown
Contributor

@kosiew kosiew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mesejo
thanks for working on this


- name: Install dependencies
run: uv sync --dev --no-install-package datafusion
run: uv sync --locked --dev --no-install-package datafusion
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the direction here, and the pre-commit hook looks good.

But given the PR title says this enforces lockfile consistency in CI, I think the CI side is incomplete until all uv sync calls use --locked (or the title/description is narrowed).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's strictly necessary. The check has been added to lint-python job that is a dependency of each of the other jobs where a sync occurs. So it will fail early in the pipeline if the uv lock is not up to date and those other jobs will never run.

If you think it's necessary for completeness sake, and in case we were to ever remove the lint-python job that's a different story. But personally I believe @mesejo 's solution will correctly enforce the requirement he's set out to.

Copy link
Copy Markdown
Contributor Author

@mesejo mesejo Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to set UV_LOCKED=True, this will ensure current (and future calls) of uv sync use --locked

  Add --locked flag to uv sync in CI to fail if uv.lock is out of sync,
  and add the uv-lock pre-commit hook to automatically keep uv.lock
  up to date when pyproject.toml changes.
@timsaucer timsaucer force-pushed the chore/update-uv-lock branch from 05c492c to cd2825a Compare March 27, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants