Skip to content

PYTHON-6084 Rework Evergreen Python interpreter selection for uv - #26

Draft
blink1073 wants to merge 16 commits into
mainfrom
PYTHON-6084
Draft

PYTHON-6084 Rework Evergreen Python interpreter selection for uv#26
blink1073 wants to merge 16 commits into
mainfrom
PYTHON-6084

Conversation

@blink1073

@blink1073 blink1073 commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Rework how Evergreen and GitHub Actions select the Python interpreter and pin the uv binary. Task config now sets UV_PYTHON directly (a version like 3.10/3.14t, an implementation like pypy3.11, or an absolute path) so the interpreter lookup happens on the host. The uv binary version is pinned once in pyproject.toml via [tool.uv] required-version.

  • Task config sets UV_PYTHON directly; removed TOOLCHAIN_VERSION everywhere and regenerated the Evergreen task and variant configs.
  • setup-uv-python.sh resolves the interpreter on the host, setting UV_PYTHON_SEARCH_PATH and UV_PYTHON_PREFERENCE against a matching toolchain Python, and defaults to CPython 3.10 when a task does not pin one.
  • uv is pinned via [tool.uv] required-version in pyproject.toml (==0.12.12) as a single source: uv enforces it locally, astral-sh/setup-uv reads it on GitHub, and Evergreen reads it too. Bumped manually.
  • On CI, PYMONGO_BIN_DIR is ${TMPDIR:-/tmp}/pymongo-bin so the pinned uv stays isolated from the drivers-tools bin dir, and it is placed before that dir on PATH.
  • just install installs the pinned uv into $HOME/.local/bin, and the justfile puts that directory first on PATH as a backstop.

PYTHON-6084

Changes in this PR

Test Plan

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?

Comment thread .evergreen/scripts/generate_config_utils.py Outdated
Comment thread .evergreen/scripts/setup-uv-python.sh Outdated
Comment thread .evergreen/scripts/setup-uv-python.sh Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread .github/actions/python-setup/action.yml 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.

1 participant