Skip to content

No-op timestamp for exclude-newer-package with spans #19089

@kdeldycke

Description

@kdeldycke

Summary

I just discovered #19022 while subscribed to #18708, and it looks like a great improvement to eliminate timestamp noise.

In the same spirit of this workaround, I just wonder if we could use the sane no-op flag for [options.exclude-newer-package].

See how a package configured with a relative span (like 0 day), the lockfile records the a full timestamp:

[options]
exclude-newer = "0001-01-01T00:00:00Z" # no-op placeholder (fixed by #19022)
exclude-newer-span = "P1W"

[options.exclude-newer-package]
mypackage = { timestamp = "2026-04-21T14:32:07.819274Z", span = "PT0S" }  # still changes every run

So currently every uv lock invokation update the timestamp.

Example

Configuration in pyproject.toml:

[tool.uv]
exclude-newer = "1 week"
exclude-newer-package = { mypackage = "0 day" }

Running uv lock twice in quick succession produces a diff:

 [options.exclude-newer-package]
-mypackage = { timestamp = "2026-04-21T14:32:07.819274Z", span = "PT0S" }
+mypackage = { timestamp = "2026-04-21T14:32:09.123456Z", span = "PT0S" }

My proposal is to reuse the same no-op placeholder when a span is present:

[options.exclude-newer-package]
mypackage = { timestamp = "0001-01-01T00:00:00Z", span = "PT0S" }

This would make the lockfile fully stable across runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionalitygreat writeupA wonderful example of a quality contribution 💜

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions