From adab65ac15e5d3c037d1564e2d54741e24807842 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Fri, 8 Aug 2014 16:37:44 +0200 Subject: [PATCH 1/4] Appveyor config --- appveyor.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..07abed0 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,36 @@ +environment: + matrix: + - PYTHON: "C:\\Python27" + PYTHON_VERSION: "2.7.8" + PYTHON_ARCH: "32" + TOX_ENV: "py27" + + - PYTHON: "C:\\Python33" + PYTHON_VERSION: "3.3.5" + PYTHON_ARCH: "32" + TOX_ENV: "py33" + + - PYTHON: "C:\\Python34" + PYTHON_VERSION: "3.4.1" + PYTHON_ARCH: "32" + TOX_ENV: "py34" + + +init: + - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" + +install: + - "appveyor/setup_build_env.cmd" + - "powershell appveyor/install.ps1" + +build: false # Not a C# project, build stuff at the test step instead. + +test_script: + - "%PYTHON%/Scripts/tox -e %TOX_ENV%" + +after_test: + - "%PYTHON%/python setup.py bdist_wheel" + - ps: "ls dist" + +artifacts: + - path: dist\* From 68a84a571b4c7d8eba2e509c7110dff7b5f0a93e Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Fri, 8 Aug 2014 17:19:22 +0200 Subject: [PATCH 2/4] Appveyor badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 296a1f3..929d3c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # changes [![Build Status](https://secure.travis-ci.org/michaeljoseph/changes.png)](http://travis-ci.org/michaeljoseph/changes) +[![Build status](https://ci.appveyor.com/api/projects/status/xy60i95qy7s83o91)](https://ci.appveyor.com/project/michaeljoseph/changes) [![Stories in Ready](https://badge.waffle.io/michaeljoseph/changes.png?label=ready)](https://waffle.io/michaeljoseph/changes) [![pypi version](https://badge.fury.io/py/changes.png)](http://badge.fury.io/py/changes) [![# of downloads](https://pypip.in/d/changes/badge.png)](https://crate.io/packages/changes?version=latest) From 07f0f9fedc0cfa029fdd9badde13c10d710f02e5 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Sun, 28 Sep 2014 19:35:15 +0200 Subject: [PATCH 3/4] Add appveyor build scripts --- appveyor/install.ps1 | 86 ++++++++++++++++++++++++++++++++++++ appveyor/setup_build_env.cmd | 16 +++++++ 2 files changed, 102 insertions(+) create mode 100644 appveyor/install.ps1 create mode 100644 appveyor/setup_build_env.cmd diff --git a/appveyor/install.ps1 b/appveyor/install.ps1 new file mode 100644 index 0000000..c84ba4f --- /dev/null +++ b/appveyor/install.ps1 @@ -0,0 +1,86 @@ +# Sample script to install Python and pip under Windows +# Authors: Olivier Grisel and Kyle Kastner +# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ + +$BASE_URL = "https://www.python.org/ftp/python/" +$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" +$GET_PIP_PATH = "C:\get-pip.py" + + +function DownloadPython ($python_version, $platform_suffix) { + $webclient = New-Object System.Net.WebClient + $filename = "python-" + $python_version + $platform_suffix + ".msi" + $url = $BASE_URL + $python_version + "/" + $filename + + $basedir = $pwd.Path + "\" + $filepath = $basedir + $filename + if (Test-Path $filename) { + Write-Host "Reusing" $filepath + return $filepath + } + + # Download and retry up to 5 times in case of network transient errors. + Write-Host "Downloading" $filename "from" $url + $retry_attempts = 3 + for($i=0; $i -lt $retry_attempts; $i++){ + try { + $webclient.DownloadFile($url, $filepath) + break + } + Catch [Exception]{ + Start-Sleep 1 + } + } + Write-Host "File saved at" $filepath + return $filepath +} + + +function InstallPython ($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 = "" + } else { + $platform_suffix = ".amd64" + } + $filepath = DownloadPython $python_version $platform_suffix + Write-Host "Installing" $filepath "to" $python_home + $args = "/qn /i $filepath TARGETDIR=$python_home" + Write-Host "msiexec.exe" $args + Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru + Write-Host "Python $python_version ($architecture) installation complete" + return $true +} + + +function InstallPip ($python_home) { + $pip_path = $python_home + "/Scripts/pip.exe" + $python_path = $python_home + "/python.exe" + if (-not(Test-Path $pip_path)) { + Write-Host "Installing pip..." + $webclient = New-Object System.Net.WebClient + $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) + Write-Host "Executing:" $python_path $GET_PIP_PATH + Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru + } else { + Write-Host "pip already installed." + } +} + +function InstallPackage ($python_home, $pkg) { + $pip_path = $python_home + "/Scripts/pip.exe" + & $pip_path install $pkg +} + +function main () { + InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON + InstallPip $env:PYTHON + InstallPackage $env:PYTHON tox + InstallPackage $env:PYTHON wheel +} + +main diff --git a/appveyor/setup_build_env.cmd b/appveyor/setup_build_env.cmd new file mode 100644 index 0000000..77fcbf6 --- /dev/null +++ b/appveyor/setup_build_env.cmd @@ -0,0 +1,16 @@ +:: To build extensions for 64 bit Python 3, we need to configure environment +:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: +:: MS Windows SDK for Windows 7 and .NET Framework 4 +:: +:: More details at: +:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows + +IF "%PYTHON_ARCH%"=="64" ( + ECHO Configuring environment to build with MSVC on a 64bit architecture + ECHO Using Windows SDK %WINDOWS_SDK_VERSION% + "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release + SET DISTUTILS_USE_SDK=1 + SET MSSdk=1 +) ELSE ( + ECHO Using default MSVC build environment for 32bit architecture +) From f1f3409a14a6cd1b474e7fa7455edff82cfeb085 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Sun, 5 Oct 2014 13:13:19 +0200 Subject: [PATCH 4/4] Symlinks on windows --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9ee9202..5434eca 100644 --- a/tox.ini +++ b/tox.ini @@ -2,5 +2,5 @@ envlist = py26, py27, pypy [testenv] -deps = -rrequirements.txt +deps = -rrequirements/dev.txt commands = py.test