This repository has been archived by the owner on Feb 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathappveyor.yml
236 lines (205 loc) · 8.26 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# As config was originally based on an example by Olivier Grisel. Thanks!
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
clone_depth: 50
# No reason for us to restrict the number concurrent jobs
max_jobs: 100
image: Visual Studio 2019
cache:
- '%LOCALAPPDATA%\pip\Cache'
environment:
global:
MINGW_32: C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin
MINGW_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
CYTHON_BUILD_DEP: Cython==0.29.24
PYTHRAN_BUILD_DEP: pythran
NUMPY_TEST_DEP: numpy==1.18.5
PYBIND11_BUILD_DEP: pybind11==2.7.0
TEST_MODE: fast
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
WHEELHOUSE_UPLOADER_USERNAME: travis-worker
WHEELHOUSE_UPLOADER_SECRET:
secure:
jIyaD+VWmTlDGXThsKAkiLq8iljgYHiriq+kEUuW9tHj67R5BapLxLjbfco2nt8Y
BUILD_COMMIT: main
DAILY_COMMIT: main
matrix:
- PYTHON: C:\Python310-x64
PYTHON_VERSION: '3.10'
PYTHON_ARCH: 64
NUMPY_BUILD_DEP: oldest-supported-numpy
NUMPY_TEST_DEP: oldest-supported-numpy
CYTHON_BUILD_DEP: Cython
- PYTHON: C:\Python39
PYTHON_VERSION: 3.9
PYTHON_ARCH: 32
NUMPY_BUILD_DEP: numpy==1.19.3
NUMPY_TEST_DEP: numpy==1.19.3
CYTHON_BUILD_DEP: Cython
- PYTHON: C:\Python39-x64
PYTHON_VERSION: 3.9
PYTHON_ARCH: 64
NUMPY_BUILD_DEP: numpy==1.19.3
NUMPY_TEST_DEP: numpy==1.19.3
CYTHON_BUILD_DEP: Cython
- PYTHON: C:\Python38
PYTHON_VERSION: 3.8
PYTHON_ARCH: 32
NUMPY_BUILD_DEP: numpy==1.18.5
NUMPY_TEST_DEP: numpy==1.18.5
CYTHON_BUILD_DEP: Cython
- PYTHON: C:\Python38-x64
PYTHON_VERSION: 3.8
PYTHON_ARCH: 64
NUMPY_BUILD_DEP: numpy==1.18.5
NUMPY_TEST_DEP: numpy==1.18.5
CYTHON_BUILD_DEP: Cython
init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
- "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\""
- ps: >-
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
$env:CONTAINER = "pre-release"
if ($env:DAILY_COMMIT) { $env:BUILD_COMMIT = $env:DAILY_COMMIT }
$env:NPY_RELAXED_STRIDES_DEBUG = 1
} else {
$env:CONTAINER = "wheels"
$env:UPLOAD_ARGS = "--no-update-index"
}
install:
- cmd: echo "Filesystem root:"
- dir C:\
- echo "List Program Files:"
- dir "C:\Program Files (x86)\"
# install a newer mingw for i686 as the appveyor images don't have gcc 7+ for i686
- if [%PYTHON_ARCH%]==[32] choco install -y mingw --forcex86 --force --version=7.3.0
- git submodule update --init
# Install new Python if necessary
- ps: .\multibuild\install_python.ps1
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
# Check that we have the expected version and architecture for Python
- python --version
- >-
python -c "import sys,platform,struct;
print(sys.platform, platform.machine(), struct.calcsize('P') * 8, )"
# Get needed submodules
- git submodule update --init scipy numpy-distutils
# Download and install static "openblas.a" to PYTHON\lib
- ps: |
$PYTHON_ARCH = $env:PYTHON_ARCH
$PYTHON = $env:PYTHON
cd scipy
git checkout $env:BUILD_COMMIT
$lib = python tools/openblas_support.py
cd ..
$destination = "$PYTHON\lib\openblas.a"
cp $lib $destination
ls $destination
# Upgrade to the latest pip, setuptools, and wheel.
- python -m pip install -U pip "setuptools==59.5.0" wheel
# Install build requirements.
- python -m pip install "%CYTHON_BUILD_DEP%" "%PYTHRAN_BUILD_DEP%" "%NUMPY_BUILD_DEP%" "%PYBIND11_BUILD_DEP%"
# Replace numpy distutils with a version that can build with msvc + mingw-gfortran,
# and writes __config__.py suitable for Python 3.8. (Requires Numpy >= 1.18.0)
- ps: |
$PYTHON_VERSION = $env:PYTHON_VERSION
$NumpyDir = $((python -c 'import os; import numpy; print(os.path.dirname(numpy.__file__))') | Out-String).Trim()
rm -r -Force "$NumpyDir\distutils"
mv numpy-distutils\numpy\distutils $NumpyDir
rm -r -Force "$NumpyDir\compat"
mv numpy-distutils\numpy\compat $NumpyDir
build_script:
# we use a distribution file to assist in loading
# DLLs
- ps: |
$cwd = Get-Location
ls $cwd
rm -Force $cwd/scipy/scipy/_distributor_init.py
cp $cwd/_distributor_init.py $cwd/scipy/scipy/
cd scipy
# Append license text relevant for the built wheel
- type ..\LICENSE_win32.txt >> LICENSE.txt
# Copy over additional DLLs to bundle to the wheels.
# The find command below is just to print where the libraries are, for debugging.
- C:\cygwin\bin\find "C:\Program Files (x86)\Microsoft Visual Studio" -type f -name 'msvcp*.dll'
# * Python >=3.5
# Copy over MSVC C++ runtime library, which Python.org does no bundle, but is required by us.
# The version should match the compiler version, see https://wiki.python.org/moin/WindowsCompilers
- mkdir "build\lib.win32-%PYTHON_VERSION%\scipy\.libs"
- mkdir "build\lib.win-amd64-%PYTHON_VERSION%\scipy\.libs"
- copy "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.29.30133\x86\Microsoft.VC142.CRT\msvcp140.dll" "build\lib.win32-%PYTHON_VERSION%\scipy\.libs\"
- copy "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\msvcp140.dll" "build\lib.win-amd64-%PYTHON_VERSION%\scipy\.libs\"
# Build wheel using setup.py
- ps: |
$PYTHON_ARCH = $env:PYTHON_ARCH
If ($PYTHON_ARCH -eq 32) {
$MINGW = $env:MINGW_32
# 32-bit build requires careful adjustments
# until Microsoft has a switch we can use
# directly for i686 mingw
$env:NPY_DISTUTILS_APPEND_FLAGS = 1
$env:CXXFLAGS = "-m32"
$env:LDFLAGS = "-m32"
refreshenv
} Else {
$MINGW = $env:MINGW_64
}
$env:Path += ";$MINGW"
$env:NPY_NUM_BUILD_JOBS = "4"
- git submodule update --init
- python setup.py bdist_wheel
- ps: |
# Upload artifact to Appveyor immediately after build
ls dist -r | Foreach-Object {
appveyor PushArtifact $_.FullName
pip install $_.FullName
}
before_test:
# Install test requirements.
- python -m pip install pytest pytest-xdist pytest-faulthandler pytest-env Pillow mpmath matplotlib
# Upgrade numpy to the version used for testing
- python -m pip install "%NUMPY_TEST_DEP%"
test_script:
- cd ..
- mkdir tmp_test
- cd tmp_test
- python ..\check_installed_package.py
- python ..\run_scipy_tests.py %TEST_MODE% -- -n6 --junitxml=%cd%\junit-results.xml -rfEX
after_test:
- cd ..
- ls scipy\dist
- python verify_init.py scipy\dist
- cd tmp_test
# Upload test results to Appveyor
- ps: |
If (Test-Path .\junit-results.xml) {
(new-object net.webclient).UploadFile(
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
(Resolve-Path .\junit-results.xml)
)
}
$LastExitCode = 0
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
#
# If the cache limit is reached, the cache will not be updated (of not even
# created in the first run). So this is a trade of between keeping the cache
# current and having a cache at all.
# NB: This is done only `on_success` since the cache in uploaded only on
# success anyway.
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
# Show size of cache
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
on_success:
# Upload the generated wheel package to anaconda.org
# SCIPY_STAGING_UPLOAD_TOKEN is an encrypted variable
# used in Appveyor CI config, originally created at
# multibuild-wheels-staging site
- cd ..\scipy
- cmd: set ANACONDA_ORG="multibuild-wheels-staging"
- pip install git+https://github.com/Anaconda-Platform/anaconda-client.git@ce89e4351eef
- IF NOT "%SCIPY_STAGING_UPLOAD_TOKEN%" == "" anaconda -t %SCIPY_STAGING_UPLOAD_TOKEN% upload --force -u %ANACONDA_ORG% "dist\*.whl"