Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Jan 22, 2026

Summary

  • Add --locked flag to uv sync in setup-nix action
  • Add --locked flag to uv sync in flake.nix shellHook

This ensures CI and local development fail early if uv.lock is out of sync with pyproject.toml, catching lockfile drift before it causes issues.

Test plan

  • CI passes with current uv.lock
  • CI fails if uv.lock is modified without updating pyproject.toml

Summary by cubic

Enforce uv.lock consistency by running uv sync with --locked in CI and the Nix dev shell. Builds and local setup now fail early if uv.lock and pyproject.toml drift.

  • Migration
    • If sync fails, run uv lock and commit the updated uv.lock.
    • Keep uv.lock updated whenever you change pyproject.toml.

Written for commit 1b4b4ad. Summary will update on new commits.

Add --locked flag to uv sync commands to fail if uv.lock is out of sync
with pyproject.toml. This ensures lockfile consistency across CI and
local development.

- Add --locked to setup-nix action
- Add --locked to flake.nix shellHook
Copilot AI review requested due to automatic review settings January 22, 2026 10:58
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@ryoppippi ryoppippi merged commit 05a94b3 into main Jan 22, 2026
16 checks passed
@ryoppippi ryoppippi deleted the ci/uv-sync-locked branch January 22, 2026 11:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the --locked flag to uv sync commands in CI and local development environments to ensure lockfile consistency with pyproject.toml, preventing lockfile drift issues.

Changes:

  • Add --locked flag to uv sync in CI setup-nix action
  • Add --locked flag to uv sync in flake.nix shellHook

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/actions/setup-nix/action.yaml Adds --locked flag to uv sync in CI to enforce lockfile consistency
flake.nix Adds --locked flag to uv sync in dev shell initialization hook

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if [ ! -d .venv ] || [ uv.lock -nt .venv ]; then
echo "📦 Installing Python dependencies..."
uv sync --all-extras
uv sync --all-extras --locked
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The --locked flag in the shellHook may prevent developers from entering the development shell if uv.lock is out of sync with pyproject.toml. This creates a problematic scenario where developers cannot enter the shell to fix the lockfile issue.

Consider removing --locked from the shellHook while keeping it in CI (setup-nix action). The shellHook is meant to facilitate local development setup, not enforce strict validation. CI will catch lockfile drift issues, while local developers can still sync their dependencies even when the lockfile needs updating.

Suggested change
uv sync --all-extras --locked
uv sync --all-extras

Copilot uses AI. Check for mistakes.
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.

2 participants