diff --git a/appveyor.yml b/appveyor.yml index a512851c75..08c939e5f3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,40 +1,41 @@ # CI on Windows via appveyor -# This file was based on pandas' and xarray's appveyor.yml -# This file was based on Olivier Grisel's python-appveyor-demo +# This file is based on MetPy's appveyor.yml environment: + CONDA_PATH: "C:\\Miniconda" + matrix: - - PYTHON: "C:\\Python27-conda32" - PYTHON_VERSION: "2.7" - PYTHON_ARCH: "32" + - PYTHON_VERSION: "2.7" + - PYTHON_VERSION: "3.4" + #- PYTHON_VERSION: "3.5" - - PYTHON: "C:\\Python34-conda64" - PYTHON_VERSION: "3.4" - PYTHON_ARCH: "64" +platform: + - x86 + - x64 install: - # Install miniconda Python - - "powershell ./ci/install_python.ps1" - - # Prepend newly installed Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + # Use the pre-installed Miniconda for the desired arch + - ps: if($env:PYTHON_VERSION -eq '3.5') + { $env:CONDA_PATH="$($env:CONDA_PATH)35" } + - ps: if($env:TARGET_ARCH -eq 'x64') + { $env:CONDA_PATH="$($env:CONDA_PATH)-x64" } + - ps: $env:path="$($env:CONDA_PATH);$($env:CONDA_PATH)\Scripts;$($env:CONDA_PATH)\Library\bin;C:\cygwin\bin;$($env:PATH)" + - cmd: conda config --set always_yes yes --set changeps1 no + - cmd: conda update -q conda + # Useful for debugging any issues with conda + - cmd: conda info -a # install depenencies - - "conda create -n test_env --yes --quiet python=%PYTHON_VERSION% pip numpy scipy=0.16.0 pandas nose pytz ephem numba" - - "activate test_env" - - "conda list" + - cmd: conda create -n test_env --yes --quiet python=%PYTHON_VERSION% pip numpy scipy=0.16.0 pandas nose pytest pytz ephem numba + - cmd: activate test_env + - cmd: python --version + - cmd: conda list # install pvlib - - "python setup.py install" + - cmd: pip install -e . build: false test_script: - - "py.test -v pvlib" + - cmd: py.test -v pvlib diff --git a/ci/install_python.ps1 b/ci/install_python.ps1 deleted file mode 100644 index 71b913ef20..0000000000 --- a/ci/install_python.ps1 +++ /dev/null @@ -1,93 +0,0 @@ -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -$MINICONDA_URL = "http://repo.continuum.io/miniconda/" -$BASE_URL = "https://www.python.org/ftp/python/" - - -function DownloadMiniconda ($python_version, $platform_suffix) { - $webclient = New-Object System.Net.WebClient - if ($python_version -like "3.*") { - $filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe" - } else { - $filename = "Miniconda2-latest-Windows-" + $platform_suffix + ".exe" - } - $url = $MINICONDA_URL + $filename - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 3 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - return $filepath -} - - -function InstallMiniconda ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "x86" - } else { - $platform_suffix = "x86_64" - } - $filepath = DownloadMiniconda $python_version $platform_suffix - Write-Host "Installing" $filepath "to" $python_home - $install_log = $python_home + ".log" - $args = "/S /D=$python_home" - Write-Host $filepath $args - Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - - -function InstallMinicondaPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $conda_path = $python_home + "\Scripts\conda.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $args = "install --yes pip" - Write-Host $conda_path $args - Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru - } else { - Write-Host "pip already installed." - } -} - - -function main () { - InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON - InstallMinicondaPip $env:PYTHON -} - -main diff --git a/docs/sphinx/source/whatsnew/v0.4.0.txt b/docs/sphinx/source/whatsnew/v0.4.0.txt index 8602ba79c7..618290693d 100644 --- a/docs/sphinx/source/whatsnew/v0.4.0.txt +++ b/docs/sphinx/source/whatsnew/v0.4.0.txt @@ -39,6 +39,8 @@ Other ~~~~~ * Switch to the py.test testing framework. (:issue:`204`) +* Reconfigure Appveyor CI builds and resolve an issue in which the command + line length was too long. (:issue:`207`) Code Contributors