-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
WIP: testing on windows and conda packages/ wheels for master #5604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
87c968b
Do not run Windows' file system convert tool
cgohlke a30ec66
On Windows, initialize the animation.convert_path setting from the Re…
cgohlke 94d9075
BLD: add conda patch to generate a version file
jankatins 3aa9eed
BLD: Include conda dirs in basedir
jankatins d53f902
BLD: Add a way to influence basedirs with env vars
jankatins 659ce45
BLD: use patched bdist_wheel
jankatins 5a7e3b4
CI: test in windows and build packages
jankatins aa4d19c
BLD: Cleanup env vars after basedir change
jankatins 5ac3044
BLD: also find newer freetype
jankatins da4a603
BLD: Find tcl/tk on conda windows
jankatins 99e71f7
CI: Enable tk again
jankatins cdca879
CI: move travis files to one directory under ci
jankatins 52a198e
CI: make result_images available on appveyor
jankatins 1179df7
TST: workaround for windows
jankatins b32f9c1
CI: enable py3.5 builds on windows and switch to NP1.10
jankatins ec6330b
Merge remote-tracking branch 'origin/pr/5460' into HEAD
jankatins 1d1660f
TST: better workaround for NamedTempfile problem on windows
jankatins 14fcb76
CI: use default env vars on py35
jankatins 3d942f7
CI: replace the run_with_env.cmd script
jankatins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
CI: test in windows and build packages
This builds windows conda packages and wheels for some python versions and runs the tests on these python versions on windows. It uses the AppVeyor CI servive and the packages are available as artefacts to download. Appveyor based on http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/ https://packaging.python.org/en/latest/appveyor/ https://github.com/rmcgibbo/python-appveyor-conda-example Conda stuff based on https://github.com/conda/conda-recipes/tree/master/matplotlib ...and a lot of trial and error...
- Loading branch information
commit 5a7e3b47816ee1abccc3cca6bb9a25bce8448cd6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# With infos from | ||
# http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/ | ||
# https://packaging.python.org/en/latest/appveyor/ | ||
# https://github.com/rmcgibbo/python-appveyor-conda-example | ||
|
||
# Backslashes in quotes need to be escaped: \ -> "\\" | ||
|
||
environment: | ||
|
||
global: | ||
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the | ||
# /E:ON and /V:ON options are not enabled in the batch script intepreter | ||
# See: http://stackoverflow.com/a/13751649/163740 | ||
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\appveyor\\run_with_env.cmd" | ||
|
||
matrix: | ||
- PYTHON: "C:\\Python34_64" | ||
PYTHON_VERSION: "3.4" | ||
PYTHON_ARCH: "64" | ||
CONDA_PY: "34" | ||
CONDA_NPY: "18" | ||
|
||
- PYTHON: "C:\\Python27_64" | ||
PYTHON_VERSION: "2.7" | ||
PYTHON_ARCH: "64" | ||
CONDA_PY: "27" | ||
CONDA_NPY: "18" | ||
|
||
- PYTHON: "C:\\Python27_32" | ||
PYTHON_VERSION: "2.7" | ||
PYTHON_ARCH: "32" | ||
CONDA_PY: "27" | ||
CONDA_NPY: "18" | ||
|
||
# We always use a 64-bit machine, but can build x86 distributions | ||
# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV). | ||
platform: | ||
- x64 | ||
|
||
# all our python builds have to happen in tests_script... | ||
build: false | ||
|
||
init: | ||
- "ECHO %PYTHON_VERSION% %PYTHON%" | ||
|
||
install: | ||
- powershell .\ci\appveyor\install.ps1 | ||
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% | ||
- cmd: conda config --set show_channel_urls yes | ||
# for msinttypes | ||
- cmd: conda config --add channels conda-forge | ||
# this is now the downloaded conda... | ||
- conda info -a | ||
# same things as in tools/conda_recipe | ||
- cmd: conda create -y -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype=2.5 msinttypes pyparsing pytz tornado libpng zlib pyqt cycler nose mock | ||
- activate test-environment | ||
# This is needed for the installer to find the dlls... | ||
- set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\Library\lib | ||
- dir %LIBRARY_LIB% | ||
- cmd: 'mkdir lib || cmd /c "exit /b 0"' | ||
- copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib | ||
- copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib | ||
- set LIB=%LIBRARY_LIB%;.\lib | ||
- set LIBPATH=%LIBRARY_LIB%;.\lib | ||
- set LIB_INC=%CONDA_DEFAULT_ENV%\Library\include | ||
- set INCLUDE=%LIB_INC%;%LIB_INC%\freetype2;WhateverInclude | ||
- set CPLUS_INCLUDE_PATH=%LIB_INC%\freetype2;%LIB_INC%;WhateverCPLUS | ||
- dir %LIB_INC% | ||
- dir %LIB_INC%\freetype2 | ||
# Show the installed packages + versions | ||
- conda list | ||
|
||
test_script: | ||
# Now build the thing.. | ||
- '%CMD_IN_ENV% python setup.py develop' | ||
# tests | ||
# for now, just let them pass to get the after_test parts... | ||
- python tests.py || cmd /c "exit /b 0" | ||
|
||
after_test: | ||
# After the tests were a success, build packages (wheels and conda) | ||
|
||
# There is a bug in wheels which prevents building wheels when the package uses namespaces | ||
- cmd: '%CMD_IN_ENV% python setup.py bdist_wheel' | ||
# Note also that our setup.py script, which is called by conda-build, writes | ||
# a __conda_version__.txt file, so the version number on the binary package | ||
# is set dynamically. This unfortunately mean that conda build --output | ||
# doesn't really work. | ||
- cmd: '%CMD_IN_ENV% conda config --get channels' | ||
# These vars get included in the conda env, so cleanup out current conda env | ||
- set LIB= | ||
- set LIBPATH= | ||
- set INCLUDE= | ||
- set LIB_INC= | ||
- set | ||
# we can't build conda packages on 27 due to missing functools32, which is a recent | ||
# additional dependency for matplotlib | ||
- cmd: if [%CONDA_PY%] NEQ [27] %CMD_IN_ENV% conda build .\ci\conda_recipe | ||
# Move the conda package into the dist directory, to register it | ||
# as an "artifact" for Appveyor. | ||
- cmd: 'copy /Y %PYTHON%\conda-bld\win-32\*.bz2 dist || cmd /c "exit /b 0"' | ||
- cmd: 'copy /Y %PYTHON%\conda-bld\win-64\*.bz2 dist || cmd /c "exit /b 0"' | ||
- cmd: dir .\dist\ | ||
|
||
artifacts: | ||
- path: dist\* | ||
name: packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Sample script to install Miniconda under Windows | ||
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon | ||
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
$MINICONDA_URL = "http://repo.continuum.io/miniconda/" | ||
|
||
|
||
function DownloadMiniconda ($python_version, $platform_suffix) { | ||
$webclient = New-Object System.Net.WebClient | ||
if ($python_version -match "3.4") { | ||
$filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe" | ||
} else { | ||
$filename = "Miniconda-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 -match "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 InstallCondaPackages ($python_home, $spec) { | ||
$conda_path = $python_home + "\Scripts\conda.exe" | ||
$args = "install --yes " + $spec | ||
Write-Host ("conda " + $args) | ||
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru | ||
} | ||
|
||
function UpdateConda ($python_home) { | ||
$conda_path = $python_home + "\Scripts\conda.exe" | ||
Write-Host "Updating conda..." | ||
$args = "update --yes conda" | ||
Write-Host $conda_path $args | ||
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru | ||
} | ||
|
||
|
||
function main () { | ||
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON | ||
UpdateConda $env:PYTHON | ||
InstallCondaPackages $env:PYTHON "conda-build jinja2 anaconda-client" | ||
} | ||
|
||
main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
:: 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 (SDK v7.1) | ||
:: | ||
:: To build extensions for 64 bit Python 2, we need to configure environment | ||
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: | ||
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) | ||
:: | ||
:: 32 bit builds do not require specific environment configurations. | ||
:: | ||
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the | ||
:: cmd interpreter, at least for (SDK v7.0) | ||
:: | ||
:: More details at: | ||
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows | ||
:: http://stackoverflow.com/a/13751649/163740 | ||
:: | ||
:: Author: Olivier Grisel | ||
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ | ||
@ECHO OFF | ||
|
||
SET COMMAND_TO_RUN=%* | ||
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows | ||
|
||
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" | ||
IF %MAJOR_PYTHON_VERSION% == "2" ( | ||
SET WINDOWS_SDK_VERSION="v7.0" | ||
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" ( | ||
SET WINDOWS_SDK_VERSION="v7.1" | ||
) ELSE ( | ||
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" | ||
EXIT 1 | ||
) | ||
|
||
IF "%PYTHON_ARCH%"=="64" ( | ||
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture | ||
SET DISTUTILS_USE_SDK=1 | ||
SET MSSdk=1 | ||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% | ||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release | ||
ECHO Executing: %COMMAND_TO_RUN% | ||
call %COMMAND_TO_RUN% || EXIT 1 | ||
) ELSE ( | ||
ECHO Using default MSVC build environment for 32 bit architecture | ||
ECHO Executing: %COMMAND_TO_RUN% | ||
call %COMMAND_TO_RUN% || EXIT 1 | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# conda package | ||
|
||
Up to now, this is mainly used to build a test conda package on windows on appveyor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
mkdir lib | ||
copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib | ||
if errorlevel 1 exit 1 | ||
copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib | ||
if errorlevel 1 exit 1 | ||
|
||
set LIB=%LIB%;.\lib | ||
set LIBPATH=%LIBPATH%;.\lib | ||
set INCLUDE=%LIBRARY_INC%;%LIBRARY_INC%\freetype2;%INCLUDE% | ||
|
||
:: debug... | ||
set | ||
|
||
copy setup.cfg.template setup.cfg | ||
if errorlevel 1 exit 1 | ||
|
||
python setup.py install | ||
if errorlevel 1 exit 1 | ||
|
||
rd /s /q %SP_DIR%\dateutil | ||
rd /s /q %SP_DIR%\numpy | ||
|
||
if "%ARCH%"=="64" ( | ||
set PLAT=win-amd64 | ||
) else ( | ||
set PLAT=win32 | ||
) | ||
|
||
::copy C:\Tcl%ARCH%\bin\t*.dll %SP_DIR%\matplotlib-%PKG_VERSION%-py%PY_VER%-%PLAT%.egg\matplotlib\backends |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
if [ `uname` == Linux ]; then | ||
pushd $PREFIX/lib | ||
ln -s libtcl8.5.so libtcl.so | ||
ln -s libtk8.5.so libtk.so | ||
popd | ||
fi | ||
|
||
if [ `uname` == Darwin ]; then | ||
sed s:'#ifdef WITH_NEXT_FRAMEWORK':'#if 1':g -i src/_macosx.m | ||
fi | ||
|
||
cp setup.cfg.template setup.cfg || exit 1 | ||
|
||
sed s:/usr/local:$PREFIX:g -i setupext.py | ||
|
||
$PYTHON setup.py install | ||
|
||
rm -rf $SP_DIR/PySide | ||
rm -rf $SP_DIR/__pycache__ | ||
rm -rf $PREFIX/bin/nose* | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git setup.cfg.template setup.cfg.template | ||
index ba4cde3..8d8b7c5 100644 | ||
--- setup.cfg.template | ||
+++ setup.cfg.template | ||
@@ -63,7 +63,7 @@ | ||
#macosx = auto | ||
#pyside = auto | ||
#qt4agg = auto | ||
-#tkagg = auto | ||
+tkagg = True | ||
#windowing = auto | ||
#wxagg = auto | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git setup.cfg.template setup.cfg.template | ||
index 09fd92f..2085832 100644 | ||
--- setup.cfg.template | ||
+++ setup.cfg.template | ||
@@ -18,7 +18,7 @@ | ||
# optional. They are all installed by default, but they may be turned | ||
# off here. | ||
# | ||
-#tests = True | ||
+tests = False | ||
#sample_data = True | ||
#toolkits = True | ||
# Tests for the toolkits are only automatically installed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff --git setup.cfg.template setup.cfg.template | ||
index 8af8b6d..4e4f9d2 100644 | ||
--- setup.cfg.template | ||
+++ setup.cfg.template | ||
@@ -78,5 +78,5 @@ | ||
# if you have disabled the relevent extension modules. Agg will be used | ||
# by default. | ||
# | ||
-#backend = Agg | ||
+backend = Qt4Agg | ||
# |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given you're already adding this, it would make some sense to rationalise the install and
run_with_env
code by using the ObviousCI version provided.