-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetupProj.bat
More file actions
30 lines (27 loc) · 997 Bytes
/
SetupProj.bat
File metadata and controls
30 lines (27 loc) · 997 Bytes
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
::@echo off
:: Check if UV is installed
if exist "C:\Users\%USERNAME%\.local\bin\uv.exe" GOTO :CreateVenv
:: If not then install it
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
:: Add the path to PATH
:: First check if it is run in cmd or powershell to provide the right command
:: Powershell automatically adds user-specific path in PSModulePath upon starting
echo %PSModulePath% | findstr /L %USERPROFILE% >NUL
IF %ERRORLEVEL% EQU 0 goto :ISPOWERSHELL
echo Not running from Powershell
SET Path=C:\Users\%USERNAME%\.local\bin;%Path%
GOTO :CreateVenv
:ISPOWERSHELL
$env:Path = "C:\Users\%USERNAME%\.local\bin;$env:Path"
:: Now invoke it to create a venv
:CreateVenv
uv venv --python 3.11.6
:: Activate the venv
CALL .venv/scripts/activate
:: Initialise project (create toml, etc), needed to create this template
uv init
:: Make the venv install everything from requirements.txt
uv add -r requirements.txt
pre-commit install
python get_spec.py
PAUSE