File tree Expand file tree Collapse file tree 6 files changed +53
-23
lines changed
Expand file tree Collapse file tree 6 files changed +53
-23
lines changed Original file line number Diff line number Diff line change 2525 exit 1
2626fi
2727
28+ . $ROOT /.evergreen/utils.sh
29+ UV=$( get_uv)
30+
2831# List the packages.
29- uv sync ${UV_ARGS} --reinstall
30- uv pip list
32+ $UV sync ${UV_ARGS} --reinstall
33+ $UV pip list
3134
3235# Ensure we go back to base environment after the test.
3336trap " uv sync" EXIT HUP
3437
3538# Start the test runner.
36- uv run ${UV_ARGS} .evergreen/scripts/run_tests.py " $@ "
39+ $UV run ${UV_ARGS} .evergreen/scripts/run_tests.py " $@ "
3740
3841popd
Original file line number Diff line number Diff line change @@ -38,6 +38,22 @@ function _pip_install() {
3838}
3939
4040
41+ # Try to use the binaries in the toolchain if available.
42+ if [ -n " ${CI} " ]; then
43+ export PATH
44+ case " ${OSTYPE:? } " in
45+ cygwin)
46+ PATH=" /cygdrive/c/Python/Current/Scripts:${PATH:- } "
47+ ;;
48+ darwin* )
49+ PATH=" /Library/Frameworks/Python.Framework/Versions/Current/bin:${PATH:- } "
50+ ;;
51+ * )
52+ PATH=" /opt/python/Current/bin:${PATH:- } "
53+ ;;
54+ esac
55+ fi
56+
4157# Ensure just is installed.
4258if ! command -v just > /dev/null 2>&1 ; then
4359 # On most systems we can install directly.
Original file line number Diff line number Diff line change @@ -10,4 +10,7 @@ if [ -f $HERE/env.sh ]; then
1010 source $HERE /env.sh
1111fi
1212
13- uv run $HERE /run_server.py " $@ "
13+ . $ROOT /.evergreen/utils.sh
14+ UV=$( get_uv)
15+
16+ $UV run $HERE /run_server.py " $@ "
Original file line number Diff line number Diff line change @@ -16,22 +16,6 @@ if [ -f $HERE/test-env.sh ]; then
1616 . $HERE /test-env.sh
1717fi
1818
19- # Try to use the binaries in the toolchain if available.
20- if [ -n " ${CI} " ]; then
21- export PATH
22- case " ${OSTYPE:? } " in
23- cygwin)
24- PATH=" /cygdrive/c/Python/Current:${PATH:- } "
25- ;;
26- darwin* )
27- PATH=" /Library/Frameworks/Python.Framework/Versions/Current/bin:${PATH:- } "
28- ;;
29- * )
30- PATH=" /opt/python/Current/bin:${PATH:- } "
31- ;;
32- esac
33- fi
34-
3519# Ensure dependencies are installed.
3620bash $HERE /install-dependencies.sh
3721
@@ -63,13 +47,15 @@ if [ -f $HOME/.visualStudioEnv.sh ]; then
6347 SSH_TTY=1 source $HOME /.visualStudioEnv.sh
6448 set -u
6549fi
66- uv sync --frozen
50+
51+ UV=$( get_uv)
52+ $UV sync --frozen
6753
6854echo " Setting up python environment... done."
6955
7056# Ensure there is a pre-commit hook if there is a git checkout.
7157if [ -d .git ] && [ ! -f .git/hooks/pre-commit ]; then
72- uv run --frozen pre-commit install
58+ $UV run --frozen pre-commit install
7359fi
7460
7561popd > /dev/null
Original file line number Diff line number Diff line change @@ -20,4 +20,7 @@ if [ -f $SCRIPT_DIR/env.sh ]; then
2020 source $SCRIPT_DIR /env.sh
2121fi
2222
23- uv run $SCRIPT_DIR /setup_tests.py " $@ "
23+ . $ROOT /.evergreen/utils.sh
24+ UV=$( get_uv)
25+
26+ $UV run $SCRIPT_DIR /setup_tests.py " $@ "
Original file line number Diff line number Diff line change @@ -138,3 +138,22 @@ get_python_binary() {
138138 return 1
139139 fi
140140}
141+
142+
143+ # Get the appropriate uv binary.
144+ get_uv () {
145+ # Try to use the binaries in the toolchain if available.
146+ if [ -f " /cygdrive/c/Python/Current/Scripts/uv.exe" ]; then
147+ echo " /cygdrive/c/Python/Current/Scripts/uv.exe"
148+ return
149+ fi
150+ if [ -f " /Library/Frameworks/Python.Framework/Versions/Current/bin/uv" ]; then
151+ echo " /Library/Frameworks/Python.Framework/Versions/Current/bin/uv"
152+ return
153+ fi
154+ if [ -f " /opt/python/Current/bin" ]; then
155+ echo " /opt/python/Current/bin/uv"
156+ return
157+ fi
158+ echo " $( which uv) "
159+ }
You can’t perform that action at this time.
0 commit comments