Skip to content

Comments

Add support for relative durations in exclude-newer#16814

Merged
zanieb merged 7 commits intomainfrom
zb/exclude-newer-delay
Dec 9, 2025
Merged

Add support for relative durations in exclude-newer#16814
zanieb merged 7 commits intomainfrom
zb/exclude-newer-delay

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Nov 21, 2025

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.

@zanieb zanieb temporarily deployed to uv-test-registries November 21, 2025 22:01 — with GitHub Actions Inactive
@namurphy
Copy link
Contributor

Thank you for doing this! I'm going to start using this feature immediately after 48 hours after it's released! 😹

I'm wondering if it would be helpful to add the term "cooldown" in the documentation for --exclude-newer since it's been gaining traction, and might be what a lot of people would do web searches for. 🤔

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

This seems quite reasonable to me.

@zanieb zanieb force-pushed the zb/exclude-newer-delay branch from 8e15e85 to d626b02 Compare December 8, 2025 15:20
@zanieb zanieb force-pushed the zb/exclude-newer-delay branch from 6774316 to c12e4a5 Compare December 9, 2025 18:37
@zanieb zanieb temporarily deployed to uv-test-registries December 9, 2025 18:39 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/exclude-newer-delay branch from c12e4a5 to c85761d Compare December 9, 2025 18:57

Package-specific values will take precedence over global values.

## Dependency cooldowns
Copy link
Member Author

Choose a reason for hiding this comment

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

@woodruffw want to review this copy?

@zanieb zanieb marked this pull request as ready for review December 9, 2025 18:58
@zanieb zanieb temporarily deployed to uv-test-registries December 9, 2025 18:59 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/exclude-newer-delay branch from c85761d to 917caca Compare December 9, 2025 19:03
@zanieb zanieb temporarily deployed to uv-test-registries December 9, 2025 19:05 — with GitHub Actions Inactive
@zanieb zanieb added the enhancement New feature or improvement to existing functionality label Dec 9, 2025
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

LGTM with some nits. :-) Nice work on the error messages!!!

format!(
"`{input}` could not be parsed as a valid exclude-newer value (expected a date like `2024-01-01`, a timestamp like `2024-01-01T00:00:00Z`, or a duration like `3 days` or `P3D`)"
)
}
Copy link
Member

Choose a reason for hiding this comment

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

Nice

