From efa62b206f87756e500bf7aee6f40ef44529e85f Mon Sep 17 00:00:00 2001 From: RonWang Date: Tue, 14 Apr 2020 15:28:16 -0700 Subject: [PATCH] fix: update python-pip build-flow's build powershell script --- lib/builtins/build-flows/python-pip/build.ps1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/builtins/build-flows/python-pip/build.ps1 b/lib/builtins/build-flows/python-pip/build.ps1 index 6e5a1804..c4adf648 100755 --- a/lib/builtins/build-flows/python-pip/build.ps1 +++ b/lib/builtins/build-flows/python-pip/build.ps1 @@ -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" } @@ -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" } @@ -159,4 +163,4 @@ Show-Log "###########################" Show-Log "Codebase built successfully" Show-Log "###########################" -exit 0 \ No newline at end of file +exit 0