-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYTHON-4975 Use justfile as the task runner (#2057)
Co-authored-by: Noah Stapp <[email protected]>
- Loading branch information
Showing
32 changed files
with
252 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
. .evergreen/scripts/setup-dev-env.sh | ||
just "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ -f "$DRIVERS_TOOLS"/.evergreen/csfle/secrets-export.sh ]; then | ||
. .evergreen/hatch.sh encryption:teardown | ||
bash .evergreen/teardown-encryption.sh | ||
fi | ||
rm -rf "${DRIVERS_TOOLS}" || true | ||
rm -f ./secrets-export.sh || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
set -eu | ||
file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" | ||
# Don't use ${file} syntax here because evergreen treats it as an empty expansion. | ||
[ -f "$file" ] && bash "$file" || echo "$file not available, skipping" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
PYTHON_BINARY=${PYTHON_BINARY} bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh doctest:test | ||
PYTHON_BINARY=${PYTHON_BINARY} bash "${PROJECT_DIRECTORY}"/.evergreen/just.sh docs-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
HERE=$(dirname ${BASH_SOURCE:-$0}) | ||
pushd "$(dirname "$(dirname $HERE)")" > /dev/null | ||
|
||
# Source the env file to pick up common variables. | ||
if [ -f $HERE/scripts/env.sh ]; then | ||
source $HERE/scripts/env.sh | ||
fi | ||
|
||
# Set the location of the python bin dir. | ||
if [ "Windows_NT" = "${OS:-}" ]; then | ||
BIN_DIR=.venv/Scripts | ||
else | ||
BIN_DIR=.venv/bin | ||
fi | ||
|
||
# Ensure there is a python venv. | ||
if [ ! -d $BIN_DIR ]; then | ||
. .evergreen/utils.sh | ||
|
||
if [ -z "${PYTHON_BINARY:-}" ]; then | ||
PYTHON_BINARY=$(find_python3) | ||
fi | ||
|
||
echo "Creating virtual environment..." | ||
createvirtualenv "$PYTHON_BINARY" .venv | ||
echo "Creating virtual environment... done." | ||
fi | ||
|
||
# Activate the virtual env. | ||
. $BIN_DIR/activate | ||
|
||
# Ensure there is a local hatch. | ||
if [ ! -f $BIN_DIR/hatch ]; then | ||
echo "Installing hatch..." | ||
python -m pip install hatch || { | ||
# CARGO_HOME is defined in configure-env.sh | ||
export CARGO_HOME=${CARGO_HOME:-$HOME/.cargo/} | ||
export RUSTUP_HOME="${CARGO_HOME}/.rustup" | ||
${DRIVERS_TOOLS}/.evergreen/install-rust.sh | ||
source "${CARGO_HOME}/env" | ||
python -m pip install hatch | ||
} | ||
echo "Installing hatch... done." | ||
fi | ||
|
||
# Ensure hatch does not write to user or global locations. | ||
HATCH_CONFIG=${HATCH_CONFIG:-hatch_config.toml} | ||
if [ ! -f ${HATCH_CONFIG} ]; then | ||
touch hatch_config.toml | ||
hatch config restore | ||
hatch config set dirs.data "$(pwd)/.hatch/data" | ||
hatch config set dirs.cache "$(pwd)/.hatch/cache" | ||
fi | ||
|
||
# Ensure there is a local pre-commit if there is a git checkout. | ||
if [ -d .git ]; then | ||
if [ ! -f $BIN_DIR/pre-commit ]; then | ||
python -m pip install pre-commit | ||
fi | ||
|
||
# Ensure the pre-commit hook is installed. | ||
if [ ! -f .git/hooks/pre-commit ]; then | ||
pre-commit install | ||
fi | ||
fi | ||
|
||
# Install pymongo and its test deps. | ||
python -m pip install ".[test]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "${test_encryption}" ]; then | ||
./.evergreen/hatch.sh encryption:setup | ||
bash .evergreen/setup-encryption.sh | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash -ex | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
set -eu | ||
|
||
find_python3() { | ||
PYTHON="" | ||
|
Oops, something went wrong.