Skip to content

PYTHON-6051 Convert drivers-evergreen-tools to a git submodule and pin the GitHub Actions reference - #3095

Merged
blink1073 merged 6 commits into
mongodb:mainfrom
blink1073:PYTHON-6051-2
Oct 5, 2026
Merged

blink1073 merged 6 commits into
mongodb:mainfrom
blink1073:PYTHON-6051-2

Conversation

@blink1073

@blink1073 blink1073 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

PYTHON-6051

Follow up to #3075

Changes in this PR

  • Bump the drivers-evergreen-tools submodule and all GitHub Actions pins to v1.2.0 (includes a fix for latest-server signature validation on unsupported hosts like Amazon Linux).
  • Make Python interpreter setup resilient: recover from broken virtualenvs and missing interpreters instead of blocking local setup.

Test Plan

  • Standard CI.
  • Local smoke-tests.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)? — No changelog impact (CI/dev tooling only).
  • Is there test coverage? — Smoke tests above; no driver code changed.
  • Is any followup work tracked in a JIRA ticket? — None needed.

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Copilot review overview

🟡 Changes recommended

The advertised drivers-evergreen-tools submodule pointer remains on v1.1.0.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates CI tooling to drivers-evergreen-tools v1.2.0 and improves local Python setup recovery.

Changes:

  • Pins GitHub Actions references to v1.2.0.
  • Removes broken virtual environments and adds interpreter fallback handling.
File Description
.github/​workflows/​test-python.yml Updates MongoDB setup action pins.
.github/​workflows/​test-mod-wsgi.yml Pins the mod_wsgi setup action.
.evergreen/​scripts/​setup-uv-python.sh Adds virtualenv cleanup and Python fallback logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/test-python.yml

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.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

Resolved since last review (1)

@blink1073

Copy link
Copy Markdown
Member Author

ECS failure is unrelated, it is failing on main.

@blink1073
blink1073 marked this pull request as ready for review October 5, 2026 13:32
@blink1073
blink1073 requested a review from a team as a code owner October 5, 2026 13:32
@blink1073
blink1073 requested a review from aclark4life October 5, 2026 13:32
echo "uv could not install Python \"$request\"; looking for another interpreter..."
# Ignore UV_PYTHON_SEARCH_PATH/UV_PYTHON_PREFERENCE: they would steer the
# fallback right back to the broken interpreter. Local setup only.
if [ "${CI:-}" != "true" ] && \

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.

Do we care to check for Evergreen here (where this won't ever be true)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It still could be true for a new version of python, like 3.16alpha

Comment thread .evergreen/scripts/setup-uv-python.sh Outdated
# Ignore UV_PYTHON_SEARCH_PATH/UV_PYTHON_PREFERENCE: they would steer the
# fallback right back to the broken interpreter. Local setup only.
if [ "${CI:-}" != "true" ] && \
_fallback=$(env -u UV_PYTHON_SEARCH_PATH -u UV_PYTHON_PREFERENCE \

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.

Should we unset UV_PYTHON too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed


# A .venv whose interpreter was removed breaks every `uv python find` and
# `uv sync`. It is a build artifact, so remove it and let `uv sync` recreate it.
for _py in "$ROOT/.venv/bin/python3" "$ROOT/.venv/bin/python" "$ROOT/.venv/Scripts/python.exe"; do

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.

Any interest in supporting Windows? 😄

E.g.

  # A .venv whose base interpreter is gone breaks every `uv python find` and
  # `uv sync`. It is a build artifact, so remove it and let `uv sync` recreate it.
  _venv_py=""
  for _py in "$ROOT/.venv/bin/python" "$ROOT/.venv/Scripts/python.exe"; do
    if [ -x "$_py" ]; then
      _venv_py="$_py"
      break
    fi
  done
  if [ -n "$_venv_py" ] && ! "$_venv_py" -c 'import sys' > /dev/null 2>&1; then
    echo "Removing broken .venv (its interpreter will not start); uv sync will recreate it."
    rm -rf "$ROOT/.venv"
  fi
  unset _py _venv_py

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure why not. 😄

Comment thread .evergreen/scripts/setup-uv-python.sh Outdated

HERE=$(dirname ${BASH_SOURCE:-$0})
HERE="$( cd -- "$HERE" > /dev/null 2>&1 && pwd )"
ROOT=$(dirname "$(dirname $HERE)")

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.

Missing quotes on HERE: ROOT=$(dirname "$(dirname "$HERE")") (for paths with spaces)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

@blink1073
blink1073 requested a review from aclark4life October 5, 2026 15:23

@aclark4life aclark4life 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.

LGTM

@blink1073
blink1073 merged commit 6d2a413 into mongodb:main Oct 5, 2026
45 of 47 checks passed
@blink1073
blink1073 deleted the PYTHON-6051-2 branch October 5, 2026 15:33
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.

3 participants