-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathappveyor.yml
117 lines (107 loc) · 4.55 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
platform:
- x64
# This is based on file and files in ci/appveyor are from
# https://github.com/ogrisel/python-appveyor-demo
environment:
global:
PROJ_BASE_DIR: "%APPVEYOR_BUILD_FOLDER%\\proj_install"
PROJ_NETWORK: "ON"
matrix:
# Pre-installed Python versions
# See: http://www.appveyor.com/docs/installed-software#python
# build is limited to 60 minutes, without caching each build takes 10-30 minutes
# with caching build takes less than 1 minute
- PYTHON: "C:\\Python310-x64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PROJSOURCE: 9.3.0
BUILD_SHARED_LIBS: ON
# - PYTHON: "C:\\Python310-x64"
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PROJSOURCE: git
# BUILD_SHARED_LIBS: ON
# matrix:
# allow_failures:
# - PYTHON: "C:\\Python310-x64"
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PROJSOURCE: git
# BUILD_SHARED_LIBS: ON
shallow_clone: true
cache:
- C:\Tools\vcpkg\installed\ -> appveyor.yml
- C:\Users\appveyor\AppData\Local\pip\Cache\wheels -> appveyor.yml
- "%PROJ_BASE_DIR%"
build_script:
- set VCPKG_INSTALLED=C:\Tools\vcpkg\installed\%platform%-windows
# If cached directory does not exist, update vcpkg and install dependencies
- if not exist %VCPKG_INSTALLED%\bin (
cd "C:\Tools\vcpkg" &
git pull > nul &
.\bootstrap-vcpkg.bat -disableMetrics &
vcpkg install sqlite3[core,tool]:"%platform%"-windows &
vcpkg install tiff:"%platform%"-windows &
vcpkg install curl:"%platform%"-windows &
cd %APPVEYOR_BUILD_FOLDER%
)
- dir %VCPKG_INSTALLED%\bin
- set PATH=%VCPKG_INSTALLED%\bin;%PATH%
# See https://www.appveyor.com/docs/lang/cpp/
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019"
(call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %platform% )
# setup PROJ
- set PROJ_DIR=%PROJ_BASE_DIR%\proj-%PROJSOURCE:~0,5%
- if "%PROJSOURCE%" == "git" git clone https://github.com/OSGeo/PROJ.git proj-git
- if "%PROJSOURCE%" == "git" rmdir /s /q %PROJ_DIR%
- if not "%PROJSOURCE%" == "git" if not exist %PROJ_DIR% set BUILD_PROJ_STABLE=1
- if defined BUILD_PROJ_STABLE curl -o "proj-%PROJSOURCE:~0,5%.zip" "https://download.osgeo.org/proj/proj-%PROJSOURCE%.zip"
- if defined BUILD_PROJ_STABLE 7z x -aoa -y "proj-%PROJSOURCE:~0,5%.zip"
- if not exist %PROJ_DIR% cd "%APPVEYOR_BUILD_FOLDER%\proj-%PROJSOURCE:~0,5%"
- if "%PROJSOURCE%" == "git" set BUILD_PROJ=1
- if defined BUILD_PROJ_STABLE set BUILD_PROJ=1
- if defined BUILD_PROJ mkdir build
- if defined BUILD_PROJ cd build
- if defined BUILD_PROJ cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="%BUILD_SHARED_LIBS%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
- if defined BUILD_PROJ ninja -v
- if defined BUILD_PROJ ninja install
- set PATH=%PROJ_DIR%\bin;%PATH%
- set PROJ_DATA=%PROJ_DIR%\share\proj
- cd %APPVEYOR_BUILD_FOLDER%
- proj
# Build and install pyproj wheel
- python -m pip install -r requirements-dev.txt
- mkdir pyproj\proj_dir\share\proj
- copy %PROJ_DATA%\* pyproj\proj_dir\share\proj
- set PROJ_WHEEL=true
- python -m build --wheel
- FOR %%F IN (dist\*.whl) DO (set PYPROJ_WHEEL=%%F)
- delvewheel repair %PYPROJ_WHEEL%
- FOR %%F IN (wheelhouse\*.whl) DO (set PYPROJ_WHEEL=%%F)
- python -m pip install %PYPROJ_WHEEL%
install:
# Prepend newly installed Python to the PATH of this build
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
- SET BASE_PATH=%PATH%
# Check that we have the expected version and architecture for Python
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
# install wheel, caching
- python -m pip install --disable-pip-version-check --user --upgrade pip
- python -m pip install build wheel delvewheel
test_script:
# reset environment variables for test
- set PROJ_DATA=
- set PROJ_DIR=
- SET PATH=%BASE_PATH%
# run the project tests
- python -m pip install -r requirements-test.txt
- RD /S /Q pyproj\ # make sure src does not impact installed wheel
- python -c "import pyproj; pyproj.Proj('epsg:4269')"
- python -m pytest --cov-report term-missing --cov=pyproj -v -s
# cleanup for test dir
- rmdir /s /q dist\ 2>nul
- if %PROJSOURCE% == git rmdir /s /q wheelhouse\ 2>nul
artifacts:
# Archive the generated packages in the ci.appveyor.com build report.
- path: wheelhouse\*
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
#