Skip to content

PYTHON-5980 Reinstate exclude-newer uv config - #2984

Closed
blink1073 wants to merge 3 commits into
mongodb:mainfrom
blink1073:PYTHON-5980-2
Closed

PYTHON-5980 Reinstate exclude-newer uv config#2984
blink1073 wants to merge 3 commits into
mongodb:mainfrom
blink1073:PYTHON-5980-2

Conversation

@blink1073

@blink1073 blink1073 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • PYTHON-5980 (PYTHON-5980 Commit uv.lock and automate weekly updates #2977) removed the per-run set-uv-exclude-newer action, which was correct once uv.lock is committed, but it also dropped exclude-newer = "7 days" from [tool.uv] in pyproject.toml.
  • That setting still matters whenever uv lock is regenerated (locally, or by the weekly uv-lock-update.yml job) to avoid resolving packages published in the last 7 days. Restore it and regenerate uv.lock.
  • The config was previously removed because Evergreen hosts can have an older uv (< 0.10) already on PATH, which can't parse the relative "7 days" value and silently falls back to no exclude-newer. install-dependencies.sh now checks the uv version and installs a newer one when needed.

Test plan

  • CI passes (uv lock --check job in test-python.yml)

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.lock with 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

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

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.
@blink1073
blink1073 requested a balanced review from Copilot August 13, 2026 19:05
@blink1073 blink1073 closed this Aug 13, 2026
@blink1073
blink1073 deleted the PYTHON-5980-2 branch August 13, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 as bash install-dependencies.sh and then, for the default install directory, appends $HOME/.local/bin to the parent PATH (.evergreen/scripts/setup-dev-env.sh:23-28). Consequently an older uv earlier on PATH is still selected by the subsequent uv sync, so the relative exclude-newer setting remains unsupported. The caller must prepend PYMONGO_BIN_DIR (or source this script) so the upgraded binary is used after installation.
  export PATH="$PYMONGO_BIN_DIR:$PATH"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants