-
-
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 all commits
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
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 |
---|---|---|
|
@@ -80,3 +80,4 @@ setup.cfg | |
.coverage | ||
.coverage.* | ||
cover/ | ||
__conda_version__.txt |
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ matrix: | |
- python: "nightly" | ||
|
||
before_install: | ||
- source tools/travis_tools.sh | ||
- source ci/travis/travis_tools.sh | ||
# Install into our own pristine virtualenv | ||
- virtualenv --python=python venv | ||
- source venv/bin/activate | ||
|
@@ -90,7 +90,7 @@ install: | |
fc-cache -f -v | ||
else | ||
# Use the special local version of freetype for testing | ||
cp .travis/setup.cfg . | ||
cp ci/travis/setup.cfg . | ||
fi; | ||
|
||
- pip install -e . | ||
|
@@ -130,10 +130,10 @@ after_success: | |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' && $BUILD_DOCS == true && $TRAVIS_BRANCH == 'master' ]]; then | ||
cd $TRAVIS_BUILD_DIR | ||
echo "Uploading documentation" | ||
openssl aes-256-cbc -K $encrypted_cc802e084cd0_key -iv $encrypted_cc802e084cd0_iv -in .travis/matplotlibDeployKey.enc -out .travis/matplotlibDeployKey -d | ||
openssl aes-256-cbc -K $encrypted_cc802e084cd0_key -iv $encrypted_cc802e084cd0_iv -in ci/travis/matplotlibDeployKey.enc -out ci/travis/matplotlibDeployKey -d | ||
eval `ssh-agent -s` | ||
chmod 600 .travis/matplotlibDeployKey | ||
ssh-add .travis/matplotlibDeployKey | ||
chmod 600 ci/travis/matplotlibDeployKey | ||
ssh-add ci/travis/matplotlibDeployKey | ||
cd .. | ||
git clone [email protected]:matplotlib/devdocs.git | ||
cd devdocs | ||
|
@@ -154,12 +154,12 @@ after_success: | |
[[ $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]] && \ | ||
[[ $TRAVIS_BRANCH == 'master' ]]; then | ||
cd $TRAVIS_BUILD_DIR | ||
python .travis/travis_after_all.py | ||
python ci/travis/travis_after_all.py | ||
export $(cat .to_export_back) | ||
if [ "$BUILD_LEADER" = "YES" ]; then | ||
if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then | ||
echo "All Succeeded! Triggering OSX build..." | ||
./.travis/build_children.sh | ||
./ci/travis/build_children.sh | ||
else | ||
echo "Some Failed; no OSX build" | ||
fi | ||
|
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,104 @@ | ||
# 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: "110" | ||
|
||
- PYTHON: "C:\\Python35_64" | ||
PYTHON_VERSION: "3.5" | ||
PYTHON_ARCH: "64" | ||
CONDA_PY: "35" | ||
CONDA_NPY: "110" | ||
|
||
- 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 tk 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 | ||
- 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 MPLBASEDIRLIST=%CONDA_DEFAULT_ENV%\Library\;. | ||
# 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' | ||
# 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 | ||
|
||
- path: result_images\* | ||
name: test result images | ||
type: zip |
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,95 @@ | ||
:: EXPECTED ENV VARS: PYTHON_ARCH (either x86 or x64) | ||
:: CONDA_PY (either 27, 33, 35 etc. - only major version is extracted) | ||
:: | ||
:: | ||
:: 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, and 64-bit builds for 3.5 and beyond, 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: Phil Elson | ||
:: Original Author: Olivier Grisel (https://github.com/ogrisel/python-appveyor-demo) | ||
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ | ||
:: | ||
:: Notes about batch files for Python people: | ||
:: | ||
:: Quotes in values are literally part of the values: | ||
:: SET FOO="bar" | ||
:: FOO is now five characters long: " b a r " | ||
:: If you don't want quotes, don't include them on the right-hand side. | ||
:: | ||
:: The CALL lines at the end of this file look redundant, but if you move them | ||
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y | ||
:: case, I don't know why. | ||
:: originally from https://github.com/pelson/Obvious-CI/blob/master/scripts/obvci_appveyor_python_build_env.cmd | ||
@ECHO OFF | ||
|
||
SET COMMAND_TO_RUN=%* | ||
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows | ||
|
||
:: Extract the major and minor versions, and allow for the minor version to be | ||
:: more than 9. This requires the version number to have two dots in it. | ||
SET MAJOR_PYTHON_VERSION=%CONDA_PY:~0,1% | ||
|
||
IF "%CONDA_PY:~2,1%" == "" ( | ||
:: CONDA_PY style, such as 27, 34 etc. | ||
SET MINOR_PYTHON_VERSION=%CONDA_PY:~1,1% | ||
) ELSE ( | ||
IF "%CONDA_PY:~3,1%" == "." ( | ||
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,1% | ||
) ELSE ( | ||
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,2% | ||
) | ||
) | ||
|
||
:: Based on the Python version, determine what SDK version to use, and whether | ||
:: to set the SDK for 64-bit. | ||
IF %MAJOR_PYTHON_VERSION% == 2 ( | ||
SET WINDOWS_SDK_VERSION="v7.0" | ||
SET SET_SDK_64=Y | ||
) ELSE ( | ||
IF %MAJOR_PYTHON_VERSION% == 3 ( | ||
SET WINDOWS_SDK_VERSION="v7.1" | ||
IF %MINOR_PYTHON_VERSION% LEQ 4 ( | ||
SET SET_SDK_64=Y | ||
) ELSE ( | ||
SET SET_SDK_64=N | ||
) | ||
) ELSE ( | ||
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" | ||
EXIT /B 1 | ||
) | ||
) | ||
|
||
IF "%PYTHON_ARCH%"=="64" ( | ||
IF %SET_SDK_64% == Y ( | ||
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 /B 1 | ||
) ELSE ( | ||
ECHO Using default MSVC build environment for 64 bit architecture | ||
ECHO Executing: %COMMAND_TO_RUN% | ||
call %COMMAND_TO_RUN% || EXIT /B 1 | ||
) | ||
) ELSE ( | ||
ECHO Using default MSVC build environment for 32 bit architecture | ||
ECHO Executing: %COMMAND_TO_RUN% | ||
call %COMMAND_TO_RUN% || EXIT /B 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,19 @@ | ||
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 MPLBASEDIRLIST=%LIBRARY_PREFIX%;. | ||
|
||
:: 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 |
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* | ||
|
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.