diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index 5c047548a4..c823ed3c33 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -19,17 +19,17 @@ fi # Now we can safely enable xtrace set -o xtrace -# Install a c compiler. +# Install a C compiler (for the C extensions) and git (needed by uv to +# resolve the mockupdb git dependency) apt-get -qq update < /dev/null > /dev/null -apt-get -q install -y build-essential +apt-get -q install -y build-essential git export SET_XTRACE_ON=1 export CI=true -# This container has no git, so uv must never try to resolve the mockupdb -# git dependency; UV_NO_LOCK makes uv ignore any lock file entirely. -export UV_NO_LOCK=1 cd src rm -rf .venv +# Discard any lockfile written by the host so we resolve from scratch +rm -f uv.lock rm -f .evergreen/scripts/test-env.sh || true rm -f .evergreen/scripts/env.sh || true bash ./.evergreen/just.sh setup-tests auth_aws ecs-remote diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index fc9d07b6b1..4ec527c941 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -27,8 +27,6 @@ else fi # Start the test runner. -# Never create or read a uv.lock; hosts without git can't resolve mockupdb. -export UV_NO_LOCK=1 echo "Running tests with UV_PYTHON=${UV_PYTHON:-}..." echo "UV_ARGS=${UV_ARGS}" uv run ${UV_ARGS} --reinstall-package pymongo .evergreen/scripts/run_tests.py "$@" diff --git a/.evergreen/scripts/configure-env.sh b/.evergreen/scripts/configure-env.sh index 54ddc4c136..8dc328aab3 100755 --- a/.evergreen/scripts/configure-env.sh +++ b/.evergreen/scripts/configure-env.sh @@ -65,7 +65,6 @@ export CARGO_HOME="$CARGO_HOME" export UV_TOOL_DIR="$UV_TOOL_DIR" export UV_CACHE_DIR="$UV_CACHE_DIR" export UV_TOOL_BIN_DIR="$DRIVERS_TOOLS_BINARIES" -export UV_NO_LOCK=1 export PYMONGO_BIN_DIR="$PYMONGO_BIN_DIR" export PATH="$PATH_EXT" # shellcheck disable=SC2154 diff --git a/.evergreen/scripts/kms_tester.py b/.evergreen/scripts/kms_tester.py index 1c2a39ad39..910df26b89 100644 --- a/.evergreen/scripts/kms_tester.py +++ b/.evergreen/scripts/kms_tester.py @@ -33,9 +33,7 @@ def _setup_azure_vm(base_env: dict[str, str]) -> None: env["AZUREKMS_CMD"] = "sudo apt-get install -y python3-dev build-essential" run_command(f"{azure_dir}/run-command.sh", env=env) - env["AZUREKMS_CMD"] = ( - "CI=true UV_NO_LOCK=1 bash .evergreen/just.sh setup-tests kms azure-remote" - ) + env["AZUREKMS_CMD"] = "CI=true bash .evergreen/just.sh setup-tests kms azure-remote" run_command(f"{azure_dir}/run-command.sh", env=env) LOGGER.info("Setting up Azure VM... done.") @@ -55,7 +53,7 @@ def _setup_gcp_vm(base_env: dict[str, str]) -> None: env["GCPKMS_CMD"] = "sudo apt-get install -y python3-dev build-essential" run_command(f"{gcp_dir}/run-command.sh", env=env) - env["GCPKMS_CMD"] = "CI=true UV_NO_LOCK=1 bash ./.evergreen/just.sh setup-tests kms gcp-remote" + env["GCPKMS_CMD"] = "CI=true bash ./.evergreen/just.sh setup-tests kms gcp-remote" run_command(f"{gcp_dir}/run-command.sh", env=env) LOGGER.info("Setting up GCP VM...") @@ -132,10 +130,10 @@ def test_kms_send_to_remote(sub_test_name: str) -> None: key_name = os.environ["KEY_NAME"] key_vault_endpoint = os.environ["KEY_VAULT_ENDPOINT"] env["AZUREKMS_CMD"] = ( - f'KEY_NAME="{key_name}" KEY_VAULT_ENDPOINT="{key_vault_endpoint}" CI=true UV_NO_LOCK=1 bash ./.evergreen/just.sh run-tests' + f'KEY_NAME="{key_name}" KEY_VAULT_ENDPOINT="{key_vault_endpoint}" CI=true bash ./.evergreen/just.sh run-tests' ) else: - env["GCPKMS_CMD"] = "CI=true UV_NO_LOCK=1 ./.evergreen/just.sh run-tests" + env["GCPKMS_CMD"] = "CI=true ./.evergreen/just.sh run-tests" cmd = f"{DIRS[sub_test_name]}/run-command.sh" run_command(cmd, env=env) diff --git a/.evergreen/scripts/setup-tests.sh b/.evergreen/scripts/setup-tests.sh index 714eee9162..858906a39e 100755 --- a/.evergreen/scripts/setup-tests.sh +++ b/.evergreen/scripts/setup-tests.sh @@ -21,9 +21,6 @@ if [ -f $SCRIPT_DIR/env.sh ]; then source $SCRIPT_DIR/env.sh fi -# Never create or read a uv.lock; hosts without git can't resolve mockupdb. -export UV_NO_LOCK=1 - echo "Setting up tests with args \"$*\"..." uv run ${USE_ACTIVE_VENV:+--active} "$SCRIPT_DIR/setup_tests.py" "$@" echo "Setting up tests with args \"$*\"... done." diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index b288516b68..be31421289 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -17,9 +17,6 @@ defaults: permissions: contents: read -env: - UV_NO_LOCK: "1" - jobs: static: diff --git a/justfile b/justfile index f6f10ca5a9..df678cdbac 100644 --- a/justfile +++ b/justfile @@ -1,9 +1,6 @@ # See https://just.systems/man/en/ for instructions set shell := ["bash", "-c"] -# Don't let `uv` create or read uv.lock. -export UV_NO_LOCK := "1" - # Commonly used command segments. typing_run := "uv run --group typing --extra aws --extra encryption --with numpy --extra ocsp --extra snappy --extra test --extra zstd" docs_run := "uv run --extra docs" diff --git a/pyproject.toml b/pyproject.toml index dc3c098906..571e1a4778 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,9 +47,6 @@ Source = "https://github.com/mongodb/mongo-python-driver" Tracker = "https://jira.mongodb.org/projects/PYTHON/issues" [tool.uv] -# Only sync the (empty) dev group by default; groups like mockupdb require -# an explicit --group flag so hosts without git aren't forced to resolve it. -default-groups = ["dev"] # Wait 7 days before resolving newly published package versions. exclude-newer = "7 days"