Skip to content

Commit

Permalink
fix: update python-pip build-flow's build powershell script
Browse files Browse the repository at this point in the history
  • Loading branch information
RonWang committed Apr 15, 2020
1 parent 6e4e02e commit efa62b2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/builtins/build-flows/python-pip/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ function New-Py3Venv() {
param()

begin {
Write-Log "Creating virtualenv using python3 venv."
Show-Log "Creating virtualenv using python3 venv."
}
process {
Invoke-Expression -Command "python3 -m venv venv"
$PythonVersion = & python -V 2>&1
if($PythonVersion -match "2\.\d\.\d+") {
Show-Log "Current python ($PythonVersion) is not supported. Please make sure you are using python3, or use your custom script to build the code." "Error"
}
Invoke-Expression -Command "python -m venv venv"
if(!($LASTEXITCODE -eq 0)) {
Show-Log "Failed to create python virtual environment using venv." "Error"
}
Expand All @@ -104,7 +108,7 @@ function Install-Dependencies() {
Show-Log "Installing skill dependencies based on the requirements.txt."
}
process {
$DepCmd = "./venv/bin/pip --disable-pip-version-check install -r requirements.txt -t ./"
$DepCmd = "venv/Scripts/pip3 --disable-pip-version-check install -r requirements.txt -t ./"
if (-not $Verbose) {
$DepCmd += " -qq"
}
Expand Down Expand Up @@ -159,4 +163,4 @@ Show-Log "###########################"
Show-Log "Codebase built successfully"
Show-Log "###########################"

exit 0
exit 0

0 comments on commit efa62b2

Please sign in to comment.