From 46de3a8b8a8b5faadbc15b7e43dec51600f7d1df Mon Sep 17 00:00:00 2001 From: skoudoro Date: Wed, 5 Dec 2018 15:07:51 -0500 Subject: [PATCH] move python version setup --- appveyor.yml | 11 +++++++++++ ci/appveyor/install.ps1 | 15 ++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 865cc8b88..eecc706e5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,6 +38,17 @@ install: throw "There are newer queued builds for this pull request, failing early." } # Headless trick - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1')) + # Setup some environment variable + - ps: $env:Path = "$env:PYTHON;$env:PYTHON\\Scripts;$env:Path" + # Check that we have the expected version and architecture for Python + - ps: Invoke-Expression "python --version" + + - ps: $env:PYTHON_ARCH = (Invoke-Expression "python -c 'import struct; print(struct.calcsize("P") * 8)'") | Out-String + - ps: $env:PYTHON_VERSION = (Invoke-Expression "python -c 'import platform;print(platform.python_version())'") | Out-String + + - ps: Write-Host "Python version = " + $env:PYTHON_VERSION + - ps: Write-Host "Python architecture = " + $env:PYTHON_ARCH + - "%CMD_IN_ENV% powershell ./ci/appveyor/install.ps1" build: false # Not a C# project, build stuff at the test step instead. diff --git a/ci/appveyor/install.ps1 b/ci/appveyor/install.ps1 index c6428a174..99262d832 100644 --- a/ci/appveyor/install.ps1 +++ b/ci/appveyor/install.ps1 @@ -1,20 +1,9 @@ # Powershell Install script -# Setup some environment variable -$env:Path = "$env:PYTHON;$env:PYTHON\\Scripts;$env:Path" -$env:PIPI = "pip install $env:EXTRA_PIP_FLAGS" +$env:PIPI = "pip install $env:EXTRA_PIP_FLAGS" # Print and check this environment variable -Write-Host $env:PIPI - -# Check that we have the expected version and architecture for Python -Invoke-Expression "python --version" - -$env:PYTHON_ARCH = (Invoke-Expression "python -c 'import struct; print(struct.calcsize("P") * 8)'") | Out-String -$env:PYTHON_VERSION = (Invoke-Expression "python -c 'import platform;print(platform.python_version())'") | Out-String - -Write-Host "Python version: " + $env:PYTHON_VERSION -Write-Host "Python architecture: " + $env:PYTHON_ARCH +Write-Host "Pip command: " + $env:PIPI if($env:PYTHON -match "conda") {