-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4975 Use justfile as the task runner #2057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cbc2db8
PYTHON-4975 Use justfile as the task runner
blink1073 7f99c3b
fix reactivation
blink1073 b249dee
fix encryption handling
blink1073 42e60b1
fix invocation
blink1073 ed041ae
cleanup invocations
blink1073 3651496
Simplify justfile usage
blink1073 ce775f3
Use just on host
blink1073 cd4265e
fix script call
blink1073 098ab70
fix handling of just
blink1073 e76b931
use drivers_tools_binaries
blink1073 3fe6ed0
use drivers_tools_binaries
blink1073 07d8483
syntax
blink1073 f41033d
fix handling of just on windows
blink1073 7c91d95
cleanup
blink1073 f8116d6
fix import time test
blink1073 6830c2a
fix coverage script
blink1073 29fa6b5
Update .github/workflows/test-python.yml
blink1073 f83a882
Merge branch 'master' of github.com:mongodb/mongo-python-driver into …
blink1073 e604fb6
add comment
blink1073 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
CI
set somewhere by drivers-evergreen-tools on some platforms?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is set on Evergreen jobs only. I'll add a comment.