1
- # vim ft=yaml
2
- # CI on Windows via appveyor
3
- # Largely from:
1
+ # As config was originally based on an example by Olivier Grisel. Thanks!
4
2
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
3
+ clone_depth : 50
5
4
6
- os : Visual Studio 2015
5
+ # No reason for us to restrict the number concurrent jobs
6
+ max_jobs : 100
7
+
8
+ cache :
9
+ - ' %LOCALAPPDATA%\pip\Cache'
7
10
8
11
environment :
9
- global :
10
- BUILD_COMMIT : master
11
- CYTHON_BUILD_DEP : cython==0.26.1
12
- OPENBLAS_COMMIT : v0.2.20
13
- OPENBLAS_ROOT : c:\opt
12
+ global :
13
+ MINGW_32 : C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
14
+ MINGW_64 : C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
15
+ OPENBLAS_32 : https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win32.zip
16
+ OPENBLAS_64 : https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win64.zip
17
+ OPENBLAS_32_SHA256 : 0a12804b08d475179a0411936f509b44d7512f084b4a81c2fa3abe8c9ac4ee09
18
+ OPENBLAS_64_SHA256 : 8f11d8a5a79795a3a1ccb2326c979a0ca426e623eee93f8e35239e3c21e62cd6
19
+ CYTHON_BUILD_DEP : Cython==0.26.1
20
+ TEST_MODE : fast
21
+ APPVEYOR_SAVE_CACHE_ON_ERROR : true
22
+ APPVEYOR_SKIP_FINALIZE_ON_EXIT : true
14
23
WHEELHOUSE_UPLOADER_USERNAME : travis-worker
15
24
WHEELHOUSE_UPLOADER_SECRET :
16
25
secure :
17
26
9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh
27
+ BUILD_COMMIT : master
18
28
DAILY_COMMIT : master
19
29
20
- matrix :
30
+ matrix :
31
+ - PYTHON : C:\Python36
32
+ PYTHON_VERSION : 3.6
33
+ PYTHON_ARCH : 32
21
34
22
- - PYTHON : " C:\\ Python27"
23
- - PYTHON : " C:\\ Python27-x64"
24
- - PYTHON : " C:\\ Python34"
25
- - PYTHON : " C:\\ Python34-x64"
26
- - PYTHON : " C:\\ Python35"
27
- - PYTHON : " C:\\ Python35-x64"
28
- - PYTHON : " C:\\ Python36"
29
- - PYTHON : " C:\\ Python36-x64"
35
+ - PYTHON : C:\Python36-x64
36
+ PYTHON_VERSION : 3.6
37
+ PYTHON_ARCH : 64
30
38
31
- install :
39
+ - PYTHON : C:\Python35
40
+ PYTHON_VERSION : 3.5
41
+ PYTHON_ARCH : 32
42
+
43
+ - PYTHON : C:\Python35-x64
44
+ PYTHON_VERSION : 3.5
45
+ PYTHON_ARCH : 64
46
+
47
+ - PYTHON : C:\Python34
48
+ PYTHON_VERSION : 3.4
49
+ PYTHON_ARCH : 32
50
+
51
+ - PYTHON : C:\Python34-x64
52
+ PYTHON_VERSION : 3.4
53
+ PYTHON_ARCH : 64
54
+
55
+ - PYTHON : C:\Python27
56
+ PYTHON_VERSION : 2.7
57
+ PYTHON_ARCH : 32
58
+
59
+ - PYTHON : C:\Python27-x64
60
+ PYTHON_VERSION : 2.7
61
+ PYTHON_ARCH : 64
62
+
63
+ init :
64
+ - " ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
65
+ - " ECHO \" %APPVEYOR_SCHEDULED_BUILD%\" "
32
66
- ps : >-
33
67
if ($env:APPVEYOR_REPO_BRANCH -eq "daily") {
34
68
$env:CONTAINER = "pre-release"
@@ -38,75 +72,122 @@ install:
38
72
$env:CONTAINER = "wheels"
39
73
$env:UPLOAD_ARGS = "--no-update-index"
40
74
}
75
+ install :
41
76
- cmd : echo "Filesystem root:"
42
77
- dir C:\
43
78
44
79
- echo "Installed SDKs:"
45
80
- dir "C:/Program Files/Microsoft SDKs/Windows"
46
81
47
- # Get needed submodules
48
- - git submodule update --init
49
-
50
- # Install Python 3.6.2 if necessary
51
- - ps : .\windows-wheel-builder\install_python362.ps1
52
-
53
82
# Prepend newly installed Python to the PATH of this build (this cannot be
54
83
# done from inside the powershell script as it would require to restart
55
84
# the parent CMD process).
56
- - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
57
-
58
- # Get Python bitness
59
- # https://stackoverflow.com/questions/1746475/windows-batch-help-in-setting-a-variable-from-command-output#4509885
60
- - set PY_CMD=python -c "import platform; print(platform.architecture()[0][:2])"
61
- - for /f "tokens=1 delims=" %%i in ('%PY_CMD%') do set PYTHON_ARCH=%%i
62
-
63
- # Fix MSVC builds for 64-bit Python
64
- # See
65
- # http://stackoverflow.com/questions/32091593/cannot-install-windows-sdk-7-1-on-windows-10
66
- - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64/vcvars64.bat"
85
+ - SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
67
86
68
87
# Check that we have the expected version and architecture for Python
69
88
- python --version
70
- - python -c "import struct; print(struct.calcsize('P') * 8)"
89
+ - >-
90
+ python -c "import sys,platform,struct;
91
+ print(sys.platform, platform.machine(), struct.calcsize('P') * 8, )"
92
+ # Get needed submodules
93
+ - git submodule update --init
94
+
95
+ # Download and install static "openblas.a" to PYTHON\lib
96
+ - ps : |
97
+ $PYTHON_ARCH = $env:PYTHON_ARCH
98
+ $PYTHON = $env:PYTHON
99
+ If ($PYTHON_ARCH -eq 32) {
100
+ $OPENBLAS = $env:OPENBLAS_32
101
+ $OPENBLAS_SHA256 = $env:OPENBLAS_32_SHA256
102
+ } Else {
103
+ $OPENBLAS = $env:OPENBLAS_64
104
+ $OPENBLAS_SHA256 = $env:OPENBLAS_64_SHA256
105
+ }
106
+ $clnt = new-object System.Net.WebClient
107
+ $file = "$(New-TemporaryFile).zip"
108
+ $tmpdir = New-TemporaryFile | %{ rm $_; mkdir $_ }
109
+ $destination = "$PYTHON\lib\openblas.a"
110
+ echo $file
111
+ echo $tmpdir
112
+ echo $OPENBLAS
113
+ $clnt.DownloadFile($OPENBLAS,$file)
114
+ $downloaded_hash = Get-FileHash -Algorithm SHA256 $file
115
+ if ($downloaded_hash.hash -ne $OPENBLAS_SHA256) {
116
+ $downloaded_hash | Format-List
117
+ echo $OPENBLAS_SHA256
118
+ throw "Downloaded OPENBLAS zip SHA256 does not match."
119
+ }
120
+ Expand-Archive $file $tmpdir
121
+ rm $tmpdir\$PYTHON_ARCH\lib\*.dll.a
122
+ $lib = ls $tmpdir\$PYTHON_ARCH\lib\*.a | ForEach { ls $_ } | Select-Object -first 1
123
+ echo $lib
124
+ cp $lib $destination
125
+ ls $destination
126
+ # Upgrade to the latest pip and setuptools.
127
+ - python -m pip install -U pip setuptools
71
128
72
- # Install requirements
73
- - pip install -r windows-wheel-builder\requirements.txt
74
- - python -m pip install --upgrade pip
75
129
# Pin wheel to 0.26 to avoid Windows ABI tag for built wheel
76
- - pip install wheel==0.26
130
+ - pip install "wheel==0.26"
131
+
132
+ # Install build requirements.
77
133
- pip install "%CYTHON_BUILD_DEP%"
78
- # Download built openblas libraries
79
- - cmd /c windows-wheel-builder\unpack_openblas.bat
80
134
81
135
build_script :
82
- # Build and install the wheel
83
136
- cd numpy
84
137
- git checkout %BUILD_COMMIT%
85
138
# Append license text relevant for the built wheel
86
139
- type ..\LICENSE_win32.txt >> LICENSE.txt
87
- - python ..\windows-wheel-builder\build_numpy.py . %PYTHON_ARCH% %OPENBLAS_ROOT%
88
- - cd dist
89
- - pip install --pre --no-index -f . numpy
90
- - pip install nose
140
+ - ps : |
141
+ $PYTHON_ARCH = $env:PYTHON_ARCH
142
+ If ($PYTHON_ARCH -eq 32) {
143
+ $MINGW = $env:MINGW_32
144
+ } Else {
145
+ $MINGW = $env:MINGW_64
146
+ }
147
+ $env:Path += ";$MINGW"
148
+ $env:NPY_NUM_BUILD_JOBS = "4"
149
+ - python setup.py bdist_wheel
150
+ - ps : |
151
+ # Upload artifact to Appveyor immediately after build
152
+ ls dist -r | Foreach-Object {
153
+ appveyor PushArtifact $_.FullName
154
+ pip install $_.FullName
155
+ }
91
156
92
157
test_script :
93
- # Run the project tests
94
- - python ..\..\check_license.py
95
- - python -c "import numpy; numpy.test(verbose=3)"
158
+ - pip install nose
96
159
- cd ..
160
+ - python check_license.py
161
+ - python -c "import numpy; numpy.test(verbose=3)"
97
162
98
163
after_test :
99
- # If tests are successful, create binary packages for the project.
100
- - dir dist
101
-
102
- artifacts :
103
- # Archive the generated packages in the ci.appveyor.com build report.
104
- - path : numpy\dist\*.*
164
+ # Upload test results to Appveyor
165
+ - ps : |
166
+ If (Test-Path .\junit-results.xml) {
167
+ (new-object net.webclient).UploadFile(
168
+ "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
169
+ (Resolve-Path .\junit-results.xml)
170
+ )
171
+ }
172
+ $LastExitCode = 0
173
+ # Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
174
+ #
175
+ # If the cache limit is reached, the cache will not be updated (of not even
176
+ # created in the first run). So this is a trade of between keeping the cache
177
+ # current and having a cache at all.
178
+ # NB: This is done only `on_success` since the cache in uploaded only on
179
+ # success anyway.
180
+ - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
181
+ - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
182
+ - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
183
+ # Show size of cache
184
+ - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
105
185
106
186
on_success :
107
187
# Upload the generated wheel package to Rackspace
108
188
# On Windows, Apache Libcloud cannot find a standard CA cert bundle so we
109
189
# disable the ssl checks.
190
+ - cd numpy
110
191
- pip install wheelhouse-uploader
111
192
- python -m wheelhouse_uploader upload
112
193
--no-ssl-check --local-folder=dist
0 commit comments