-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.bat
More file actions
45 lines (35 loc) · 1.16 KB
/
init.bat
File metadata and controls
45 lines (35 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
setlocal enabledelayedexpansion
set "script_dir=%~dp0"
set "base_dir=%CD%\"
REM set "base_dir=%script_dir%"
REM This value will be used with UV to install corresponding python version, may be overriden by params.bat
set "USE_PYTHON_VER=3.14"
if exist "%script_dir%params.bat" (
echo Loading %script_dir%params.bat
call "%script_dir%params.bat"
)
set "py_dir=%base_dir%py_dist"
echo Using Python base directory: %py_dir%
echo Installing and upgrading python distribution and venv using UV
set "UV_COMPILE_BYTECODE=0"
set "UV_PYTHON_INSTALL_REGISTRY=0"
set "UV_PYTHON_BIN_DIR=%py_dir%\python_bin"
set "UV_PYTHON_INSTALL_DIR=%py_dir%\dists"
set "UV_TOOL_BIN_DIR=%py_dir%\tool_bin"
set "UV_TOOL_DIR=%py_dir%\tool"
set "UV_CACHE_DIR=%py_dir%\cache"
set "UV_LINK_MODE=copy"
uv python install --upgrade %USE_PYTHON_VER%
if %errorlevel% neq 0 exit /b %errorlevel%
set "venv_dir=%base_dir%venv"
echo Using venv directory: %venv_dir%
if not exist "%venv_dir%" (
uv venv "%venv_dir%"
if %errorlevel% neq 0 exit /b %errorlevel%
)
echo Cleaning up cache
RMDIR /S /Q "%py_dir%\cache"
echo Install complete
endlocal
pause