32 lines
762 B
PowerShell
32 lines
762 B
PowerShell
# Create venv and install dependencies + imports
|
|
|
|
$webapi = Resolve-Path -Path "$PSScriptRoot\..\webapi"
|
|
$envPath = "$webapi\venv"
|
|
$python = "$envPath\Scripts\python.exe"
|
|
|
|
function LocalDevelopmentSetup() {
|
|
Set-Location $webapi
|
|
|
|
ClearPrevious
|
|
CreateEnv
|
|
InstallPips
|
|
}
|
|
|
|
function ClearPrevious() {
|
|
if (Test-Path -Path $envPath) {
|
|
Write-Host "Removing previous env: $envPath`n" -ForegroundColor DarkGreen
|
|
Remove-Item $envPath -Recurse -Force
|
|
}
|
|
}
|
|
|
|
function CreateEnv() {
|
|
Write-Host "Creating python env: $envPath`n" -ForegroundColor DarkGreen
|
|
& 'python' -m venv $envPath
|
|
}
|
|
|
|
function InstallPips() {
|
|
& $python -m pip install --upgrade pip
|
|
& $python -m pip install -r requirements_dev.txt
|
|
}
|
|
|
|
LocalDevelopmentSetup |