-
Notifications
You must be signed in to change notification settings - Fork 560
/
appveyor.yml
130 lines (112 loc) · 4.65 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
image: Visual Studio 2019
platform: x64
environment:
global:
GEOS_VERSION: "3.8.1"
matrix:
# - PYTHON: "C:\\Python27"
# ARCH: x86
# COMPILER: msvc90
# GEOS_VERSION: "3.5.2"
# image: Visual Studio 2015
# - PYTHON: "C:\\Python27-x64"
# ARCH: x64
# COMPILER: msvc90
# GEOS_VERSION: "3.5.2"
# image: Visual Studio 2015
- PYTHON: "C:\\Python35"
ARCH: x86
COMPILER: msvc2019
- PYTHON: "C:\\Python35-x64"
ARCH: x64
COMPILER: msvc2019
- PYTHON: "C:\\Python36"
ARCH: x86
COMPILER: msvc2019
- PYTHON: "C:\\Python36-x64"
ARCH: x64
COMPILER: msvc2019
- PYTHON: "C:\\Python37"
ARCH: x86
COMPILER: msvc2019
- PYTHON: "C:\\Python37-x64"
ARCH: x64
COMPILER: msvc2019
- PYTHON: "C:\\Python38"
ARCH: x86
COMPILER: msvc2019
- PYTHON: "C:\\Python38-x64"
ARCH: x64
COMPILER: msvc2019
- PYTHON: "C:\\Python39"
ARCH: x86
COMPILER: msvc2019
- PYTHON: "C:\\Python39-x64"
ARCH: x64
COMPILER: msvc2019
install:
# 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) { `
throw "There are newer queued builds for this pull request, failing early." }
build_script:
- set _INITPATH=%PATH%
- ps: 'Write-Host "Configuring PATH with $env:PYTHON" -ForegroundColor Magenta'
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
- python -m pip install --disable-pip-version-check --upgrade pip
- pip install --upgrade wheel
- ps: 'Write-Host "Configuring MSVC compiler $env:COMPILER" -ForegroundColor Magenta'
- if %COMPILER%==msvc90 ( call "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" %ARCH% )
- if %COMPILER%==msvc2017 ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% )
- if %COMPILER%==msvc2019 ( call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% )
- ps: 'Write-Host "Cached dependency folder" -ForegroundColor Magenta'
- if not exist C:\projects\deps mkdir C:\projects\deps
- dir C:\projects\deps
- set GEOS_INSTALL=C:\projects\deps\geos-%GEOS_VERSION%-%COMPILER%-%ARCH%
- set CYTHONPF=C:\\projects\\deps\\geos-%GEOS_VERSION%-%COMPILER%-%ARCH%
- ps: 'Write-Host "Checking GEOS build $env:GEOS_INSTALL" -ForegroundColor Magenta'
- call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\build_geos.cmd
# - ps: 'Push-AppveyorArtifact $env:GEOS_INSTALL\bin\geos.dll'
# - ps: 'Push-AppveyorArtifact $env:GEOS_INSTALL\bin\geos_c.dll'
- ps: 'Write-Host "Copying and checking geos_c.dll" -ForegroundColor Magenta'
- cd %APPVEYOR_BUILD_FOLDER%
- dir
- if %ARCH%==x86 ( set CPDIR=DLLs_x86_VC9 )
- if %ARCH%==x64 ( set CPDIR=DLLs_AMD64_VC9 )
- xcopy %GEOS_INSTALL%\bin\geos*.dll %CPDIR%
- cd %CPDIR%
- dir
- dumpbin /dependents geos_c.dll
- dumpbin /dependents %PYTHON%\python.exe
- python -c "import sys; print('Python ' + sys.version)"
- python -c "import ctypes; print(ctypes.CDLL('./geos_c.dll'))"
- cd ..
- ps: 'Write-Host "Building wheel" -ForegroundColor Magenta'
- pip install -r requirements-dev.txt
- set GEOS_LIBRARY_PATH=%GEOS_INSTALL%\bin\geos_c.dll
- set PATH=%GEOS_INSTALL%\bin;%PATH%
- python setup.py build_ext -I%CYTHONPF%\\include -lgeos_c -L%CYTHONPF%\\lib bdist_wheel
- ps: 'Write-Host "Checking pip install in a new environment" -ForegroundColor Magenta'
- set PATH=%_INITPATH%
- set GEOS_LIBRARY_PATH=
- '%PYTHON%\python.exe -m venv C:\projects\test'
- call C:\projects\test\Scripts\activate.bat
- pip install -r requirements-dev.txt
- cd dist
- pip install --no-index --find-links . --no-cache-dir shapely
- python -c "import shapely; print(shapely.__version__)"
- python -c "from shapely.geos import geos_version_string; print(geos_version_string)"
- python -c "from shapely import speedups; assert speedups.enabled"
- ps: 'Write-Host "Running pytest" -ForegroundColor Magenta'
- xcopy ..\tests tests\
- pytest
cache:
- C:\projects\deps
artifacts:
- path: dist\*.whl
name: wheel