-
Notifications
You must be signed in to change notification settings - Fork 4
/
appveyor.yml
103 lines (89 loc) · 3.74 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
---
image: Visual Studio 2019
platform: x64
environment:
global:
COMPILER: msvc2019
GEOS_VERSION: "3.9.1"
matrix:
- PYTHON: "C:\\Python36"
ARCH: x86
- PYTHON: "C:\\Python36-x64"
ARCH: x64
- PYTHON: "C:\\Python37"
ARCH: x86
- PYTHON: "C:\\Python37-x64"
ARCH: x64
- PYTHON: "C:\\Python38"
ARCH: x86
- PYTHON: "C:\\Python38-x64"
ARCH: x64
- PYTHON: "C:\\Python39"
ARCH: x86
- PYTHON: "C:\\Python39-x64"
ARCH: x64
- PYTHON: "C:\\Python310"
ARCH: x86
- PYTHON: "C:\\Python310-x64"
ARCH: x64
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%
- ps: 'Write-Host "Configuring MSVC compiler $env:COMPILER" -ForegroundColor Magenta'
- 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%\scripts\build_geos.cmd
- ps: 'Write-Host "Copying and checking geos_c.dll" -ForegroundColor Magenta'
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update --init shapely
- cd shapely
- git log -1
- 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%
- 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 -> %APPVEYOR_BUILD_FOLDER%\scripts\build_geos.cmd
artifacts:
- path: shapely\dist\*.whl
name: wheel