Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/scripts/configure-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +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
# PYMONGO_BIN_DIR so the pinned uv (installed there by setup_uv.py) takes
# precedence over the toolchain's uv.
if [ "Windows_NT" = "${OS:-}" ]; then
_toolchain_bin="/cygdrive/c/Python/Current/Scripts"
Expand Down
8 changes: 4 additions & 4 deletions .evergreen/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ "Windows_NT" = "${OS:-}" ]; then
else
export PYMONGO_BIN_DIR_POSIX="$PYMONGO_BIN_DIR"
fi
# UV_TOOL_BIN_DIR is uv's name for the same dir (setup-uv.py reads both).
# UV_TOOL_BIN_DIR is uv's name for the same dir (setup_uv.py reads both).
# UV_TOOL_DIR is left to ensure_uv.sh.
export UV_TOOL_BIN_DIR="${UV_TOOL_BIN_DIR:-$PYMONGO_BIN_DIR}"

Expand All @@ -43,12 +43,12 @@ case ":$PATH:" in
esac

# Compute the setup script path once (native Windows path on cygwin).
_uv_setup_script="$HERE/setup-uv.py"
_uv_setup_script="$HERE/setup_uv.py"
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`
# 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.
# 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
Expand Down Expand Up @@ -79,7 +79,7 @@ if [ "$_need_setup" = "1" ]; then
# and no required-version check is triggered.
python3 "$_uv_setup_script"

# Re-source env.sh so the values setup-uv.py wrote are available.
# Re-source env.sh so the values setup_uv.py wrote are available.
if [ -f $HERE/env.sh ]; then
. $HERE/env.sh
fi
Expand Down
6 changes: 3 additions & 3 deletions .evergreen/scripts/resync-all-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ PR_DESC="spec_sync.txt"
if ! [ -n "${CI:-}" ]
then
# we're running locally
python3 ./.evergreen/scripts/resync-all-specs.py
python3 ./.evergreen/scripts/resync_all_specs.py
else
# Use the newest mongodbtoolchain python; the default python3 may be too old.
PY=$(ls -1d /opt/mongodbtoolchain/v*/bin/python3 2>/dev/null | sort -V | tail -1)
[ -n "$PY" ] || PY=python3
[ "$("$PY" -c 'import sys; print(sys.version_info >= (3, 7))' 2>/dev/null)" = True ] \
|| { echo "Error: $PY is not Python 3.7+, which resync-all-specs.py requires." >&2; exit 1; }
"$PY" ./.evergreen/scripts/resync-all-specs.py --filename "$PR_DESC"
|| { echo "Error: $PY is not Python 3.7+, which resync_all_specs.py requires." >&2; exit 1; }
"$PY" ./.evergreen/scripts/resync_all_specs.py --filename "$PR_DESC"
if [[ -f $PR_DESC ]]; then
# changes were made -> call scrypt to create PR for us
.evergreen/scripts/create-spec-pr.sh "$PR_DESC"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/env python3
"""Bootstrap the pinned uv/just for the test environment.

install-dependencies.sh probes with `setup-uv.py --check`, sources ensure-uv.sh
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.

This runs under the host's system python3, which may be older than our minimum supported version.
"""

from __future__ import annotations

import os
import re
import shlex
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ git diff HEAD~1 path/to/file >> .evergreen/spec-patch/PYTHON-1234.patch
```

#### Running Locally
Both `resync-all-specs.sh` and `resync-all-specs.py` can be run locally (and won't generate a PR).
Both `resync-all-specs.sh` and `resync_all_specs.py` can be run locally (and won't generate a PR).
```bash
./.evergreen/scripts/resync-all-specs.sh
python3 ./.evergreen/scripts/resync-all-specs.py
python3 ./.evergreen/scripts/resync_all_specs.py
```

## Making a Release
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ ignore = [
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"FLY", # flynt
"N", # pep8-naming
]
unfixable = [
"RUF100", # Unused noqa
Expand All @@ -266,7 +265,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?)|dummy.*)$"
[tool.ruff.lint.per-file-ignores]
"pymongo/__init__.py" = ["E402"]
".evergreen/scripts/*.py" = ["T201"]
".evergreen/scripts/setup-uv.py" = ["I002"]
".evergreen/scripts/setup_uv.py" = ["I002"]
"test/*.py" = ["PT", "E402", "PLW", "SIM", "E741", "PTH", "S", "B904", "E722", "T201",
"RET", "ARG", "F405", "B028", "PGH001", "B018", "F403", "RUF015", "E731", "B007",
"UP031", "F401", "B023", "F811", "DTZ002", "LOG"]
Expand Down
Loading