-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5615 Use uv python when python toolchain is not available #2597
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 41 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
e32795e
refactor setup scripts
blink1073 1155c0a
fix setup-uv-python script
blink1073 f9edbb1
debug
blink1073 39517b1
cleanup
blink1073 06a6fd2
debug
blink1073 ed924ab
try again
blink1073 b5e6c52
try again
blink1073 f8ef559
debug
blink1073 3cb311d
clean and debug
blink1073 d789f3b
more cleanup
blink1073 49e20c5
clean and debug
blink1073 bd1a45f
debug
blink1073 25606b9
debug
blink1073 f068000
force --python arg
blink1073 29d8232
try with arg
blink1073 73d5e3e
debug
blink1073 0240bcf
wip
blink1073 4652a85
debug
blink1073 1780b28
debug
blink1073 cb7e305
debug
blink1073 9eb066f
try again
blink1073 d529de4
try again
blink1073 be49d53
cleanup
blink1073 d4a10a9
Merge branch 'master' of github.com:mongodb/mongo-python-driver into …
blink1073 d4a3221
cleanup
blink1073 c3bca88
cleanup
blink1073 892166c
fix ecs test
blink1073 025d793
fix ecs test
blink1073 d28ea9c
set default
blink1073 025a0ff
debug
blink1073 2053460
cleanup
blink1073 8e85f06
fixup
blink1073 a2a9c63
cleanup
blink1073 735899c
try again
blink1073 34a8c04
fix just install
blink1073 e39c65d
undo workflow changes
blink1073 380331a
cleanup
blink1073 ddc0e17
whitespace
blink1073 40f1f7d
undo change
blink1073 7cfeee5
verify uv-lock check
blink1073 edfcc03
Revert "verify uv-lock check"
blink1073 255cfeb
Merge branch 'master' of github.com:mongodb/mongo-python-driver into …
blink1073 a9dd65c
debug
blink1073 2de2171
debug
blink1073 b247cb8
debug
blink1073 de5f785
fix handling of free-threaded python on windows
blink1073 b1b070c
fix handling of free-threaded python on windows
blink1073 cd9aaa2
fix handling of free-threaded python on windows
blink1073 a60869b
fix handling of free-threaded python on windows
blink1073 68f448f
fix lambda and search index tests
blink1073 5505b4e
debug
blink1073 a5df391
try again
blink1073 3342a97
update behavior and add notes
blink1073 bb58305
pull from master
blink1073 6c598ad
address review
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 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
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,59 +1,58 @@ | ||
| #!/bin/bash | ||
| # Set up a development environment on an evergreen host. | ||
| # Set up development environment. | ||
| set -eu | ||
|
|
||
| HERE=$(dirname ${BASH_SOURCE:-$0}) | ||
| HERE="$( cd -- "$HERE" > /dev/null 2>&1 && pwd )" | ||
| ROOT=$(dirname "$(dirname $HERE)") | ||
| pushd $ROOT > /dev/null | ||
|
|
||
| # Bail early if running on GitHub Actions. | ||
| if [ -n "${GITHUB_ACTION:-}" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Source the env files to pick up common variables. | ||
| if [ -f $HERE/env.sh ]; then | ||
| . $HERE/env.sh | ||
| fi | ||
| # PYTHON_BINARY or PYTHON_VERSION may be defined in test-env.sh. | ||
|
|
||
| # Get variables defined in test-env.sh. | ||
| if [ -f $HERE/test-env.sh ]; then | ||
| . $HERE/test-env.sh | ||
| fi | ||
|
|
||
| # Ensure dependencies are installed. | ||
| bash $HERE/install-dependencies.sh | ||
|
|
||
| # Get the appropriate UV_PYTHON. | ||
| . $ROOT/.evergreen/utils.sh | ||
|
|
||
| if [ -z "${PYTHON_BINARY:-}" ]; then | ||
| if [ -n "${PYTHON_VERSION:-}" ]; then | ||
| PYTHON_BINARY=$(get_python_binary $PYTHON_VERSION) | ||
| else | ||
| PYTHON_BINARY=$(find_python3) | ||
| # Handle the value for UV_PYTHON. | ||
| . $HERE/setup-uv-python.sh | ||
|
|
||
| # Only run the next part if not running on CI. | ||
| if [ -z "${CI:-}" ]; then | ||
| # Add the default install path to the path if needed. | ||
| if [ -z "${PYMONGO_BIN_DIR:-}" ]; then | ||
| export PATH="$PATH:$HOME/.local/bin" | ||
| fi | ||
|
|
||
| # Set up venv, making sure c extensions build unless disabled. | ||
| if [ -z "${NO_EXT:-}" ]; then | ||
| export PYMONGO_C_EXT_MUST_BUILD=1 | ||
| fi | ||
|
|
||
| ( | ||
| cd $ROOT && uv sync | ||
| ) | ||
|
|
||
| # Set up build utilities on Windows spawn hosts. | ||
| if [ -f $HOME/.visualStudioEnv.sh ]; then | ||
| set +u | ||
| SSH_TTY=1 source $HOME/.visualStudioEnv.sh | ||
| set -u | ||
| fi | ||
|
|
||
| # Only set up pre-commit if we are in a git checkout. | ||
| if [ -f $HERE/.git ]; then | ||
| if ! command -v pre-commit &>/dev/null; then | ||
| uv tool install pre-commit | ||
| fi | ||
| fi | ||
| export UV_PYTHON=${PYTHON_BINARY} | ||
| echo "Using python $UV_PYTHON" | ||
|
|
||
| # Add the default install path to the path if needed. | ||
| if [ -z "${PYMONGO_BIN_DIR:-}" ]; then | ||
| export PATH="$PATH:$HOME/.local/bin" | ||
| fi | ||
|
|
||
| # Set up venv, making sure c extensions build unless disabled. | ||
| if [ -z "${NO_EXT:-}" ]; then | ||
| export PYMONGO_C_EXT_MUST_BUILD=1 | ||
| fi | ||
| # Set up visual studio env on Windows spawn hosts. | ||
| if [ -f $HOME/.visualStudioEnv.sh ]; then | ||
| set +u | ||
| SSH_TTY=1 source $HOME/.visualStudioEnv.sh | ||
| set -u | ||
| if [ ! -f .git/hooks/pre-commit ]; then | ||
| uvx pre-commit install | ||
| fi | ||
| fi | ||
| fi | ||
| uv sync | ||
|
|
||
| echo "Setting up python environment... done." | ||
|
|
||
| popd > /dev/null |
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
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.
Intentional removal of
NO_EXT=1?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.
Yup, it is an improvement