Skip to content

Commit 5b84e49

Browse files
committed
Merge branch 'appveyor'
2 parents 74fee2c + 24fce07 commit 5b84e49

File tree

7 files changed

+268
-39
lines changed

7 files changed

+268
-39
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020
<td>Build Status</td>
2121
<td>
2222
<a href="https://travis-ci.org/pydata/pandas">
23-
<img src="https://travis-ci.org/pydata/pandas.svg?branch=master" alt="build status" />
23+
<img src="https://travis-ci.org/pydata/pandas.svg?branch=master" alt="travis build status" />
24+
</a>
25+
</td>
26+
</tr>
27+
<td></td>
28+
<td>
29+
<a href="https://ci.appveyor.com/project/jreback/pandas-465">
30+
<img src="https://ci.appveyor.com/api/projects/status/iblk29s98quexwxi/branch/master?svg=true" alt="appveyor build status" />
2431
</a>
2532
</td>
2633
</tr>

appveyor.yml

+52-15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
# Backslashes in quotes need to be escaped: \ -> "\\"
7+
8+
matrix:
9+
fast_finish: true # immediately finish build once one of the jobs fails.
10+
111
environment:
212
global:
313
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
@@ -6,33 +16,60 @@ environment:
616
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\run_with_env.cmd"
717

818
matrix:
9-
- PYTHON: "C:\\Python27_32"
10-
PYTHON_VERSION: "2.7"
11-
PYTHON_ARCH: "32"
19+
- PYTHON: "C:\\Python35_64"
20+
PYTHON_VERSION: "3.5"
21+
PYTHON_ARCH: "64"
22+
CONDA_PY: "35"
23+
CONDA_NPY: "110"
1224

1325
- PYTHON: "C:\\Python27_64"
1426
PYTHON_VERSION: "2.7"
1527
PYTHON_ARCH: "64"
28+
CONDA_PY: "27"
29+
CONDA_NPY: "110"
1630

17-
- PYTHON: "C:\\Python34_32"
18-
PYTHON_VERSION: "3.4"
19-
PYTHON_ARCH: "32"
31+
# We always use a 64-bit machine, but can build x86 distributions
32+
# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV).
33+
platform:
34+
- x64
2035

21-
- PYTHON: "C:\\Python34_64"
22-
PYTHON_VERSION: "3.4"
23-
PYTHON_ARCH: "64"
36+
# all our python builds have to happen in tests_script...
37+
build: false
38+
39+
init:
40+
- "ECHO %PYTHON_VERSION% %PYTHON%"
2441

2542
install:
2643
# this installs the appropriate Miniconda (Py2/Py3, 32/64 bit),
27-
# as well as pip, conda-build, and the binstar CLI
44+
- powershell .\ci\install.ps1
45+
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
2846
- echo "install"
2947
- cd
3048
- ls -ltr
31-
- powershell .\\ci\\install_appveyor.ps1
32-
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
49+
- git tag --sort v:refname
3350

34-
build: false
51+
# install our build environment
52+
- cmd: conda config --set show_channel_urls yes --set always_yes yes --set changeps1 no
53+
- cmd: conda update -q conda
54+
- cmd: conda config --add channels http://conda.anaconda.org/pandas
55+
- cmd: conda config --set ssl_verify false
56+
57+
# this is now the downloaded conda...
58+
- conda info -a
59+
60+
# build em using the local source checkout in the correct windows env
61+
- conda install conda-build
62+
- cmd: '%CMD_IN_ENV% conda build conda.recipe -q --no-test'
63+
64+
# create our env
65+
- SET REQ=ci\requirements-%PYTHON_VERSION%-%PYTHON_ARCH%.run
66+
- cmd: conda create -q -n pandas python=%PYTHON_VERSION% nose
67+
- cmd: activate pandas
68+
- cmd: conda install -q --file=%REQ%
69+
- ps: conda install -q (conda build conda.recipe -q --output --no-test)
3570

3671
test_script:
37-
- "%CMD_IN_ENV% %PYTHON%/python.exe setup.py build_ext --inplace"
38-
- "%PYTHON%/Scripts/nosetests -A \"not slow and not network and not disabled\" pandas"
72+
# tests
73+
- cd \
74+
- conda list pandas
75+
- nosetests --exe -A "not slow and not network and not disabled" pandas

ci/install.ps1

+96
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

ci/requirements-2.7-64.run

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
dateutil
2+
pytz
3+
numpy
4+
xlwt
5+
numexpr
6+
pytables
7+
matplotlib
8+
openpyxl
9+
xlrd
10+
sqlalchemy
11+
lxml=3.2.1
12+
scipy
13+
xlsxwriter
14+
boto
15+
bottleneck
16+
patsy
17+
html5lib
18+
beautiful-soup
19+
jinja2=2.8
20+
21+
#pymysql=0.6.3
22+
#psycopg2=2.5.2

