PYTHON-5980 Reinstate exclude-newer uv config - #2984
Closed
blink1073 wants to merge 3 commits into
Closed
Conversation
PR mongodb#2977 removed the per-run set-uv-exclude-newer action, which was correct once uv.lock is committed, but it also dropped the exclude-newer setting from pyproject.toml entirely. That setting still matters for uv lock itself, including the new weekly uv-lock-update.yml job, so restore it and regenerate the lock file.
Evergreen hosts can have an older uv already on PATH, which doesn't support the relative exclude-newer value in pyproject.toml and fails to parse it. Check the installed version and force a fresh install into PYMONGO_BIN_DIR (which already takes precedence on PATH) when it's missing or too old.
Contributor
There was a problem hiding this comment.
Pull request overview
Restores uv’s seven-day dependency-release cooldown and ensures Evergreen uses a compatible uv version.
Changes:
- Restores
exclude-newer = "7 days". - Regenerates
uv.lockwith the cooldown metadata. - Adds uv version validation to Evergreen setup.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
pyproject.toml |
Configures the seven-day cooldown. |
uv.lock |
Records the regenerated resolver options. |
.evergreen/scripts/install-dependencies.sh |
Enforces uv 0.10 or newer. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| uv_version_ok() { | ||
| command -v uv &>/dev/null || return 1 | ||
| _current="$(uv --version | cut -d' ' -f2)" | ||
| [ "$(printf '%s\n%s\n' "$MIN_UV_VERSION" "$_current" | sort -V | head -n1)" = "$MIN_UV_VERSION" ] |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
sort -V is a GNU extension not guaranteed on macOS's stock sort, and Evergreen runs macOS variants through this script. Compare the major/minor/patch components directly in bash instead.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.evergreen/scripts/install-dependencies.sh:42
- When this script upgrades an already-present
uv, this PATH update only affects this child process. Its caller runs it asbash install-dependencies.shand then, for the default install directory, appends$HOME/.local/binto the parent PATH (.evergreen/scripts/setup-dev-env.sh:23-28). Consequently an olderuvearlier on PATH is still selected by the subsequentuv sync, so the relativeexclude-newersetting remains unsupported. The caller must prependPYMONGO_BIN_DIR(or source this script) so the upgraded binary is used after installation.
export PATH="$PYMONGO_BIN_DIR:$PATH"
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
set-uv-exclude-neweraction, which was correct onceuv.lockis committed, but it also droppedexclude-newer = "7 days"from[tool.uv]inpyproject.toml.uv lockis regenerated (locally, or by the weeklyuv-lock-update.ymljob) to avoid resolving packages published in the last 7 days. Restore it and regenerateuv.lock.uv(< 0.10) already onPATH, which can't parse the relative"7 days"value and silently falls back to noexclude-newer.install-dependencies.shnow checks theuvversion and installs a newer one when needed.Test plan
uv lock --checkjob in test-python.yml)