-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.bat
More file actions
88 lines (73 loc) · 2.44 KB
/
Copy pathsetup.bat
File metadata and controls
88 lines (73 loc) · 2.44 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@echo off
setlocal
:: ============================================================================
:: Setup Script for sup-toolbox
:: This script creates a virtual environment, activates it,
:: and installs the required packages.
:: ============================================================================
echo Checking for a Python virtual environment...
:: 1. Check if the 'venv' directory exists.
IF NOT EXIST "venv" (
echo Virtual environment not found. Creating a new one in '.\venv'...
:: Try to find python.exe. This assumes python is in the PATH.
python -m venv venv
:: Check if the venv creation was successful
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to create the virtual environment.
echo Please ensure Python 3.8+ is installed and available in your PATH.
pause
exit /b 1
)
echo Virtual environment created successfully.
) ELSE (
echo Found existing virtual environment.
)
echo.
echo Activating the virtual environment...
:: 2. Activate the virtual environment.
call ".\venv\Scripts\activate.bat"
:: Check if activation was successful by seeing if python.exe is now in the venv path
where python | findstr /I /C:"\venv\Scripts\python.exe" > nul
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to activate the virtual environment.
pause
exit /b 1
)
echo Environment activated. Python executable is now:
where python
echo.
:: ============================================================================
:: Install Python Packages
:: ============================================================================
echo Upgrading pip...
python.exe -m pip install --upgrade pip
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to upgrade pip.
pause
exit /b 1
)
echo.
echo Installing the sup-toolbox package in editable mode...
pip install -e .
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to install the project in editable mode.
pause
exit /b 1
)
echo.
echo Installing dependencies from requirements.txt...
pip install -r requirements.txt
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to install requirements.
pause
exit /b 1
)
echo.
echo ============================================================================
echo Setup complete!
echo The virtual environment is active. You can now run the CLI.
echo To deactivate, simply run 'deactivate' in this terminal.
echo ============================================================================
echo.
pause
endlocal