Skip to content

PYTHON-6286 Fix system bootstrap for older system Pythons - #3246

Merged
blink1073 merged 1 commit into
mongodb:mainfrom
blink1073:PYTHON-6286
Nov 23, 2026
Merged

blink1073 merged 1 commit into
mongodb:mainfrom
blink1073:PYTHON-6286

Conversation

@blink1073

@blink1073 blink1073 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

PYTHON-6286

Changes in this PR

The test-no-toolchain tasks on RHEL8 other-hosts variants fail during task setup with a SyntaxError: install-dependencies.sh runs setup_uv.py with the system python3, 3.6 on RHEL8, and PYTHON-6250 re-added a 3.7-only from __future__ import annotations to it.

  • Remove the future import so the script runs on Python 3.6 again.
  • State the 3.6 constraint in the script's docstring.
  • Add a regression test that parses the script with the 3.6 grammar and rejects __future__ imports.

Test Plan

  • uv run --extra test python -m pytest .evergreen/scripts/test_setup_uv.py -m "" -v: 20 passed; the new test failed with Python 3.6 rejects these __future__ imports: ['annotations'] before the fix.
  • pre-commit run --all-files: all hooks pass.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

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?

@blink1073 blink1073 changed the title PYTHON-6286 [BF] test-no-toolchain-async-noauth-ssl-replica-set: SyntaxError in setup_uv.py on other-hosts RHEL8 PYTHON-6286 Fix system bootstrap for older system Pythons Nov 23, 2026
@blink1073
blink1073 requested a balanced review from Copilot November 23, 2026 18:11

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.

🟢 Approval recommended

No active review issues are reported for the uv bootstrap script’s Python 3.6 compatibility fix.

No open issues 🎉

What changed in this PR

This PR restores Python 3.6 compatibility for the uv bootstrap script, addressing setup failures on RHEL 8 hosts that use the system Python.

Changes:

  • Remove from __future__ import annotations and document the bootstrap script’s Python 3.6 constraint.
  • Add a regression test that checks Python 3.6 grammar compatibility and rejects __future__ imports.
File Description
.evergreen/​scripts/​test_setup_uv.py Add the Python 3.6 compatibility regression test.
.evergreen/​scripts/​setup_uv.py Remove the incompatible import and document bootstrap compatibility requirements.

Review effort: Balanced

@blink1073
blink1073 marked this pull request as ready for review November 23, 2026 18:14
@blink1073
blink1073 requested a review from a team as a code owner November 23, 2026 18:14
@blink1073
blink1073 merged commit e825c41 into mongodb:main Nov 23, 2026
68 checks passed
@blink1073
blink1073 deleted the PYTHON-6286 branch November 23, 2026 20:28
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