Skip to content

chore(deps): fix uv-lock hook#7368

Merged
jmelahman merged 1 commit intomainfrom
jamison/uv-lock
Jan 12, 2026
Merged

chore(deps): fix uv-lock hook#7368
jmelahman merged 1 commit intomainfrom
jamison/uv-lock

Conversation

@jmelahman
Copy link
Copy Markdown
Contributor

@jmelahman jmelahman commented Jan 12, 2026

Description

chore(deps): remove requires-python < 3.13 is not actually obsolete and CI should be failing, but the pre-commit hook which validates it is broken.

How Has This Been Tested?

Confirmed prek run fails on that branch.

Additional Options

  • Override Linear Check

Summary by cubic

Fixes the uv-lock pre-commit hook so it runs in CI and correctly fails when pyproject changes require an updated lock or violate requires-python rules. Removed the files filter in .pre-commit-config.yaml to let uv-lock execute without file matching.

Written for commit 605a1ad. Summary will update on new commits.

@jmelahman jmelahman requested a review from a team as a code owner January 12, 2026 20:43
Copy link
Copy Markdown
Contributor

@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 1 file

@jmelahman jmelahman enabled auto-merge January 12, 2026 20:45
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Jan 12, 2026

Greptile Overview

Greptile Summary

This PR fixes a broken pre-commit hook that was preventing proper validation of the uv.lock file. The uv-lock hook had a files: ^pyproject\.toml$ restriction that meant it would only run when pyproject.toml was modified. This prevented the hook from catching cases where the lock file was out of sync (as mentioned in PR #7367 which should have caused CI to fail but didn't).

By removing the files pattern restriction, the hook will now run more broadly and catch lock file synchronization issues. The fix successfully addresses the validation gap, though the hook may now run on more commits than strictly necessary. A more targeted approach would be to use files: ^(pyproject\.toml|uv\.lock)$ similar to the uv-export hooks below it, which would trigger the validation only when either file changes.

Confidence Score: 4/5

  • Safe to merge - fixes the broken validation hook, though could be more efficient with an explicit file pattern.
  • The change successfully fixes the broken pre-commit hook by removing the overly restrictive file pattern that prevented proper validation. The hook will now catch lock file synchronization issues that were previously missed. The only concern is efficiency - without a file pattern, the hook runs on every commit regardless of which files changed. This is a minor performance issue rather than a correctness bug.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
.pre-commit-config.yaml 4/5 Removed file pattern restriction from uv-lock hook to fix validation issue. Hook should now trigger more broadly, but may be inefficient without explicit file pattern.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Git as Git Commit
    participant PC as Pre-commit
    participant UV as uv-lock hook
    participant Lock as uv.lock
    participant Proj as pyproject.toml
    
    Dev->>Git: git commit (any file changes)
    Git->>PC: trigger pre-commit hooks
    
    alt Before fix (with files: ^pyproject\.toml$)
        PC->>UV: run uv-lock (only if pyproject.toml changed)
        UV->>Proj: check pyproject.toml
        UV->>Lock: validate uv.lock is in sync
        UV-->>PC: validation result
    end
    
    alt After fix (no files restriction)
        PC->>UV: run uv-lock (on any commit)
        UV->>Proj: check pyproject.toml
        UV->>Lock: validate uv.lock is in sync
        UV-->>PC: validation result
    end
    
    PC-->>Git: allow/block commit
    Git-->>Dev: commit success/failure
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@@ -11,7 +11,6 @@ repos:
- id: uv-sync
args: ["--locked", "--all-extras"]
- id: uv-lock
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.

Consider adding files: ^(pyproject\.toml|uv\.lock)$ to make the hook more efficient. Without a file pattern, this hook will run on every commit regardless of which files changed. Adding the pattern (similar to the uv-export hooks below) would trigger validation only when either pyproject.toml or uv.lock changes, which is when validation is actually needed.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .pre-commit-config.yaml
Line: 13:13

Comment:
Consider adding `files: ^(pyproject\.toml|uv\.lock)$` to make the hook more efficient. Without a file pattern, this hook will run on every commit regardless of which files changed. Adding the pattern (similar to the uv-export hooks below) would trigger validation only when either `pyproject.toml` or `uv.lock` changes, which is when validation is actually needed.

How can I resolve this? If you propose a fix, please make it concise.

@jmelahman jmelahman disabled auto-merge January 12, 2026 20:52
@jmelahman jmelahman merged commit 638ea5f into main Jan 12, 2026
73 of 74 checks passed
@jmelahman jmelahman deleted the jamison/uv-lock branch January 12, 2026 20:52
jessicasingh7 pushed a commit that referenced this pull request Jan 12, 2026
jessicasingh7 pushed a commit that referenced this pull request Jan 21, 2026
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