Add support for relative durations in exclude-newer (#16814)

Adds support for "friendly" durations like, 1 week, 7 days, 24 hours
using Jiff's parser. During resolution, we calculate this relative to
the current time and resolve it into a concrete timestamp for the
lockfile. If the span has not changed, e.g., to another relative value,
then locking again will not change the lockfile. The locked timestamp
will only be updated when the lockfile is invalidated, e.g., with
`--upgrade`. This prevents the lockfile from repeatedly churning when a
relative value is used.
This commit is contained in:
Zanie Blue
2025-12-09 13:52:14 -06:00
committed by GitHub
parent 7b6b02a7d1
commit d0a6f5d13f
31 changed files with 1937 additions and 178 deletions
+1 -1
View File
@@ -296,7 +296,7 @@ of inline script metadata to limit uv to only considering distributions released
date. This is useful for improving the reproducibility of your script when run at a later point in
time.
The date must be specified as an [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) timestamp
The date should be specified as an [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) timestamp
(e.g., `2006-12-02T02:07:43Z`).
```python title="example.py"