This repository has been archived by the owner on Aug 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
appveyor.yml
121 lines (105 loc) · 4.3 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
---
image: Visual Studio 2019
platform: x64
environment:
global:
COMPILER: msvc2019
GEOS_VERSION: "3.9.1"
BUILD_COMMIT: "0.10.1"
matrix:
- PYTHON: "C:\\Python36"
ARCH: x86
NUMPY: "1.13.3"
- PYTHON: "C:\\Python36-x64"
ARCH: x64
NUMPY: "1.13.3"
- PYTHON: "C:\\Python37"
ARCH: x86
NUMPY: "1.14.5"
- PYTHON: "C:\\Python37-x64"
ARCH: x64
NUMPY: "1.14.5"
- PYTHON: "C:\\Python38"
ARCH: x86
NUMPY: "1.17.3"
- PYTHON: "C:\\Python38-x64"
ARCH: x64
NUMPY: "1.17.3"
- PYTHON: "C:\\Python39"
ARCH: x86
NUMPY: "1.19.5"
- PYTHON: "C:\\Python39-x64"
ARCH: x64
NUMPY: "1.19.5"
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%
- 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 pygeos
- cd pygeos
- git fetch origin
- git checkout %BUILD_COMMIT%
- git clean -fxd
- git reset --hard
- git log -1
- cd pygeos
- xcopy %GEOS_INSTALL%\bin\geos*.dll .
- 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 "Installing Python requirements" -ForegroundColor Magenta'
- python -m pip install --upgrade pip
- pip install wheel numpy==%NUMPY% cython
- ps: 'Write-Host "Building wheel" -ForegroundColor Magenta'
- set GEOS_INCLUDE_PATH=%GEOS_INSTALL%\include
- set GEOS_LIBRARY_PATH=%GEOS_INSTALL%\lib
- python setup.py build_ext bdist_wheel
- ps: 'Write-Host "Checking pip install in a new environment" -ForegroundColor Magenta'
- set PATH=%_INITPATH%
- set GEOS_INCLUDE_PATH=
- set GEOS_LIBRARY_PATH=
- '%PYTHON%\python.exe -m venv C:\projects\venv'
- call C:\projects\venv\Scripts\activate.bat
- pip install --disable-pip-version-check numpy==%NUMPY%
- cd dist
- pip install --no-index --find-links . --no-cache-dir pygeos
- python -c "import pygeos; print(pygeos.__version__)"
- ps: 'Write-Host "Running pytest" -ForegroundColor Magenta'
- cd %APPVEYOR_BUILD_FOLDER%\pygeos\pygeos
- xcopy test\* C:\projects\test /s /i
- cd C:\projects\test
- dir
- pip install --disable-pip-version-check pytest
- pytest
on_success:
- pip install twine
- cd %APPVEYOR_BUILD_FOLDER%\pygeos
- if "%APPVEYOR_REPO_BRANCH%" == "deploy-test" (twine upload --repository-url https://test.pypi.org/legacy/ -u __token__ -p %TWINE_PASSWORD_TEST% --skip-existing --disable-progress-bar dist\*.whl) else (echo Skipping test upload)
- if "%APPVEYOR_REPO_BRANCH%" == "master" (twine upload -u __token__ --skip-existing --disable-progress-bar dist\*.whl) else (echo Skipping upload)
cache:
- C:\projects\deps -> %APPVEYOR_BUILD_FOLDER%\scripts\build_geos.cmd
artifacts:
- path: pygeos\dist\*.whl
name: wheel