diff --git a/.evergreen/scripts/configure-env.sh b/.evergreen/scripts/configure-env.sh index 360706a944..2143a56660 100755 --- a/.evergreen/scripts/configure-env.sh +++ b/.evergreen/scripts/configure-env.sh @@ -39,8 +39,7 @@ fi # Add the latest MongoDB toolchain bin dir to PATH if it exists, so that hosts # with an old system Python (e.g. RHEL8's 3.6) still get a modern interpreter # for tool installs like `uv tool install rust-just`. It goes after -# PYMONGO_BIN_DIR so the pinned uv (installed there by setup_uv.py) takes -# precedence over the toolchain's uv. +# PYMONGO_BIN_DIR so the project's uv takes precedence. if [ "Windows_NT" = "${OS:-}" ]; then _toolchain_bin="/cygdrive/c/Python/Current/Scripts" elif [ "$(uname -s)" == "Darwin" ]; then @@ -106,8 +105,9 @@ if [ "$DRIVERS_TOOLS" = "$PROJECT_DIRECTORY/drivers-evergreen-tools" ]; then # Write a uv config boundary into the submodule: it is vendored inside this # project, so uv run by the tools' own scripts would otherwise walk up to - # pyproject.toml and enforce our required-version pin. Write-if-absent, so an - # upstream uv.toml fails the submodule update loudly instead of being clobbered. + # pyproject.toml and apply this project's [tool.uv] settings. + # Write-if-absent, so an upstream uv.toml fails the submodule update loudly + # instead of being clobbered. if [ -d "${DRIVERS_TOOLS}" ] && [ ! -f "${DRIVERS_TOOLS}/uv.toml" ]; then cat < "${DRIVERS_TOOLS}/uv.toml" # Written by mongo-python-driver to stop uv's config discovery here; see diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh index 5c69b8875e..3ad8d2e9d5 100755 --- a/.evergreen/scripts/install-dependencies.sh +++ b/.evergreen/scripts/install-dependencies.sh @@ -35,7 +35,7 @@ fi export UV_TOOL_BIN_DIR="${UV_TOOL_BIN_DIR:-$PYMONGO_BIN_DIR}" # Ensure the bin dir is on PATH: hosts without env.sh (e.g. auth-aws-ecs) never -# export it, so a fresh pinned install there would be invisible to the probe +# export it, so a fresh uv install there would be invisible to the probe # below and to later steps like `uv tool install` and `uv sync`. case ":$PATH:" in *":$PYMONGO_BIN_DIR_POSIX:"*) ;; @@ -48,8 +48,9 @@ if [ "Windows_NT" = "${OS:-}" ]; then _uv_setup_script="$(cygpath -m "$_uv_setup_script")" fi -# Skip setup when the pinned uv is already installed: `setup_uv.py --check` -# compares the uv on PATH with the required-version pin, without side effects. +# Skip setup when a suitable uv is already installed: `setup_uv.py --check` +# verifies the required-version pin, or the project-controlled uv in +# UV_TOOL_BIN_DIR when unpinned, without side effects. # A full `uv sync` here would download Python and install/build dependencies # just to make this decision, and would run before setup-uv-python.sh sets # UV_PYTHON, creating the environment twice on local dev. diff --git a/.evergreen/scripts/setup-dev-env.sh b/.evergreen/scripts/setup-dev-env.sh index d9fbef2b04..a3b9b24f5b 100755 --- a/.evergreen/scripts/setup-dev-env.sh +++ b/.evergreen/scripts/setup-dev-env.sh @@ -16,7 +16,7 @@ if [ -f $HERE/test-env.sh ]; then . $HERE/test-env.sh fi -# The bin dir for the pinned uv/just. setup-system.sh sets it on evergreen hosts; +# The bin dir for uv/just. setup-system.sh sets it on evergreen hosts; # default it here so local dev (without setup-system.sh) also has a usable value. # Native (Windows) form on cygwin, like install-dependencies.sh. export PYMONGO_BIN_DIR="${PYMONGO_BIN_DIR:-$HOME/.local/bin}" diff --git a/.evergreen/scripts/setup-uv-python.sh b/.evergreen/scripts/setup-uv-python.sh index 2fe4ff5f3c..188c6a1dbb 100755 --- a/.evergreen/scripts/setup-uv-python.sh +++ b/.evergreen/scripts/setup-uv-python.sh @@ -11,7 +11,8 @@ # UV_PYTHON_PREFERENCE - "system" so the toolchain wins over managed installs. # A preference set by the task is left alone. # UV_PYTHON - the Python interpreter uv uses; defaults to CPython -# 3.11 when the task does not set one. +# 3.11, or the toolchain interpreter's path when the +# toolchain has the requested version. set -euo pipefail HERE=$(dirname "${BASH_SOURCE:-$0}") @@ -48,12 +49,17 @@ fi # uv version in pyproject.toml. export UV_PYTHON="${UV_PYTHON:-3.11}" -# Print the Python toolchain bin dir for a version like "3.11" or "3.14t". -function _toolchain_dir() { +# Print the Python toolchain bin dir for a version like "3.11" or "3.14t", +# without checking that it exists. +function _toolchain_bin_dir() { local version="$1" dir # Only plain CPython versions live in the toolchain. [[ "$version" =~ ^[0-9]+\.[0-9]+t?$ ]] || return 1 - if [ "Windows_NT" = "${OS:-}" ]; then + if [ -n "${PYMONGO_TOOLCHAIN_ROOT:-}" ]; then + # Test override of the unix toolchain root; the /bin layout under + # it is unchanged. + dir="${PYMONGO_TOOLCHAIN_ROOT}/${version}/bin" + elif [ "Windows_NT" = "${OS:-}" ]; then local winver="${version%t}" winver="${winver//./}" if [ -n "${IS_WIN32:-}" ]; then @@ -70,6 +76,25 @@ function _toolchain_dir() { else dir="/opt/python/${version}/bin" fi + echo "$dir" +} + +# Print the toolchain interpreter file for a version like "3.15t", without +# checking that it exists. Windows interpreters are exe files: native uv +# needs the exact file name. +function _interpreter_file() { + local dir="$1" version="$2" + if [ "Windows_NT" = "${OS:-}" ]; then + echo "$dir/python${version}.exe" + else + echo "$dir/python${version}" + fi +} + +# Print the toolchain bin dir for the version when it exists on this host. +function _toolchain_dir() { + local dir + dir=$(_toolchain_bin_dir "$1") || return 1 [ -d "$dir" ] || return 1 echo "$dir" } @@ -115,6 +140,15 @@ if [[ "$UV_PYTHON" == */* || "$UV_PYTHON" == *\\* ]]; then _skip_ensure=1 elif _dir=$(_toolchain_dir "$UV_PYTHON"); then _search_path="$_dir" + # Use the toolchain interpreter by explicit path when the task did not set its + # own preference (PYTHON-6135): uv uses the path as-is, so provisioning cannot + # fail on uv's interpreter discovery (it aborts on interpreters it cannot + # inspect, like RHEL8's /usr/bin/python3 3.6) or on a missing download. + _file=$(_interpreter_file "$_dir" "$UV_PYTHON") + if [ -z "${UV_PYTHON_PREFERENCE:-}" ] && [ -x "$_file" ]; then + export UV_PYTHON="$_file" + _skip_ensure=1 + fi fi # Point uv at the toolchain Python when there is one and the task did not set diff --git a/.evergreen/scripts/setup_uv.py b/.evergreen/scripts/setup_uv.py index a3f5f9dc20..76d0d4e9b1 100755 --- a/.evergreen/scripts/setup_uv.py +++ b/.evergreen/scripts/setup_uv.py @@ -1,10 +1,15 @@ #!/usr/bin/env python3 -"""Bootstrap the pinned uv/just for the test environment. +"""Bootstrap uv/just for the test environment. install-dependencies.sh probes with `setup_uv.py --check`, sources ensure-uv.sh (which finds or installs uv), then runs this script for the rest. Only the standard library is used. +The project always controls a uv in UV_TOOL_BIN_DIR: the pinned version when +[tool.uv] required-version is set, the latest uv otherwise. A uv found +elsewhere on PATH may be invisible to later steps, so setup never accepts it +as-is. + This runs under the host's system python3, which may be older than our minimum supported version. """ @@ -26,7 +31,7 @@ def required_uv_pin() -> str: - """Return [tool.uv] required-version, e.g. '==0.12.12' ('' if absent).""" + """Return [tool.uv] required-version, e.g. '==1.2.3' ('' if absent).""" pattern = re.compile(r"required-version\s*=\s*['\"]?([^'\"\s]+)['\"]?") in_uv = False for line in (ROOT / "pyproject.toml").read_text().splitlines(): @@ -65,21 +70,25 @@ def _install_uv_astral() -> None: _add_path(os.environ["UV_TOOL_BIN_DIR"]) -def _pin_uv(uv_pin: str) -> None: - """Install the pinned uv via uv tool install --force. +def _uv_exe() -> str: + """The uv binary name on this platform.""" + return "uv.exe" if os.name == "nt" else "uv" + - UV_TOOL_BIN_DIR and UV_TOOL_DIR are inherited from the environment (set by - install-dependencies.sh / ensure-uv.sh, in native form on Windows). uv tool - install writes the binary into UV_TOOL_BIN_DIR and the tool venv into - UV_TOOL_DIR; --force lets it overwrite an existing install. +def _install_uv(pin: str) -> None: + """Install uv into UV_TOOL_BIN_DIR with `uv tool install --force`. - Windows will not overwrite a running executable, so when the current uv is - already the target bin dir, run the install from a copy of the binary. + Installs the pinned version when pin is set ("==0.12.12"), the latest uv + otherwise (pin ""). Windows will not overwrite a running executable, so + when the uv driving the install is the binary being replaced, run the + install from a copy of it. """ uv_path = shutil.which("uv") + bin_dir = os.environ["UV_TOOL_BIN_DIR"] + overwrite_self = uv_path is not None and _same_path(uv_path, str(Path(bin_dir, _uv_exe()))) tool = uv_path tmp_uv = None - if os.name == "nt": + if overwrite_self: tmp_uv = Path(tempfile.mkdtemp()) / Path(uv_path).name shutil.copy2(uv_path, tmp_uv) tool = str(tmp_uv) @@ -93,7 +102,7 @@ def _pin_uv(uv_pin: str) -> None: "-q", "--force", "--from", - f"uv{uv_pin}", + f"uv{pin}", "uv", ], check=True, @@ -133,9 +142,51 @@ def _write_env() -> None: ENV_SH.write_bytes(("\n".join(keep) + "\n").encode()) -def _pinned_uv_installed() -> bool: - """Return True when the uv on PATH already matches the required-version pin.""" +def _cygdrive(path: str) -> str: + """Map a native Windows path to its cygwin /cygdrive form.""" + match = re.match(r"^([A-Za-z]):[/\\](.*)$", path) + if not match: + return path + drive, rest = match.groups() + return "/cygdrive/" + drive.lower() + "/" + rest.replace("\\", "/") + + +def _same_path(a: str, b: str) -> bool: + """Compare two paths, tolerating forms realpath cannot unify. + + On cygwin, which() may report a /cygdrive form while UV_TOOL_BIN_DIR is + native ("C:/..."). + """ + try: + if os.path.realpath(a) == os.path.realpath(b): + return True + except OSError: + pass + return any( + os.path.normcase(os.path.normpath(form_a)) == os.path.normcase(os.path.normpath(form_b)) + for form_a in (a, _cygdrive(a)) + for form_b in (b, _cygdrive(b)) + ) + + +def _project_uv_installed() -> bool: + """Return True when the uv on PATH is the one this setup put in UV_TOOL_BIN_DIR.""" + uv_path = shutil.which("uv") + bin_dir = os.environ.get("UV_TOOL_BIN_DIR") + if not uv_path or not bin_dir: + return False + return _same_path(uv_path, str(Path(bin_dir, _uv_exe()))) + + +def _required_uv_installed() -> bool: + """Return True when the uv on PATH already satisfies the setup requirement. + + With a required-version pin, the uv on PATH must match it exactly; without + a pin, it must be the project-controlled uv in UV_TOOL_BIN_DIR. + """ pin = required_uv_pin() + if not pin: + return _project_uv_installed() if not pin.startswith("=="): # Only exact pins are checked here; anything else falls back to setup. return False @@ -154,7 +205,7 @@ def main() -> int: # there would download Python and install dependencies just to decide # whether setup is needed. if "--check" in sys.argv[1:]: - return 0 if _pinned_uv_installed() else 1 + return 0 if _required_uv_installed() else 1 bin_dir = os.environ["UV_TOOL_BIN_DIR"] Path(bin_dir).mkdir(parents=True, exist_ok=True) @@ -166,7 +217,14 @@ def main() -> int: uv_pin = required_uv_pin() if uv_pin: - _pin_uv(uv_pin) + _install_uv(uv_pin) + elif not _project_uv_installed(): + # Unpinned: still install the latest uv into UV_TOOL_BIN_DIR, so the + # project controls the uv that later steps find on PATH. A uv found + # elsewhere (the vendored submodule's, the host's) may be missing from + # those steps' PATH entirely, and may lack behavior the project relies + # on, such as provisioning newer CPythons. + _install_uv("") _write_env() return 0 diff --git a/.evergreen/scripts/test_setup_uv.py b/.evergreen/scripts/test_setup_uv.py new file mode 100644 index 0000000000..1fd49a4bb2 --- /dev/null +++ b/.evergreen/scripts/test_setup_uv.py @@ -0,0 +1,522 @@ +"""Tests for .evergreen/scripts/setup_uv.py and .evergreen/scripts/setup-uv-python.sh. + +Run with: python -m pytest .evergreen/scripts/test_setup_uv.py + +The bash tests drive setup-uv-python.sh with a stub `uv` whose `python find` / +`python install` fail the way CI's uv does on hosts like rhel8.10 (an +un-inspectable /usr/bin/python3 and no cpython-3.15 download), plus a fake +toolchain root selected through PYMONGO_TOOLCHAIN_ROOT. +""" + +from __future__ import annotations + +import importlib.util +import os +import shutil +import stat +import subprocess +import sys +from pathlib import Path + +import pytest + +# The repo's pytest addopts deselect modules without the "default" mark. +pytestmark = [ + pytest.mark.default, + pytest.mark.skipif( + sys.platform in ("win32", "cygwin") or shutil.which("bash") is None, + reason="needs a unix shell", + ), +] + +HERE = Path(__file__).resolve().parent +SETUP_UV = HERE / "setup_uv.py" +SETUP_UV_PYTHON_SH = HERE / "setup-uv-python.sh" + +PIN = "==0.12.12" + +UNPINNED_PYPROJECT = '[project]\nname = "test"\n' +PINNED_PYPROJECT = f'[project]\nname = "test"\n\n[tool.uv]\nrequired-version = "{PIN}"\n' + +# A stub `uv` that fails `python find`/`python install` the way CI's uv does +# on rhel8.10, records each invocation to $UV_STUB_LOG, and emulates +# `uv tool install` by copying itself into $UV_TOOL_BIN_DIR. +STUB_UV = """\ +#!/bin/bash +[ -n "${UV_STUB_LOG:-}" ] && printf '%s\\n' "$*" >> "$UV_STUB_LOG" +case "${1:-}" in + --version|version) + printf 'uv %s (x86_64-unknown-linux-gnu)\\n' "${UV_STUB_VERSION:-0.12.24}" + exit 0 ;; +esac +case "$1 $2" in + "python find") + if [ "${3:-}" = ">=3.9" ] && [ -n "${UV_STUB_FALLBACK:-}" ]; then + printf '%s\\n' "$UV_STUB_FALLBACK" + exit 0 + fi + printf 'error: Failed to inspect Python interpreter from search path at `/usr/bin/python3`\\n' >&2 + exit 1 ;; + "python install") + printf 'error: No download found for request: cpython-3.15-linux-x86_64-gnu\\n' >&2 + exit 1 ;; + "tool install") + req="" + prev="" + for arg in "$@"; do + if [ "$prev" = "--from" ]; then req="$arg"; fi + prev="$arg" + done + [ -n "${UV_STUB_LOG:-}" ] && printf 'installed-from=%s\\n' "$req" >> "$UV_STUB_LOG" + mkdir -p "${UV_TOOL_BIN_DIR:?}" + cp "$0" "${UV_TOOL_BIN_DIR}/uv" + exit 0 ;; +esac +printf 'stub uv: unhandled invocation: %s\\n' "$*" >&2 +exit 64 +""" + + +def make_executable(path: Path) -> Path: + path.chmod(path.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) + return path + + +def write_stub_uv(bin_dir: Path) -> Path: + bin_dir.mkdir(parents=True, exist_ok=True) + stub = bin_dir / "uv" + stub.write_text(STUB_UV) + return make_executable(stub) + + +def make_toolchain(root: Path, version: str) -> Path: + """Create a fake toolchain interpreter, e.g. /3.15/bin/python3.15.""" + interpreter = root / version / "bin" / f"python{version}" + interpreter.parent.mkdir(parents=True, exist_ok=True) + interpreter.write_text("#!/bin/sh\nexit 0\n") + return make_executable(interpreter) + + +def make_sentinel(root: Path) -> Path: + """Create a no-op executable, used as an interpreter path the script accepts.""" + sentinel = root / "sentinel" + sentinel.write_text("#!/bin/sh\nexit 0\n") + return make_executable(sentinel) + + +def stub_calls(log: Path) -> list[str]: + if not log.exists(): + return [] + return [line for line in log.read_text().splitlines() if not line.startswith("installed-from=")] + + +# --- setup-uv-python.sh ------------------------------------------------------ + +setup_uv = importlib.util.module_from_spec( + importlib.util.spec_from_file_location("setup_uv", HERE / "setup_uv.py") +) +setup_uv.__spec__.loader.exec_module(setup_uv) + + +def call_toolchain_bin_dir(script_copy: Path, version: str, env_overrides: dict) -> str: + """Call the script's _toolchain_bin_dir helper and return the printed path.""" + proc = subprocess.run( # noqa: S603 + ["/bin/bash", "-c", f'. "{script_copy}"; _toolchain_bin_dir "{version}"'], + check=False, + env={ + "PATH": "/usr/bin:/bin", + "HOME": str(script_copy.parents[2]), + **env_overrides, + }, + capture_output=True, + text=True, + ) + assert proc.returncode == 0, proc.stderr + return proc.stdout.strip() + + +def script_copy_in(tmp_path: Path) -> Path: + """Copy setup-uv-python.sh into a temporary project tree and return its path.""" + scripts = tmp_path / "proj" / ".evergreen" / "scripts" + scripts.mkdir(parents=True) + script_copy = scripts / "setup-uv-python.sh" + shutil.copy(SETUP_UV_PYTHON_SH, script_copy) + return script_copy + + +def run_setup_uv_python( + tmp_path: Path, extra_env: dict, cwd: Path | None = None +) -> subprocess.CompletedProcess: + """Source a copy of setup-uv-python.sh in a temporary project tree. + + The copy's HERE/ROOT resolve inside the tree, so the script sources the + tree's env.sh (if any) and probes the tree's .venv, never the checkout's. + Reports rc and the exported UV_PYTHON / search path / preference. + """ + script_copy = script_copy_in(tmp_path) + env = { + "HOME": str(tmp_path), + "CI": "true", + } + env.update(extra_env) + return subprocess.run( # noqa: S603 + [ + "/bin/bash", + "-c", + ( + f'. "{script_copy}"; ' + 'printf "\\nUV_PYTHON=%s" "$UV_PYTHON"; ' + 'printf "\\nSEARCH_PATH=%s" "${UV_PYTHON_SEARCH_PATH-}"; ' + 'printf "\\nPREFERENCE=%s" "${UV_PYTHON_PREFERENCE-}"; ' + 'printf "\\nTOOL_BIN_DIR=%s" "${UV_TOOL_BIN_DIR-}"' + ), + ], + check=False, + env=env, + cwd=str(cwd or tmp_path), + capture_output=True, + text=True, + ) + + +@pytest.fixture +def stub_env(tmp_path): + """A stub uv bin dir and its invocation log; returns (log, env-overrides).""" + log = tmp_path / "uv-stub.log" + write_stub_uv(tmp_path / "stub-bin") + return log, {"PATH": f"{tmp_path / 'stub-bin'}:/usr/bin:/bin", "UV_STUB_LOG": str(log)} + + +def test_toolchain_python_is_used_by_path(tmp_path, stub_env): + """CI: an exact toolchain match wins by explicit path, without uv find/install.""" + log, env = stub_env + interpreter = make_toolchain(tmp_path / "toolchain", "3.15") + proc = run_setup_uv_python( + tmp_path, + extra_env={ + **env, + "UV_PYTHON": "3.15", + "PYMONGO_TOOLCHAIN_ROOT": str(tmp_path / "toolchain"), + }, + ) + assert proc.returncode == 0, proc.stderr + assert f"UV_PYTHON={interpreter}" in proc.stdout + assert f"SEARCH_PATH={interpreter.parent}" in proc.stdout + assert "PREFERENCE=system" in proc.stdout + assert stub_calls(log) == [] + + +def test_toolchain_falls_through_when_interpreter_missing(tmp_path, stub_env): + """CI: a toolchain dir without the requested version keeps using uv find/install.""" + log, env = stub_env + make_toolchain(tmp_path / "toolchain", "3.14") + proc = run_setup_uv_python( + tmp_path, + extra_env={ + **env, + "UV_PYTHON": "3.15", + "PYMONGO_TOOLCHAIN_ROOT": str(tmp_path / "toolchain"), + }, + ) + assert proc.returncode == 1 + assert "could not find or install Python" in proc.stderr + assert stub_calls(log) == ["python find 3.15", "python install 3.15"] + + +def test_task_preference_disables_bypass(tmp_path, stub_env): + """A task-set UV_PYTHON_PREFERENCE (PYTHON-6135) keeps the pre-bypass behavior.""" + log, env = stub_env + make_toolchain(tmp_path / "toolchain", "3.15") + proc = run_setup_uv_python( + tmp_path, + extra_env={ + **env, + "UV_PYTHON": "3.15", + "UV_PYTHON_PREFERENCE": "only-managed", + "PYMONGO_TOOLCHAIN_ROOT": str(tmp_path / "toolchain"), + }, + ) + assert proc.returncode == 1 + assert "could not find or install Python" in proc.stderr + # rc 1 means the explicit-path branch did not run. + assert stub_calls(log) == ["python find 3.15", "python install 3.15"] + + +def test_local_fallback_without_toolchain(tmp_path, stub_env): + """Local (no CI) hosts fall back to any interpreter >=3.9 when find/install fail.""" + _, env = stub_env + fallback = make_toolchain(tmp_path / "elsewhere", "3.11") + proc = run_setup_uv_python( + tmp_path, + extra_env={ + **env, + "UV_PYTHON": "3.15", + "CI": "", + "UV_STUB_FALLBACK": str(fallback), + # An empty toolchain root: no version can match it. + "PYMONGO_TOOLCHAIN_ROOT": str(tmp_path / "no-toolchain"), + }, + ) + assert proc.returncode == 0, proc.stderr + assert f"UV_PYTHON={fallback}" in proc.stdout + + +def test_explicit_interpreter_path_skips_probing(tmp_path, stub_env): + """An explicit interpreter path in UV_PYTHON is used as-is.""" + log, env = stub_env + interpreter = make_toolchain(tmp_path / "elsewhere", "3.12") + proc = run_setup_uv_python(tmp_path, extra_env={**env, "UV_PYTHON": str(interpreter)}) + assert proc.returncode == 0, proc.stderr + assert f"UV_PYTHON={interpreter}" in proc.stdout + assert stub_calls(log) == [] + + +def test_toolchain_paths_preserved_without_override(tmp_path): + """Without the test override, the platform toolchain paths are preserved as-is.""" + script_copy = script_copy_in(tmp_path) + sentinel = make_sentinel(tmp_path) + if sys.platform == "darwin": + expected = { + "3.15": "/Library/Frameworks/Python.Framework/Versions/3.15/bin", + "3.15t": "/Library/Frameworks/PythonT.Framework/Versions/3.15/bin", + } + else: + expected = { + "3.15": "/opt/python/3.15/bin", + "3.15t": "/opt/python/3.15t/bin", + } + for version, path in expected.items(): + assert call_toolchain_bin_dir(script_copy, version, {"UV_PYTHON": str(sentinel)}) == path + + +def test_toolchain_override_keeps_version_layout(tmp_path): + """With the test override, the /bin layout under it is kept.""" + script_copy = script_copy_in(tmp_path) + sentinel = make_sentinel(tmp_path) + override = {"UV_PYTHON": str(sentinel), "PYMONGO_TOOLCHAIN_ROOT": str(tmp_path / "root")} + assert call_toolchain_bin_dir(script_copy, "3.15t", override) == str( + tmp_path / "root" / "3.15t" / "bin" + ) + + +def test_toolchain_branch_for_windows(tmp_path): + """The Windows branch computes the python toolchain path.""" + script_copy = script_copy_in(tmp_path) + sentinel = make_sentinel(tmp_path) + env = {"OS": "Windows_NT", "UV_PYTHON": str(sentinel)} + assert call_toolchain_bin_dir(script_copy, "3.15", env) == "C:/python/Python315" + + +def call_interpreter_file(script_copy: Path, version: str, env_overrides: dict) -> str: + """Call the script's _interpreter_file helper and return the printed path.""" + proc = subprocess.run( # noqa: S603 + [ + "/bin/bash", + "-c", + f'. "{script_copy}"; _interpreter_file "/toolchain/dir" "{version}"', + ], + check=False, + env={ + "PATH": "/usr/bin:/bin", + "HOME": str(script_copy.parents[2]), + **env_overrides, + }, + capture_output=True, + text=True, + ) + assert proc.returncode == 0, proc.stderr + return proc.stdout.strip() + + +def test_interpreter_file_names_the_exact_file(tmp_path): + """Windows interpreters are exe files; the other platforms use the bare name. + + Native uv needs the exact file name; cygwin bash's -x test also matches + the bare name (PYTHON-6273). + """ + script_copy = script_copy_in(tmp_path) + sentinel = make_sentinel(tmp_path) + windows = {"OS": "Windows_NT", "UV_PYTHON": str(sentinel)} + assert call_interpreter_file(script_copy, "3.15t", windows) == "/toolchain/dir/python3.15t.exe" + assert call_interpreter_file(script_copy, "3.15t", {"UV_PYTHON": str(sentinel)}) == ( + "/toolchain/dir/python3.15t" + ) + assert call_interpreter_file(script_copy, "3.11", windows) == "/toolchain/dir/python3.11.exe" + + +def test_windows_toolchain_interpreter_is_exported_as_exe_file(tmp_path, stub_env): + """CI (Windows): the exported interpreter path names the .exe file exactly. + + The script computes the toolchain dir as the native path + "C:/python/Python315", which resolves under this test's cwd. + """ + log, env = stub_env + python_dir = tmp_path / "C:" / "python" / "Python315" + python_dir.mkdir(parents=True) + interpreter = python_dir / "python3.15t.exe" + interpreter.write_text("#!/bin/sh\nexit 0\n") + make_executable(interpreter) + proc = run_setup_uv_python( + tmp_path, + extra_env={**env, "UV_PYTHON": "3.15t", "OS": "Windows_NT"}, + cwd=tmp_path, + ) + assert proc.returncode == 0, proc.stderr + assert "UV_PYTHON=C:/python/Python315/python3.15t.exe" in proc.stdout + assert stub_calls(log) == [] + + +def test_script_sources_env_sh_from_its_tree(tmp_path, stub_env): + """The script sources env.sh from the copy's tree, not the checkout's.""" + _, env = stub_env + fallback = make_toolchain(tmp_path / "elsewhere", "3.11") + proc = run_setup_uv_python( + tmp_path, + extra_env={ + **env, + "CI": "", + "UV_STUB_FALLBACK": str(fallback), + }, + ) + # A leaked checkout env.sh would set UV_TOOL_BIN_DIR; the runner tree has none. + assert proc.returncode == 0, proc.stderr + assert proc.stdout.rstrip("\n").endswith("TOOL_BIN_DIR=") + + +def test_same_path_maps_cygwin_forms(): + """A native Windows path matches its cygwin /cygdrive form.""" + assert setup_uv._same_path("C:/tools/uv.exe", "C:/tools/uv.exe") + assert setup_uv._same_path("C:/tools/uv.exe", "/cygdrive/c/tools/uv.exe") + assert setup_uv._same_path("/cygdrive/c/tools/uv.exe", "C:/tools/uv.exe") + assert not setup_uv._same_path("C:/tools/uv.exe", "C:/elsewhere/uv.exe") + + +# --- setup_uv.py ------------------------------------------------------------ + + +@pytest.fixture +def project(tmp_path): + """A fake project tree: a pyproject.toml plus a copy of setup_uv.py.""" + proj = tmp_path / "proj" + scripts = proj / ".evergreen" / "scripts" + scripts.mkdir(parents=True) + shutil.copy(SETUP_UV, scripts / "setup_uv.py") + (proj / "pyproject.toml").write_text(UNPINNED_PYPROJECT) + return proj + + +def run_setup_uv(project: Path, args: list[str], env: dict) -> subprocess.CompletedProcess: + """Run setup_uv.py with the inherited environment plus the overrides. + + Unlike the bash harness, the environment is inherited: setup_uv.py runs + subprocesses (uv tool install) that need a working PATH. + """ + return subprocess.run( # noqa: S603 + [sys.executable, str(project / ".evergreen" / "scripts" / "setup_uv.py"), *args], + check=False, + env={**os.environ, **env}, + capture_output=True, + text=True, + ) + + +def test_check_unpinned_requires_project_uv(tmp_path, project): + """Unpinned --check passes only for the uv setup installed, not any uv on PATH.""" + bin_dir = tmp_path / "project-bin" + foreign = write_stub_uv(tmp_path / "foreign-bin") + bin_dir.mkdir() + write_stub_uv(bin_dir) + env = {"PATH": f"{foreign.parent}:{bin_dir}:/usr/bin:/bin", "UV_TOOL_BIN_DIR": str(bin_dir)} + assert run_setup_uv(project, ["--check"], env).returncode == 1 + + +def test_check_unpinned_accepts_project_uv(tmp_path, project): + """Unpinned --check passes when the uv on PATH is the project-installed one.""" + bin_dir = tmp_path / "project-bin" + bin_dir.mkdir() + write_stub_uv(bin_dir) + env = {"PATH": f"{bin_dir}:/usr/bin:/bin", "UV_TOOL_BIN_DIR": str(bin_dir)} + assert run_setup_uv(project, ["--check"], env).returncode == 0 + + +def test_check_pinned_requires_exact_version(tmp_path, project): + """Pinned --check keeps comparing the uv on PATH with the pin.""" + (project / "pyproject.toml").write_text(PINNED_PYPROJECT) + bin_dir = tmp_path / "project-bin" + bin_dir.mkdir() + write_stub_uv(bin_dir) + env = { + "PATH": f"{bin_dir}:/usr/bin:/bin", + "UV_TOOL_BIN_DIR": str(bin_dir), + "UV_STUB_VERSION": "0.12.24", + } + assert run_setup_uv(project, ["--check"], env).returncode == 1 + env["UV_STUB_VERSION"] = "0.12.12" + assert run_setup_uv(project, ["--check"], env).returncode == 0 + + +def test_main_unpinned_installs_latest_uv_into_bin_dir(tmp_path, project): + """Unpinned setup installs the latest uv into UV_TOOL_BIN_DIR over a foreign uv on PATH.""" + log = tmp_path / "log" + foreign = write_stub_uv(tmp_path / "foreign-bin") + bin_dir = tmp_path / "project-bin" + env = { + "PATH": f"{foreign.parent}:/usr/bin:/bin", + "UV_TOOL_BIN_DIR": str(bin_dir), + "UV_STUB_LOG": str(log), + } + proc = run_setup_uv(project, [], env) + assert proc.returncode == 0, proc.stderr + assert (bin_dir / "uv").exists() + assert "installed-from=uv\n" in log.read_text() + + +def test_main_unpinned_skips_install_when_project_uv_on_path(tmp_path, project): + """Unpinned setup does not reinstall when the project uv is already on PATH.""" + log = tmp_path / "log" + bin_dir = tmp_path / "project-bin" + write_stub_uv(bin_dir) + env = { + "PATH": f"{bin_dir}:/usr/bin:/bin", + "UV_TOOL_BIN_DIR": str(bin_dir), + "UV_STUB_LOG": str(log), + } + proc = run_setup_uv(project, [], env) + assert proc.returncode == 0, proc.stderr + assert not log.exists() or "installed-from=" not in log.read_text() + + +def test_main_pinned_installs_pinned_uv(tmp_path, project): + """Pinned setup keeps installing the pinned uv into UV_TOOL_BIN_DIR.""" + (project / "pyproject.toml").write_text(PINNED_PYPROJECT) + log = tmp_path / "log" + foreign = write_stub_uv(tmp_path / "foreign-bin") + bin_dir = tmp_path / "project-bin" + env = { + "PATH": f"{foreign.parent}:/usr/bin:/bin", + "UV_TOOL_BIN_DIR": str(bin_dir), + "UV_STUB_LOG": str(log), + "UV_STUB_VERSION": "0.12.24", + } + proc = run_setup_uv(project, [], env) + assert proc.returncode == 0, proc.stderr + assert (bin_dir / "uv").exists() + assert f"installed-from=uv{PIN}\n" in log.read_text() + + +def test_main_pinned_self_overwrite_runs_from_copy(tmp_path, project): + """When the driving uv is the binary being replaced, the install runs from a copy.""" + (project / "pyproject.toml").write_text(PINNED_PYPROJECT) + log = tmp_path / "log" + bin_dir = tmp_path / "project-bin" + write_stub_uv(bin_dir) + env = { + "PATH": f"{bin_dir}:/usr/bin:/bin", + "UV_TOOL_BIN_DIR": str(bin_dir), + "UV_STUB_LOG": str(log), + "UV_STUB_VERSION": "0.12.12", + } + proc = run_setup_uv(project, [], env) + assert proc.returncode == 0, proc.stderr + assert (bin_dir / "uv").exists() + assert f"installed-from=uv{PIN}\n" in log.read_text() diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8f82505fcb..c426ae42b4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,14 +11,23 @@ updates: actions: patterns: - "*" - # Python (uv). Routine version updates are handled by the uv-lock-update - # workflow, so a limit of 0 turns off Dependabot version-update PRs here. - # Security updates are exempt from this limit and still open normally. + # Python (uv). Dependabot fully manages uv.lock: one grouped weekly pull + # request plus immediate, ungrouped security updates. Never set uv's + # exclude-newer in pyproject.toml instead: Dependabot resolves with it and + # produces pull requests that remove or downgrade packages + # (dependabot-core#14156). - package-ecosystem: "uv" directory: "/" schedule: interval: "weekly" - open-pull-requests-limit: 0 + cooldown: + default-days: 7 + allow: + - dependency-type: "all" + groups: + uv: + patterns: + - "*" # drivers-evergreen-tools submodule - package-ecosystem: "gitsubmodule" directory: "/" diff --git a/.github/workflows/uv-lock-update.yml b/.github/workflows/uv-lock-update.yml deleted file mode 100644 index 61744bbcb4..0000000000 --- a/.github/workflows/uv-lock-update.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: uv Lock Update - -on: - schedule: - # Tuesdays at 12:00 UTC. - - cron: "0 12 * * 2" - workflow_dispatch: - inputs: - dry_run: - description: "Run without pushing or opening a pull request" - type: boolean - default: false - -permissions: - contents: read - # A live run uses the app token, but a dry run looks up the existing pull - # request with github.token, so that read has to be granted here. - pull-requests: read - -concurrency: - group: uv-lock-update - cancel-in-progress: false - -jobs: - update: - name: Update uv.lock - runs-on: ubuntu-latest - environment: automation - if: github.repository_owner == 'mongodb' || github.event_name == 'workflow_dispatch' - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 - with: - python-version: "3.11" - - uses: mongodb-labs/drivers-github-tools/python/uv-lock-update@99b1cbd729bc83bf7fc74e1b2a97fffad3d65d7b # v3.1.1 - with: - app_id: ${{ vars.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - dry_run: ${{ inputs.dry_run || 'false' }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27e4e2bd02..994feb5d30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -129,3 +129,11 @@ repos: language: python require_serial: true additional_dependencies: ["pytest", "pytest-asyncio", "shrub.py>=3.10.0", "pyyaml>=6.0.2"] + - id: evergreen-scripts + name: evergreen-scripts + entry: python -m pytest .evergreen/scripts/test_setup_uv.py -m "" + language: python + require_serial: true + pass_filenames: false + files: ^\.evergreen/scripts/ + additional_dependencies: ["pytest", "pytest-asyncio"] diff --git a/AGENTS.md b/AGENTS.md index 1018b63902..b11b8c09da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,6 +42,9 @@ Async functions must not call blocking I/O. New features need integration tests. Bug fixes need regression tests. +## Dependency updates +Dependabot fully manages `uv.lock`: one grouped weekly pull request plus immediate security pull requests. Never set `[tool.uv] exclude-newer` in `pyproject.toml`; pin `required-version` only when a uv lockfile feature requires it. Details in CONTRIBUTING.md "Dependency updates". + ## Commit and PR Conventions - Prefix commits and PR titles with the JIRA ticket: `PYTHON-1234 Fix retryable write on mongos` - Backport PRs: append the target branch in brackets — `PYTHON-1234 [v4.9] Fix retryable write` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e0e058c94..007b73cfd7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -199,12 +199,12 @@ the pages will re-render and the browser will automatically refresh. create a virtual environment and run `pytest` directly. If you want to use a specific version of Python, set `UV_PYTHON` before running `just install`. - `just install` installs the pinned version of `uv` (from `[tool.uv] required-version`) into `$HOME/.local/bin`, - and adds that directory to your shell rc file when missing, so the pinned `uv` takes effect in new shells. If a - project `uv` command (e.g. `just test`) runs with a different `uv` version, `uv` fails fast and tells you how to update. - Scripts inside the vendored `drivers-evergreen-tools` submodule are exempt: the setup scripts write a `uv.toml` - boundary file into that checkout (see `.evergreen/scripts/configure-env.sh`), which stops uv's config discovery - there, since the tools' scripts run uv versions this project does not pin. + `just install` installs the latest `uv` into `$HOME/.local/bin` (no pin) unless the `uv` on PATH + is that copy, and adds that directory to your shell rc file when missing. The fail-fast version check + applies only when a `required-version` pin is set under `[tool.uv]` in `pyproject.toml`. The + vendored `drivers-evergreen-tools` submodule is exempt from this project's uv settings: the setup + scripts write a `uv.toml` boundary into that checkout (see `.evergreen/scripts/configure-env.sh`) + to stop uv's config discovery there. - Ensure you have started the appropriate Mongo Server(s). You can run `just run-server` with optional args to set up the server. All given options will be passed to [`run-mongodb.sh`](https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-mongodb.sh). Run `${DRIVERS_TOOLS:-drivers-evergreen-tools}/.evergreen/run-mongodb.sh start -h` @@ -481,16 +481,16 @@ Tasks are host-agnostic, so the interpreter lookup happens on the host: for a pl CPython version whose toolchain dir exists, `UV_PYTHON_SEARCH_PATH` points uv at it, and for anything else (a version the toolchain lacks) uv downloads it. - If a specific Python binary is needed (for example on the FIPS host), set `UV_PYTHON=/path/to/python`. - - The default if `UV_PYTHON` is not set is CPython 3.10. This is deterministic across host types, so a task + - The default if `UV_PYTHON` is not set is CPython 3.11. This is deterministic across host types, so a task that does not pin a version always gets the same Python (with the build headers (`Python.h`) needed to build the C extensions). - - The uv binary version is pinned once in `[tool.uv] required-version` in `pyproject.toml`. - `.evergreen/scripts/install-dependencies.sh` installs it with `uv tool install`, uv enforces it locally, and - `astral-sh/setup-uv` reads it on GitHub. Bump it manually when a newer uv is needed. If uv cannot find the - requested Python, it installs it; if that fails, the task fails. The pin is not enforced for scripts inside - the vendored `drivers-evergreen-tools` submodule: those scripts run uv versions this project does not pin, so - the setup scripts write a `uv.toml` boundary into the submodule checkout that stops uv's config discovery - (and with it the required-version check) at the submodule boundary. + - GitHub Actions use the latest uv (`astral-sh/setup-uv`'s default); Evergreen ensures a + project-controlled uv in `UV_TOOL_BIN_DIR` via `ensure-uv.sh` / `setup_uv.py` (the pinned + version when a pin is set, the latest otherwise). A `[tool.uv] required-version` pin is added + only when a needed uv lockfile feature requires it. If uv cannot find the requested Python, it + installs it; if that fails, the task fails. When the MongoDB toolchain provides the requested + version, `setup-uv-python.sh` points `UV_PYTHON` at that interpreter by path, keeping + provisioning independent of the uv version on PATH. - Regenerate the test variants and tasks using `pre-commit run --all-files generate-config`. - PR tasks pin to the Python boundaries: `MIN_PYTHON` with `TEST_MIN_DEPS=1`, `MAX_PYTHON`, and one `FREE_THREADED_PYTHON`, against the newest numbered server (`MAX_VERSION`; the `latest` nightly @@ -657,10 +657,18 @@ From the spawn host or Ubuntu image, do the following: ## Dependency updates -Dependabot raises PRs at most once per week for GitHub Actions updates. For Python -dependencies it is limited to security updates, because routine upgrades are handled by -a scheduled workflow that runs weekly, running `uv lock --upgrade` and keeping a single -open pull request on the `uv-lock-update` branch. +Dependabot raises PRs at most once per week for GitHub Actions updates. Dependabot fully +manages `uv.lock`: one grouped weekly pull request with a 7-day cooldown, plus immediate, +ungrouped security updates the cooldown never delays. + +Never set `exclude-newer` under `[tool.uv]` in `pyproject.toml`: Dependabot resolves with +it and produces pull requests that remove or downgrade packages +([dependabot-core#14156](https://github.com/dependabot/dependabot-core/issues/14156)). To +pull a routine update forward past the cooldown, list the package under the cooldown's +`exclude` key in `.github/dependabot.yml`. + +Set `[tool.uv] required-version` only when a needed uv feature requires it, and keep it +satisfiable by the uv version Dependabot ships. If a typing dependency has changed, run `just typing` and handle any new findings. @@ -670,9 +678,7 @@ If a typing dependency has changed, run `just typing` and handle any new finding and in CI. Continuous integration runs `uv lock --check`, which fails when the lock file no longer matches `pyproject.toml`. -If that check fails on your pull request, regenerate the lock file and commit the result. -A 7 day cutoff (`exclude-newer` in `pyproject.toml`) applies automatically, so a package -version yanked shortly after release is less likely to land in the lock file: +If that check fails on your pull request, regenerate the lock file and commit the result: ```bash uv lock diff --git a/fuzz/README.md b/fuzz/README.md index 8069c0586c..1dfee074be 100644 --- a/fuzz/README.md +++ b/fuzz/README.md @@ -26,9 +26,9 @@ Atheris is a `uv` dependency group. Run targets from the repository root: uv run --group fuzz python fuzz/fuzz_decode.py fuzz/regression/* ``` -Atheris publishes CPython 3.12 to 3.14 wheels for Linux x86_64 only, so the -`fuzz` group cannot install on other interpreters or platforms. Pin a -compatible interpreter where one is available, and run in a Linux x86_64 +The latest atheris publishes CPython 3.12 to 3.14 wheels for Linux x86_64 +only, so the `fuzz` group may not install on other interpreters or platforms. +Pin a compatible interpreter where one is available, and run in a Linux x86_64 container otherwise: ```bash diff --git a/pyproject.toml b/pyproject.toml index 1d4023d14d..4ca3dc883c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,16 +44,6 @@ Documentation = "https://www.mongodb.com/docs/languages/python/pymongo-driver/cu Source = "https://github.com/mongodb/mongo-python-driver" Tracker = "https://jira.mongodb.org/projects/PYTHON/issues" -[tool.uv] -# Pin the uv binary version across local dev, GitHub Actions, and Evergreen. -# uv enforces this locally, astral-sh/setup-uv reads it on GitHub, and -# install-dependencies.sh installs it in Evergreen. Bump manually when a newer uv -# is needed. -required-version = "==0.12.12" -# Skip dependency releases newer than 7 days. Defining it here keeps every uv -# invocation on the same cutoff. -exclude-newer = "7 days" - [dependency-groups] dev = [] lint = [ @@ -71,7 +61,7 @@ coverage = [ mockupdb = [ "mockupdb>=1.8.1" ] -# Atheris publishes CPython 3.12-3.14 Linux x86_64 wheels only; see fuzz/README.md. +# The latest atheris publishes CPython 3.12-3.14 Linux x86_64 wheels only; see fuzz/README.md. fuzz = ["atheris>=2.3.0"] perf = ["simplejson>=3.17.0"] typing = [ diff --git a/uv.lock b/uv.lock index 01b4ceb7db..3736fc9132 100644 --- a/uv.lock +++ b/uv.lock @@ -1,15 +1,11 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.11.5'", "python_full_version < '3.11.5'", ] -[options] -exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. -exclude-newer-span = "P7D" - [[package]] name = "accessible-pygments" version = "0.0.5" @@ -44,10 +40,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a9/16/7757fb84c819accc7d7e9af5291b261e4abb8627ee040f99e7d35ef2457a/anyio-4.16.0-py3-none-any.whl", hash = "sha256:c66ae634e0b8228396b801741beb3294326d4b6102f7bba4041c0dfb58c29026", size = 134521, upload-time = "2026-11-01T11:20:05.59Z" }, ] +[[package]] +name = "atheris" +version = "3.0.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11.5'", +] +sdist = { url = "https://files.pythonhosted.org/packages/f8/58/5965955898e16bee17c8379eae12194993bf641c4629016991248b862069/atheris-3.0.0.tar.gz", hash = "sha256:1f0929c7bc3040f3fe4102e557718734190cf2d7718bbb8e3ce6d3eb56ef5bb3", size = 373239, upload-time = "2025-11-24T23:54:02.15Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/da/15/cf109e2e8696a54c8c4bc3ef79a79bec32361eceb64eaa36690a682e83a9/atheris-3.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8a5c8a781467c187da40fd29139784193e2647058831f837f675d0bb8cbd8746", size = 34805555, upload-time = "2025-11-24T23:53:53.477Z" }, + { url = "https://files.pythonhosted.org/packages/85/8c/e9960b996e70e5f6a523670431166b2b238de52fef094955515dcf854da1/atheris-3.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:510e502c57b6dc615fb174066407af620d4c7f73cf08a782c86e7761bf12c4eb", size = 34907016, upload-time = "2025-11-24T23:53:56.535Z" }, + { url = "https://files.pythonhosted.org/packages/db/48/df670f75f458cc7c1752a01a394fd59c830b08172dd59cf29d73f31050f9/atheris-3.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a402cdca8a650d1371050b1f9552eb4cdc488d2db64950d603c4560318365eac", size = 34858525, upload-time = "2025-11-24T23:53:59.925Z" }, +] + [[package]] name = "atheris" version = "3.1.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11.5'", +] wheels = [ { url = "https://files.pythonhosted.org/packages/0a/88/fd6ad595dafa9c7ce56dbfcaff0c7244988dac3af86c771166c6516ccf6b/atheris-3.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ec5e11f21a4c197fe91f7aea2b2de88e623c73a21fc07b105ac6329a1588457b", size = 36875908, upload-time = "2026-06-17T00:04:01.104Z" }, { url = "https://files.pythonhosted.org/packages/4e/18/e19718c384fd7d801d0da7485407daef9af6194b6d8c8818175bec5efec6/atheris-3.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f8a9f51ce8369026e8eb7b7174835e8c4c85a1a6db5d9add36c15100779d2a39", size = 36800563, upload-time = "2026-06-17T00:04:04.559Z" }, @@ -1454,7 +1467,8 @@ coverage = [ { name = "coverage", extra = ["toml"] }, ] fuzz = [ - { name = "atheris" }, + { name = "atheris", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11.5'" }, + { name = "atheris", version = "3.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11.5'" }, ] gevent = [ { name = "gevent" },