File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ @ echo off
2+ setlocal enabledelayedexpansion
3+
4+ set " script_dir = %~dp0 "
5+ set " base_dir = %CD% \"
6+ REM set "base_dir=%script_dir%"
7+
8+ REM This value will be used with UV to install corresponding python version, may be overriden by params.bat
9+ set " USE_PYTHON_VER = 3.14"
10+
11+ if exist " %script_dir% params.bat" (
12+ echo Loading %script_dir% params.bat
13+ call " %script_dir% params.bat"
14+ )
15+
16+ set " py_dir = %base_dir% py_dist"
17+ echo Using Python base directory: %py_dir%
18+
19+ echo Installing and upgrading python distribution and venv using UV
20+ set " UV_COMPILE_BYTECODE = 0"
21+ set " UV_PYTHON_INSTALL_REGISTRY = 0"
22+ set " UV_PYTHON_BIN_DIR = %py_dir% \python_bin"
23+ set " UV_PYTHON_INSTALL_DIR = %py_dir% \dists"
24+ set " UV_TOOL_BIN_DIR = %py_dir% \tool_bin"
25+ set " UV_TOOL_DIR = %py_dir% \tool"
26+ set " UV_CACHE_DIR = %py_dir% \cache"
27+ set " UV_LINK_MODE = copy"
28+
29+ uv python install --upgrade %USE_PYTHON_VER%
30+ if %errorlevel% neq 0 exit /b %errorlevel%
31+
32+ set " venv_dir = %base_dir% venv"
33+ echo Using venv directory: %venv_dir%
34+
35+ if not exist " %venv_dir% " (
36+ uv venv " %venv_dir% "
37+ if %errorlevel% neq 0 exit /b %errorlevel%
38+ )
39+
40+ echo Cleaning up cache
41+ RMDIR /S /Q " %py_dir% \cache"
42+
43+ echo Install complete
44+ endlocal
45+ pause
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ script_dir=" $( cd " $( dirname " $0 " ) " && pwd) "
5+ venv_dir=" $script_dir /venv"
6+ echo " Using venv directory: $venv_dir "
7+
8+ if [[ ! -d " $venv_dir " ]]; then
9+ python3 -m venv " $venv_dir "
10+ fi
11+
12+ echo " Install complete"
Original file line number Diff line number Diff line change @@ -5,10 +5,14 @@ set "script_dir=%~dp0"
55set " venv_dir = %script_dir% venv"
66
77if not exist " %venv_dir% " (
8- python3 -m venv " %venv_dir% "
9- " %venv_dir% \Scripts\python" -m pip --require-virtualenv install --upgrade pip build
8+ echo No venv directory found, run init.bat to initialize it...
9+ pause
10+ exit /b 1
1011)
1112
13+ echo Activating venv
14+ call " %venv_dir% \Scripts\activate.bat"
15+
1216" %venv_dir% \Scripts\python" %*
1317
1418endlocal
Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ script_dir="$(cd "$(dirname "$0")" && pwd)"
55venv_dir=" $script_dir /venv"
66
77if [[ ! -d " $venv_dir " ]]; then
8- python3 -m venv " $venv_dir "
9- " $venv_dir /bin/python " -m pip --require-virtualenv install --upgrade pip build
8+ echo " virtual env missing, run init.sh first! "
9+ exit 1
1010fi
1111
12+ . " $venv_dir /bin/activate"
13+
1214" $venv_dir /bin/python" " $@ "
You can’t perform that action at this time.
0 commit comments