forked from MacPython/scipy-wheels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
191 lines (164 loc) · 6.95 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
# Config was originally based on an example by Olivier Grisel. Thanks!
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
# There are several possible build configurations:
#
# 1. LAPACK
# a) Intel MKL (https://software.intel.com/en-us/mkl) or
# b) LAPACK for Windows (https://icl.cs.utk.edu/lapack-for-windows/lapack/)
# 2. FFTW
# a) pyFFTW python package (https://pypi.org/project/pyFFTW/) or
# b) FFTW binary library (ftp://ftp.fftw.org/pub/fftw)
# 3. NumPy
# a) NumPy python package with generic LAPACK (https://pypi.org/project/numpy/) or
# b) NumPy+MKL unofficial build (https://www.lfd.uci.edu/~gohlke/pythonlibs/)
#
# Here we use most generic build with LAPACK b), FFTW binary libray b) and
# generic NumPy b)
clone_depth: 100
max_jobs: 100
branches:
only:
- master
cache:
- '%LOCALAPPDATA%\pip\Cache'
platform:
- x64
image:
- Visual Studio 2015
environment:
global:
MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
LAPACK_32_URL: http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win32/
FFTW_32_URL: ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll32.zip
MINGW_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
MINGW_64_GF: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
LAPACK_64_URL: http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/
FFTW_64_URL: ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip
FFTW_ZIP: fftw-3.3.5.zip
NUMPY_BUILD_DEP: numpy
CYTHON_BUILD_DEP: Cython
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
PYPI_PASSWORD:
secure: qzj1LjjInqPzpfidSH9qaMbftLIzD9s9kWQfSZWG5KQ=
PYPITEST_PASSWORD:
secure: AC+ebBizFsGGHleha9J4+u21eadTMZ9cCwUzlbCYHdw=
BUILD_COMMIT: master
matrix:
- PYTHON: C:\Python39-x64
PYTHON_VERSION: '3.9'
PYTHON_ARCH: 64
PYTHON_BUILD_DIR: build\lib.win-amd64-cpython-39
- PYTHON: C:\Python310-x64
PYTHON_VERSION: '3.10'
PYTHON_ARCH: 64
PYTHON_BUILD_DIR: build\lib.win-amd64-cpython-310
- PYTHON: C:\Python311-x64
PYTHON_VERSION: '3.11'
PYTHON_ARCH: 64
PYTHON_BUILD_DIR: build\lib.win-amd64-cpython-311
- PYTHON: C:\Python312-x64
PYTHON_VERSION: '3.12'
PYTHON_ARCH: 64
PYTHON_BUILD_DIR: build\lib.win-amd64-cpython-312
init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
- "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\""
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
Write-Host "There are newer queued builds for this pull request, skipping build."
Exit-AppveyorBuild
}
install:
# Get needed submodules
# - git submodule update --remote # versioneer does not work with submodules
- git clone https://github.com/SHTOOLS/SHTOOLS.git
- git clone https://github.com/multi-build/multibuild.git
# 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, )"
# Install FFTW v3.3.5
- ps: Write-Output Installing FFTW
- ps: mkdir fftw
- ps: $env:FFTW = "$env:APPVEYOR_BUILD_FOLDER\fftw"
- ps: cd fftw
- ps: Write-Output $env:FFTW
- ps: |
If ($env:PYTHON_ARCH -eq 32) {
$env:FFTW_URL = $env:FFTW_32_URL
} Else {
$env:FFTW_URL = $env:FFTW_64_URL
}
- ps: wget $env:FFTW_URL -OutFile $env:FFTW_ZIP
- ps: 7z x $env:FFTW_ZIP
# NumPy disutils are looking for %FFTW%\libfftw3.dll file
- ps: cp libfftw3-3.dll libfftw3.dll
- ps: cd ..
# Install LAPACK and BLAS
- ps: Write-Output Installing LAPACK and BLAS
- ps: mkdir lapack
- ps: $env:LAPACK="$env:APPVEYOR_BUILD_FOLDER\lapack"
- ps: $env:BLAS="$env:APPVEYOR_BUILD_FOLDER\lapack"
- ps: cd lapack
- ps: |
If ($env:PYTHON_ARCH -eq 32) {
$env:LAPACK_URL = $env:LAPACK_32_URL
} Else {
$env:LAPACK_URL = $env:LAPACK_64_URL
}
- ps: wget $env:LAPACK_URL/libblas.lib -OutFile libblas.lib
- ps: wget $env:LAPACK_URL/libblas.dll -OutFile libblas.dll
- ps: wget $env:LAPACK_URL/liblapack.lib -OutFile liblapack.lib
- ps: wget $env:LAPACK_URL/liblapack.dll -OutFile liblapack.dll
- ps: cd ..
# Install build requirements
- python -m pip install -U pip setuptools wheel
- pip install "%CYTHON_BUILD_DEP%" "%NUMPY_BUILD_DEP%" versioneer
# Setup mingw C++ compiler explicitly
# We want to compile C++ and Fortran sources with the same mingw compiler
- echo [build]>> %PYTHON%\Lib\site-packages\setuptools\_distutils\distutils.cfg
- echo compiler = mingw32>> %PYTHON%\Lib\site-packages\setuptools\_distutils\distutils.cfg
build_script:
- cd %APPVEYOR_BUILD_FOLDER%\SHTOOLS
- ps: |
$PYTHON_ARCH = $env:PYTHON_ARCH
If ($PYTHON_ARCH -eq 32) {
$env:MINGW = $env:MINGW_32
} Else {
$env:MINGW = $env:MINGW_64
}
$env:Path += ";$env:MINGW"
# Copy over additional DLLs to bundle to the wheels
- mkdir %PYTHON_BUILD_DIR%\pyshtools
- ps: cp "$env:LAPACK\libblas.dll" "$env:PYTHON_BUILD_DIR\pyshtools"
- ps: cp "$env:LAPACK\liblapack.dll" "$env:PYTHON_BUILD_DIR\pyshtools"
- ps: cp "$env:FFTW\libfftw3-3.dll" "$env:PYTHON_BUILD_DIR\pyshtools"
- ps: cp "$env:MINGW\libgcc_s_seh-1.dll" "$env:PYTHON_BUILD_DIR\pyshtools"
- ps: cp "$env:MINGW\libgcc_s_seh-1.dll" "$env:PYTHON_BUILD_DIR\pyshtools\libgcc_s_seh_64-1.dll"
- ps: cp "$env:MINGW\libquadmath-0.dll" "$env:PYTHON_BUILD_DIR\pyshtools"
- ps: cp "$env:MINGW\libwinpthread-1.dll" "$env:PYTHON_BUILD_DIR\pyshtools"
- ps: cp "$env:MINGW_64_GF\libgfortran-3.dll" "$env:PYTHON_BUILD_DIR\pyshtools\libgfortran_64-3.dll"
- dir %PYTHON_BUILD_DIR%\pyshtools
# Build wheel
- pip wheel -v -v -v --no-deps --wheel-dir=dist .
- dir dist
on_success:
- pip install twine
- twine upload --username wieczor --password %PYPI_PASSWORD% --skip-existing dist/*
#- twine upload --repository-url https://test.pypi.org/legacy/ --username wieczor --password %PYPITEST_PASSWORD% --skip-existing dist/*
artifacts:
- path: SHTOOLS\dist\pyshtools-*.whl