Omit timestamp from lock file when exclude-newer uses a relative span - #3
Merged
Merged
Conversation
When `exclude-newer` is configured with a relative duration (e.g., "3 weeks"), only write the span (e.g., `exclude-newer-span = "P3W"`) to uv.lock, omitting the computed absolute timestamp. This avoids merge conflicts in team environments where different developers lock at different times. Fixes astral-sh#18708 https://claude.ai/code/session_01US894hr1Khms1N1UUUhrx4
Validates that when a lock file only contains `exclude-newer-span` (no absolute timestamp), adding a new dependency still correctly respects the exclude-newer cutoff. The test verifies: 1. Initial lock with span-only produces correct version constraints 2. Adding a dependency re-resolves with the span-computed cutoff 3. Re-locking at a later time with --upgrade picks up newer versions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
krishmas
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-pick of zaniebot/uv@81ac664 (upstream fix for astral-sh/uv#18708), adapted to our fork.
Problem: When
exclude-neweris configured with a relative span (e.g."3 weeks"), everyuv lockrun writes a different absolute timestamp touv.lock. This causes merge conflicts on every PR that touches the lockfile.Changes
crates/uv-distribution-types/src/exclude_newer.rs— AddExcludeNewerValue::from_span()to recompute timestamp from span at read timecrates/uv-resolver/src/lock/mod.rs— Serialize only the span (not timestamp) for span-based exclude-newer; deserialize span-only entries viafrom_span()crates/uv/tests/it/lock_exclude_newer_relative.rs— Update snapshot expectations to reflect timestamp omissionTest plan
cargo checkpasseslock_exclude_newer_relativetests pass🤖 Generated with Claude Code