ci/requirements-3.5-64.run

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
python-dateutil
2+
pytz
3+
numpy
4+
openpyxl
5+
xlsxwriter
6+
xlrd
7+
xlwt
8+
patsy
9+
scipy
10+
numexpr
11+
pytables
12+
html5lib
13+
lxml
14+
matplotlib
15+
jinja2
16+
blosc
17+
18+
# currently causing some warnings
19+
#sqlalchemy
20+
#pymysql
21+
#psycopg2
22+
23+
# not available from conda
24+
#beautiful-soup
25+
#bottleneck

ci/run_with_env.cmd

+64-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:: EXPECTED ENV VARS: PYTHON_ARCH (either x86 or x64)
2+
:: CONDA_PY (either 27, 33, 35 etc. - only major version is extracted)
3+
::
4+
::
15
:: To build extensions for 64 bit Python 3, we need to configure environment
26
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
37
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
@@ -6,7 +10,8 @@
610
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
711
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
812
::
9-
:: 32 bit builds do not require specific environment configurations.
13+
:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific
14+
:: environment configurations.
1015
::
1116
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
1217
:: cmd interpreter, at least for (SDK v7.0)
@@ -15,33 +20,76 @@
1520
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
1621
:: http://stackoverflow.com/a/13751649/163740
1722
::
18-
:: Author: Olivier Grisel
23+
:: Author: Phil Elson
24+
:: Original Author: Olivier Grisel (https://github.com/ogrisel/python-appveyor-demo)
1925
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
26+
::
27+
:: Notes about batch files for Python people:
28+
::
29+
:: Quotes in values are literally part of the values:
30+
:: SET FOO="bar"
31+
:: FOO is now five characters long: " b a r "
32+
:: If you don't want quotes, don't include them on the right-hand side.
33+
::
34+
:: The CALL lines at the end of this file look redundant, but if you move them
35+
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
36+
:: case, I don't know why.
37+
:: originally from https://github.com/pelson/Obvious-CI/blob/master/scripts/obvci_appveyor_python_build_env.cmd
2038
@ECHO OFF
2139

2240
SET COMMAND_TO_RUN=%*
2341
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
2442

25-
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
26-
IF %MAJOR_PYTHON_VERSION% == "2" (
43+
:: Extract the major and minor versions, and allow for the minor version to be
44+
:: more than 9. This requires the version number to have two dots in it.
45+
SET MAJOR_PYTHON_VERSION=%CONDA_PY:~0,1%
46+
47+
IF "%CONDA_PY:~2,1%" == "" (
48+
:: CONDA_PY style, such as 27, 34 etc.
49+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~1,1%
50+
) ELSE (
51+
IF "%CONDA_PY:~3,1%" == "." (
52+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,1%
53+
) ELSE (
54+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,2%
55+
)
56+
)
57+
58+
:: Based on the Python version, determine what SDK version to use, and whether
59+
:: to set the SDK for 64-bit.
60+
IF %MAJOR_PYTHON_VERSION% == 2 (
2761
SET WINDOWS_SDK_VERSION="v7.0"
28-
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
29-
SET WINDOWS_SDK_VERSION="v7.1"
62+
SET SET_SDK_64=Y
3063
) ELSE (
31-
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
32-
EXIT 1
64+
IF %MAJOR_PYTHON_VERSION% == 3 (
65+
SET WINDOWS_SDK_VERSION="v7.1"
66+
IF %MINOR_PYTHON_VERSION% LEQ 4 (
67+
SET SET_SDK_64=Y
68+
) ELSE (
69+
SET SET_SDK_64=N
70+
)
71+
) ELSE (
72+
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
73+
EXIT /B 1
74+
)
3375
)
3476

3577
IF "%PYTHON_ARCH%"=="64" (
36-
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
37-
SET DISTUTILS_USE_SDK=1
38-
SET MSSdk=1
39-
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
40-
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
41-
ECHO Executing: %COMMAND_TO_RUN%
42-
call %COMMAND_TO_RUN% || EXIT 1
78+
IF %SET_SDK_64% == Y (
79+
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
80+
SET DISTUTILS_USE_SDK=1
81+
SET MSSdk=1
82+
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
83+
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
84+
ECHO Executing: %COMMAND_TO_RUN%
85+
call %COMMAND_TO_RUN% || EXIT /B 1
86+
) ELSE (
87+
ECHO Using default MSVC build environment for 64 bit architecture
88+
ECHO Executing: %COMMAND_TO_RUN%
89+
call %COMMAND_TO_RUN% || EXIT /B 1
90+
)
4391
) ELSE (
4492
ECHO Using default MSVC build environment for 32 bit architecture
4593
ECHO Executing: %COMMAND_TO_RUN%
46-
call %COMMAND_TO_RUN% || EXIT 1
94+
call %COMMAND_TO_RUN% || EXIT /B 1
4795
)

conda.recipe/meta.yaml

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build:
66
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
77

88
source:
9-
git_url: ../
9+
path: ../../
1010

1111
requirements:
1212
build:
@@ -28,12 +28,6 @@ test:
2828
imports:
2929
- pandas
3030

31-
#requires:
32-
# - nose
33-
34-
#commands:
35-
# - nosetests --exe -A "not slow and not network and not disabled" pandas
36-
3731
about:
3832
home: http://pandas.pydata.org
3933
license: BSD

0 commit comments

Comments
 (0)