Skip to content

Commit

Permalink
move python version setup
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Apr 25, 2019
1 parent 9bd0a19 commit 46de3a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
11 changes: 11 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 2 additions & 13 deletions ci/appveyor/install.ps1
Original file line number Diff line number Diff line change
@@ -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")
{
Expand Down

0 comments on commit 46de3a8

Please sign in to comment.