Skip to content
Closed
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
23 changes: 21 additions & 2 deletions .evergreen/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,23 @@ if [ -z "${PYMONGO_BIN_DIR:-}" ]; then
PYMONGO_BIN_DIR="$HOME/.local/bin"
fi

# Ensure uv is installed.
if ! command -v uv &>/dev/null; then
# Ensure uv >= 0.10 is installed (older versions don't support pyproject.toml
# settings we rely on, e.g. relative `exclude-newer` values).
MIN_UV_VERSION="0.10.0"

uv_version_ok() {
command -v uv &>/dev/null || return 1
_current="$(uv --version | cut -d' ' -f2)"
IFS='.' read -r _min_major _min_minor _min_patch <<< "$MIN_UV_VERSION"
IFS='.' read -r _cur_major _cur_minor _cur_patch <<< "$_current"
[ "${_cur_major:-0}" -gt "${_min_major:-0}" ] && return 0
[ "${_cur_major:-0}" -lt "${_min_major:-0}" ] && return 1
[ "${_cur_minor:-0}" -gt "${_min_minor:-0}" ] && return 0
[ "${_cur_minor:-0}" -lt "${_min_minor:-0}" ] && return 1
[ "${_cur_patch:-0}" -ge "${_min_patch:-0}" ]
}

if ! uv_version_ok; then
_BIN_DIR=$PYMONGO_BIN_DIR
mkdir -p ${_BIN_DIR}
echo "Installing uv..."
Expand All @@ -26,6 +41,10 @@ if ! command -v uv &>/dev/null; then
fi
export PATH="$PYMONGO_BIN_DIR:$PATH"
echo "Installing uv... done."
if ! uv_version_ok; then
echo "Installed uv $(uv --version) but >= $MIN_UV_VERSION is required." >&2
exit 1
fi
fi

# Ensure just is installed.
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Source = "https://github.com/mongodb/mongo-python-driver"
Tracker = "https://jira.mongodb.org/projects/PYTHON/issues"

[tool.uv]
# Wait 7 days before resolving newly published package versions.
exclude-newer = "7 days"
# boto3 dropped Python 3.9 support in 1.43, so the universal lock forks at
# 3.10. Without a floor the pre-3.10 fork back-solves to boto3 1.7.84 (2018),
# whose vendored six and invalid escape sequences break test collection. No
Expand Down
4 changes: 4 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading