|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param( |
|
[Parameter(Mandatory = $true)] |
|
[string] $VenvName, |
|
|
|
[Parameter(Mandatory = $true)] |
|
[string] $RepoRoot |
|
) |
|
|
|
$venvPath = Join-Path $RepoRoot $VenvName |
|
if (!(Test-Path $venvPath)) { |
|
Write-Host "Creating virtual environment '$VenvName'." |
|
python -m pip install virtualenv==20.25.1 |
|
python -m virtualenv "$venvPath" |
|
Write-Host "Virtual environment '$VenvName' created." |
|
Write-Host "##vso[task.setvariable variable=$($VenvName)_LOCATION]$venvPath" |
|
Write-Host "##vso[task.setvariable variable=$($VenvName)_ACTIVATION_SCRIPT]if(`$IsWindows){. $venvPath/Scripts/Activate.ps1;}else {. $venvPath/bin/activate.ps1}" |
|
} |
|
else { |
|
Write-Host "Virtual environment '$VenvName' already exists. Skipping creation." |
|
} |
|
|