Skip to content

PYTHON-6077 Officially support Python 3.15 - #3042

Draft
blink1073 wants to merge 16 commits into
mongodb:mainfrom
blink1073:worktree-PYTHON-6077-officially-support-py315
Draft

PYTHON-6077 Officially support Python 3.15#3042
blink1073 wants to merge 16 commits into
mongodb:mainfrom
blink1073:worktree-PYTHON-6077-officially-support-py315

Conversation

@blink1073

@blink1073 blink1073 commented Sep 5, 2026

Copy link
Copy Markdown
Member

PYTHON-6077

Changes in this PR

  • Added Python 3.15 (standard and free-threaded) to the Evergreen test matrix and wheel builds.
  • Standardized interpreter selection on UV_PYTHON, preferring the toolchain and fetching missing builds, such as the 3.15 pre-release, from python-build-standalone.
  • Fixed enterprise-auth keytab decoding for Python 3.15's stricter base64.
  • Added the Python 3.15 classifier and changelog entry.
  • Most of the lines of code in the diff are from the regenerated tasks spanning the new python verisons.

Test Plan

  • Ran an Evergreen patch; the python-build-standalone fallback resolves the 3.15 builds.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage? Added Evergreen CI coverage for the new versions.
  • Is any followup work tracked in a JIRA ticket? If so, add link(s). Drop the python-build-standalone fallback once the toolchain provides 3.15.

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 Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread .evergreen/scripts/setup_tests.py Outdated
write_env("KRB5_CONFIG", krb_conf)
LOGGER.info("Writing keytab")
keytab = base64.b64decode(config["KEYTAB_BASE64"])
keytab_b64 = config["KEYTAB_BASE64"]

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.

This change was needed for Python 3.15 support

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.

🟡 Changes recommended

The fallback selects a 64-bit interpreter for Win32 coverage and performs avoidable rate-limited API requests.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds official Python 3.15 and free-threaded 3.15 support across packaging and CI.

Changes:

  • Adds Python 3.15 metadata, changelog, tests, and wheels.
  • Standardizes CI interpreter selection through UV_PYTHON.
  • Adds a python-build-standalone fallback and stricter keytab decoding.
File summaries
File Description
pyproject.toml Adds the Python 3.15 classifier.
doc/changelog.rst Documents Python 3.15 support.
.github/workflows/dist.yml Builds and verifies 3.15 wheels.
.evergreen/scripts/setup-uv-python.sh Resolves toolchain interpreters.
.evergreen/scripts/setup-dev-env.sh Installs or fetches missing interpreters.
.evergreen/scripts/setup_tests.py Corrects keytab Base64 padding.
.evergreen/scripts/generate_config.py Generates UV_PYTHON-based tasks.
.evergreen/scripts/generate_config_utils.py Defines 3.15 versions and helpers.
.evergreen/scripts/fetch-python.sh Fetches standalone Python builds.
.evergreen/generated_configs/variants.yml Adds 3.15 compression variants.
.evergreen/generated_configs/tasks.yml Adds and migrates generated tasks.
.evergreen/generated_configs/functions.yml Propagates UV_PYTHON.
Review details

Suppressed comments (1)

.evergreen/scripts/fetch-python.sh:35

  • This unauthenticated GitHub API request runs before the existing-install check at line 53, so every repeated setup still consumes a request even after the large interpreter has been cached. Python 3.15 tasks source this setup more than once, making shared CI egress susceptible to GitHub's unauthenticated rate limit and causing otherwise cached jobs to fail. Resolve the cache path and return it before querying the release API, or cache the release metadata separately.
release="$(curl -fsSL --retry 3 https://api.github.com/repos/astral-sh/python-build-standalone/releases/latest)"
  • Files reviewed: 11/12 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Comment thread .evergreen/scripts/fetch-python.sh
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

The new python-build-standalone fallback currently sets UV_PYTHON to a directory (not an interpreter path), which is inconsistent with how UV_PYTHON is handled elsewhere and can break uv run interpreter selection.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

doc/changelog.rst:4

  • The changelog header uses an invalid date placeholder ("2026/XX/XX"), which can be confusing and may break tooling that expects a real date. Consider using an explicit "Unreleased" marker until the release date is known.
  • Files reviewed: 11/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .evergreen/scripts/setup-dev-env.sh Outdated
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