Skip to content

uv exclude-newer for cooldown: Stop writing timestamp in uv.lock to avoid git conflicts #18708

@simonpercivall

Description

@simonpercivall

Summary

(I've tried searching for a similar issue, and read the original issue for dependency cooldown. Didn't see a discussion of this.)

Setting a cooldown in pyproject.toml, like 1 week for instance, also writes a timestamp into uv.lock. When upgrading a package, the timestamp gets updated.

The problem comes with larger teams working on the same code base, in multiple branches. If a package is updated in one branch, and a different package is upgraded in a separate branch, you have a merge conflict, since they both write (different) timestamps.

If uv only wrote the span in the lock file, that would avoid merge conflicts.

Example:

git switch -c exclude-newer-base
# add exclude-newer = "1 week" to pyproject.toml
uv lock
git add -u && git commit -m "add exclude-newer cooldown"

git switch -c exclude-newer-1
uv lock -P ruff && git add -u && git commit -m "upgrade ruff"

git switch exclude-newer-base
git switch -c exclude-newer-2
uv lock -P ruff && git add -u && git commit -m "upgrade ruff"

git switch exclude-newer-base
git merge exclude-newer-1    # fast-forward
git merge exclude-newer-2    # merge conflict in uv.lock

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions