Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 943f8bf

Browse filesBrowse files
committed
CI: test in windows and build packages
1 parent 238de49 commit 943f8bf
Copy full SHA for 943f8bf
Expand file treeCollapse file tree

17 files changed

+635
-170
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
-170Lines changed: 0 additions & 170 deletions
This file was deleted.

‎appveyor.yml

Copy file name to clipboard
+96Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# With infos from
2+
# http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/
3+
# https://packaging.python.org/en/latest/appveyor/
4+
# https://github.com/rmcgibbo/python-appveyor-conda-example
5+
6+
7+
environment:
8+
9+
global:
10+
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
11+
# /E:ON and /V:ON options are not enabled in the batch script intepreter
12+
# See: http://stackoverflow.com/a/13751649/163740
13+
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\appveyor\\run_with_env.cmd"
14+
15+
matrix:
16+
- PYTHON: "C:\\Python35_64"
17+
PYTHON_VERSION: "3.5"
18+
PYTHON_ARCH: "64"
19+
CONDA_PY: "35"
20+
CONDA_NPY: "18"
21+
22+
- PYTHON: "C:\\Python27_32"
23+
PYTHON_VERSION: "2.7"
24+
PYTHON_ARCH: "32"
25+
CONDA_PY: "27"
26+
CONDA_NPY: "18"
27+
28+
# We always use a 64-bit machine, but can build x86 distributions
29+
# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV).
30+
platform:
31+
- x64
32+
33+
# all our python builds have to happen in tests_script...
34+
build: false
35+
36+
init:
37+
- "ECHO %PYTHON_VERSION% %MINICONDA%"
38+
39+
install:
40+
- powershell .\\ci\\appveyor\\install.ps1
41+
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
42+
- cmd: conda config --set show_channel_urls yes
43+
# for msinttypes
44+
- cmd: conda config --add channels conda-forge
45+
# this is now the downloaded conda...
46+
- conda info -a
47+
# same things as in tools/conda_recipe
48+
- cmd: conda create -y -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype=2.4 msinttypes pyparsing pytz tornado libpng zlib pyqt cycler nose mock
49+
- activate test-environment
50+
# This is needed for the installer to find the dlls...
51+
- set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\\Library\\lib
52+
- dir %LIBRARY_LIB%
53+
- cmd: 'mkdir lib || cmd /c "exit /b 0"'
54+
- copy %LIBRARY_LIB%\\zlibstatic.lib lib\\z.lib
55+
- copy %LIBRARY_LIB%\\libpng_static.lib lib\\png.lib
56+
- set LIB=%LIBRARY_LIB%;.\lib
57+
- set LIBPATH=%LIBRARY_LIB%;.\lib
58+
# the ; is needed as without the path gets a space in the end which lets the test for freetfail
59+
- set INCLUDE=%CONDA_DEFAULT_ENV%\\Library\\include;
60+
- set CPLUS_INCLUDE_PATH=%INCLUDE%
61+
- dir %INCLUDE%
62+
# Show the installed packages + versions
63+
- conda list
64+
65+
test_script:
66+
# Now build the thing..
67+
- cmd: echo no install...
68+
#- pip install -e .
69+
# tests
70+
# for now, just let them pass to get the after_test parts...
71+
# - 'python tests.py || cmd /c "exit /b 0"'
72+
73+
after_test:
74+
# After the tests were a success, build packages (wheels and conda)
75+
76+
# There is a bug in wheels which prevents building wheels when the package uses namespaces
77+
#- cmd: '%CMD_IN_ENV% python setup.py bdist_wheel'
78+
# Note also that our setup.py script, which is called by conda-build, writes
79+
# a __conda_version__.txt file, so the version number on the binary package
80+
# is set dynamically. This unfortunately mean that conda build --output
81+
# doesn't really work.
82+
- cmd: '%CMD_IN_ENV% conda config --get channels'
83+
# These three vars get included in the conda env, so cleanup out current conda env
84+
- set LIB=
85+
- set LIBPATH=
86+
- set INCLUDE=
87+
- set
88+
- cmd: '%CMD_IN_ENV% conda build .\\ci\\conda_recipe'
89+
# Move the conda package into the dist directory, to register it
90+
# as an "artifact" for Appveyor.
91+
- cmd: 'copy /Y %PYTHON%\conda-bld\win-32\*.bz2 dist || cmd /c "exit /b 0"'
92+
- cmd: 'copy /Y %PYTHON%\conda-bld\win-64\*.bz2 dist || cmd /c "exit /b 0"'
93+
94+
artifacts:
95+
- path: dist\*
96+
name: packages

‎ci/appveyor/install.ps1

Copy file name to clipboard
+96Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Sample script to install Miniconda under Windows
2+
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon
3+
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
4+
5+
$MINICONDA_URL = "http://repo.continuum.io/miniconda/"
6+
7+
8+
function DownloadMiniconda ($python_version, $platform_suffix) {
9+
$webclient = New-Object System.Net.WebClient
10+
if ($python_version -match "3.4") {
11+
$filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe"
12+
} else {
13+
$filename = "Miniconda-latest-Windows-" + $platform_suffix + ".exe"
14+
}
15+
$url = $MINICONDA_URL + $filename
16+
17+
$basedir = $pwd.Path + "\"
18+
$filepath = $basedir + $filename
19+
if (Test-Path $filename) {
20+
Write-Host "Reusing" $filepath
21+
return $filepath
22+
}
23+
24+
# Download and retry up to 3 times in case of network transient errors.
25+
Write-Host "Downloading" $filename "from" $url
26+
$retry_attempts = 2
27+
for($i=0; $i -lt $retry_attempts; $i++){
28+
try {
29+
$webclient.DownloadFile($url, $filepath)
30+
break
31+
}
32+
Catch [Exception]{
33+
Start-Sleep 1
34+
}
35+
}
36+
if (Test-Path $filepath) {
37+
Write-Host "File saved at" $filepath
38+
} else {
39+
# Retry once to get the error message if any at the last try
40+
$webclient.DownloadFile($url, $filepath)
41+
}
42+
return $filepath
43+
}
44+
45+
46+
function InstallMiniconda ($python_version, $architecture, $python_home) {
47+
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
48+
if (Test-Path $python_home) {
49+
Write-Host $python_home "already exists, skipping."
50+
return $false
51+
}
52+
if ($architecture -match "32") {
53+
$platform_suffix = "x86"
54+
} else {
55+
$platform_suffix = "x86_64"
56+
}
57+
58+
$filepath = DownloadMiniconda $python_version $platform_suffix
59+
Write-Host "Installing" $filepath "to" $python_home
60+
$install_log = $python_home + ".log"
61+
$args = "/S /D=$python_home"
62+
Write-Host $filepath $args
63+
Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru
64+
if (Test-Path $python_home) {
65+
Write-Host "Python $python_version ($architecture) installation complete"
66+
} else {
67+
Write-Host "Failed to install Python in $python_home"
68+
Get-Content -Path $install_log
69+
Exit 1
70+
}
71+
}
72+
73+
74+
function InstallCondaPackages ($python_home, $spec) {
75+
$conda_path = $python_home + "\Scripts\conda.exe"
76+
$args = "install --yes " + $spec
77+
Write-Host ("conda " + $args)
78+
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
79+
}
80+
81+
function UpdateConda ($python_home) {
82+
$conda_path = $python_home + "\Scripts\conda.exe"
83+
Write-Host "Updating conda..."
84+
$args = "update --yes conda"
85+
Write-Host $conda_path $args
86+
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
87+
}
88+
89+
90+
function main () {
91+
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
92+
UpdateConda $env:PYTHON
93+
InstallCondaPackages $env:PYTHON "conda-build jinja2 anaconda-client"
94+
}
95+
96+
main

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.