@zanieb zanieb force-pushed the zb/exclude-newer-delay branch from 917caca to 76ee92b Compare December 9, 2025 19:38
@zanieb zanieb enabled auto-merge (squash) December 9, 2025 19:40
@zanieb zanieb temporarily deployed to uv-test-registries December 9, 2025 19:40 — with GitHub Actions Inactive
@zanieb zanieb merged commit d0a6f5d into main Dec 9, 2025
101 checks passed
@zanieb zanieb deleted the zb/exclude-newer-delay branch December 9, 2025 19:52
zanieb added a commit that referenced this pull request Dec 10, 2025
…n changes (#17055)

Follows #16814 updating the test cases with Claude so that the
timestamps and durations are on the boundary of package versions so we
see actual version changes in the lockfile.
zanieb pushed a commit that referenced this pull request Dec 11, 2025
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Following the changes in #16814,
documentation for
[`--exclude-newer`](https://docs.astral.sh/uv/reference/cli/#uv-sync--exclude-newer)
and
[`--exclude-newer-package`](https://docs.astral.sh/uv/reference/cli/#uv-sync--exclude-newer-package)
arguments were updated, but not their settings counterparts, so this
just updates the settings ones to closely match the arguments ones.

## Test Plan

Ran documentation locally.
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Dec 12, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.13` -> `0.9.17` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.17`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0917)

[Compare Source](astral-sh/uv@0.9.16...0.9.17)

Released on 2025-12-09.

##### Enhancements

- Add `torch-tensorrt` and `torchao` to the PyTorch list ([#&#8203;17053](astral-sh/uv#17053))
- Add hint for misplaced `--verbose`  in `uv tool run` ([#&#8203;17020](astral-sh/uv#17020))
- Add support for relative durations in `exclude-newer` (a.k.a., dependency cooldowns) ([#&#8203;16814](astral-sh/uv#16814))
- Add support for relocatable nushell activation script ([#&#8203;17036](astral-sh/uv#17036))

##### Bug fixes

- Respect dropped (but explicit) indexes in dependency groups ([#&#8203;17012](astral-sh/uv#17012))

##### Documentation

- Improve `source-exclude` reference docs ([#&#8203;16832](astral-sh/uv#16832))
- Recommend `UV_NO_DEV` in Docker installs ([#&#8203;17030](astral-sh/uv#17030))
- Update `UV_VERSION` in docs for GitLab CI/CD ([#&#8203;17040](astral-sh/uv#17040))

### [`v0.9.16`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0916)

[Compare Source](astral-sh/uv@0.9.15...0.9.16)

Released on 2025-12-06.

##### Python

- Add CPython 3.14.2
- Add CPython 3.13.11

##### Enhancements

- Add a 5m default timeout to acquiring file locks to fail faster on deadlock ([#&#8203;16342](astral-sh/uv#16342))
- Add a stub `debug` subcommand to `uv pip` announcing its intentional absence ([#&#8203;16966](astral-sh/uv#16966))
- Add bounds in `uv add --script` ([#&#8203;16954](astral-sh/uv#16954))
- Add brew specific message for `uv self update` ([#&#8203;16838](astral-sh/uv#16838))
- Error when built wheel is for the wrong platform ([#&#8203;16074](astral-sh/uv#16074))
- Filter wheels from PEP 751 files based on `--no-binary` et al in `uv pip compile` ([#&#8203;16956](astral-sh/uv#16956))
- Support `--target` and `--prefix` in `uv pip list`, `uv pip freeze`, and `uv pip show` ([#&#8203;16955](astral-sh/uv#16955))
- Tweak language for build backend validation errors ([#&#8203;16720](astral-sh/uv#16720))
- Use explicit credentials cache instead of global static ([#&#8203;16768](astral-sh/uv#16768))
- Enable SIMD in HTML parsing ([#&#8203;17010](astral-sh/uv#17010))

##### Preview features

- Fix missing preview warning in `uv workspace metadata` ([#&#8203;16988](astral-sh/uv#16988))
- Add a `uv auth helper --protocol bazel` command ([#&#8203;16886](astral-sh/uv#16886))

##### Bug fixes

- Fix Pyston wheel compatibility tags ([#&#8203;16972](astral-sh/uv#16972))
- Allow redundant entries in `tool.uv.build-backend.module-name` but emit warnings ([#&#8203;16928](astral-sh/uv#16928))
- Fix infinite loop in non-attribute re-treats during HTML parsing ([#&#8203;17010](astral-sh/uv#17010))

##### Documentation

- Clarify `--project` flag help text to indicate project discovery ([#&#8203;16965](astral-sh/uv#16965))
- Regenerate the crates.io READMEs on release ([#&#8203;16992](astral-sh/uv#16992))
- Update Docker integration guide to prefer `COPY` over `ADD` for simple cases ([#&#8203;16883](astral-sh/uv#16883))
- Update PyTorch documentation to include information about supporting CUDA 13.0.x ([#&#8203;16957](astral-sh/uv#16957))
- Update the versioning policy ([#&#8203;16710](astral-sh/uv#16710))
- Upgrade PyTorch documentation to latest versions ([#&#8203;16970](astral-sh/uv#16970))

### [`v0.9.15`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0915)

[Compare Source](astral-sh/uv@0.9.14...0.9.15)

Released on 2025-12-02.

##### Python

- Add CPython 3.14.1
- Add CPython 3.13.10

##### Enhancements

- Add ROCm 6.4 to `--torch-backend=auto` ([#&#8203;16919](astral-sh/uv#16919))
- Add a Windows manifest to uv binaries ([#&#8203;16894](astral-sh/uv#16894))
- Add LFS toggle to Git sources ([#&#8203;16143](astral-sh/uv#16143))
- Cache source reads during resolution ([#&#8203;16888](astral-sh/uv#16888))
- Allow reading requirements from scripts without an extension ([#&#8203;16923](astral-sh/uv#16923))
- Allow reading requirements from scripts with HTTP(S) paths ([#&#8203;16891](astral-sh/uv#16891))

##### Configuration

- Add `UV_HIDE_BUILD_OUTPUT` to omit build logs ([#&#8203;16885](astral-sh/uv#16885))

##### Bug fixes

- Fix `uv-trampoline-builder` builds from crates.io by moving bundled executables ([#&#8203;16922](astral-sh/uv#16922))
- Respect `NO_COLOR` and always show the command as a header when paging `uv help` output ([#&#8203;16908](astral-sh/uv#16908))
- Use `0o666` permissions for flock files instead of `0o777` ([#&#8203;16845](astral-sh/uv#16845))
- Revert "Bump `astral-tl` to v0.7.10 ([#&#8203;16887](astral-sh/uv#16887))" to narrow down a regression causing hangs in metadata retrieval ([#&#8203;16938](astral-sh/uv#16938))

##### Documentation

- Link to the uv version in crates.io member READMEs ([#&#8203;16939](astral-sh/uv#16939))

### [`v0.9.14`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0914)

[Compare Source](astral-sh/uv@0.9.13...0.9.14)

Released on 2025-12-01.

##### Performance

- Bump `astral-tl` to v0.7.10 to enable SIMD for HTML parsing ([#&#8203;16887](astral-sh/uv#16887))

##### Bug fixes

- Allow earlier post releases with exclusive ordering ([#&#8203;16881](astral-sh/uv#16881))
- Prefer updating existing `.zshenv` over creating a new one in `tool update-shell` ([#&#8203;16866](astral-sh/uv#16866))
- Respect `-e` flags in `uv add` ([#&#8203;16882](astral-sh/uv#16882))

##### Enhancements

- Attach subcommand to User-Agent string ([#&#8203;16837](astral-sh/uv#16837))
- Prefer `UV_WORKING_DIR` over `UV_WORKING_DIRECTORY` for consistency ([#&#8203;16884](astral-sh/uv#16884))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4yNy4xIiwidXBkYXRlZEluVmVyIjoiNDIuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Copilot AI added a commit to Amund211/prism that referenced this pull request Dec 18, 2025
Support for relative dates in `exclude-newer` was recently added.
Ref: astral-sh/uv#16814
Amund211 pushed a commit to Amund211/prism that referenced this pull request Dec 18, 2025
Support for relative dates in `exclude-newer` was recently added.
Ref: astral-sh/uv#16814
Amund211 pushed a commit to Amund211/prism that referenced this pull request Dec 19, 2025
Support for relative dates in `exclude-newer` was recently added.
Ref: astral-sh/uv#16814
@GeoVizNow
Copy link

Wonderful, thanks a lot for implementing this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants