-
Notifications
You must be signed in to change notification settings - Fork 18
276 lines (226 loc) · 8.16 KB
/
python-proj-wheels.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: Python (geoarrow.proj) Wheels
on:
push:
# tags:
# - "python-core-v*"
jobs:
# build-wheel-manylinux2014:
# name: "Build manylinux2014 wheels"
# runs-on: ubuntu-latest
# container: quay.io/pypa/manylinux2014_x86_64
# defaults:
# run:
# working-directory: python/geoarrow-proj
# # NOTE: We abstain from most reusable github actions given that this is running in a docker
# # image
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "recursive"
# - name: Install latest stable rust
# run: |
# curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain stable -y
# - name: Install python dependencies
# run: |
# export PATH="/opt/python/cp38-cp38/bin/:$PATH"
# pip install -U pip
# pip install maturin
# - name: Install clang
# run: |
# # Install clang via yum to fix error:
# # error: 'stddef.h' file not found
# # Not sure why I can't get this to work via pixi. Am I missing a dependency?
# yum update
# yum install -y clang
# yum install -y llvm-toolset-7
# - name: Install Pixi
# run: |
# curl -fsSL https://pixi.sh/install.sh | bash
# - name: Install build requirements
# run: |
# export PATH="$HOME/.pixi/bin:$PATH"
# cd build
# pixi install
# - name: Build Python wheel
# run: |
# source $HOME/.cargo/env
# export PATH="/opt/python/cp38-cp38/bin/:$PATH"
# export PATH="$HOME/.pixi/bin:$PATH"
# export LD_LIBRARY_PATH="$(pwd)/build/.pixi/env/lib:$LD_LIBRARY_PATH"
# export PKG_CONFIG_PATH="$(pwd)/build/.pixi/env/lib/pkgconfig:$PKG_CONFIG_PATH"
# export LIBCLANG_PATH="$(pwd)/build/.pixi/env/lib"
# # export RUSTFLAGS="-I$(pwd)/build/.pixi/env/include"
# # pixi run --manifest-path build/pixi.toml
# maturin build --strip --interpreter /opt/python/cp38-cp38/bin/python --manylinux 2014 -o wheels
# - name: List wheels
# run: find ./wheels
# # Have to set path from root
# # https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
# - uses: actions/upload-artifact@v2
# with:
# path: python/geoarrow-proj/wheels/*.whl
# build-wheels-mac-x86:
# runs-on: macos-latest
# defaults:
# run:
# working-directory: python/geoarrow-proj
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "recursive"
# - name: Install Rust
# uses: dtolnay/rust-toolchain@stable
# - uses: Swatinem/rust-cache@v2
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.8"
# - name: Install Pixi
# run: |
# curl -fsSL https://pixi.sh/install.sh | bash
# echo "$HOME/.pixi/bin" >> $GITHUB_PATH
# - name: Install build requirements
# run: |
# cd build
# pixi install
# - name: Set native dependency paths
# run: |
# echo "LD_LIBRARY_PATH=$(pwd)/build/.pixi/env/lib" >> "$GITHUB_ENV"
# echo "PKG_CONFIG_PATH=$(pwd)/build/.pixi/env/lib/pkgconfig" >> "$GITHUB_ENV"
# - name: Install Python dependencies
# run: |
# python -V
# pip install maturin
# - name: Build
# run: |
# maturin build --strip -o wheels
# - name: Include shared libraries
# run: |
# pip install delocate
# # TODO: delocate shared lib
# - name: List wheels
# run: find ./wheels
# # Have to set path from root
# # https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
# - uses: actions/upload-artifact@v2
# with:
# path: python/geoarrow-proj/wheels/*.whl
build-wheel-windows:
runs-on: windows-latest
defaults:
run:
working-directory: python/geoarrow-proj
strategy:
fail-fast: false
matrix:
include:
- os: "windows-2019"
arch: "auto64"
triplet: "x64-windows"
vcpkg_cache: "c:\\vcpkg\\installed"
vcpkg_logs: "c:\\vcpkg\\buildtrees\\**\\*.log"
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Pixi
run: |
iwr -useb https://pixi.sh/install.ps1 | iex
- name: Add pixi to PATH
shell: bash
run: |
echo "C:/Users/runneradmin/AppData/Local/pixi/bin" >> $GITHUB_PATH
- name: Install build requirements
shell: bash
run: |
cd build
pixi install
- name: Try pkg-config
shell: bash
run: |
cp -n build/pkgconfig/* ./build/.pixi/env/Library/lib/pkgconfig/
pixi run --manifest-path build/pixi.toml pkg-config --libs --cflags proj "proj >= 9.2.0"
- name: Set native dependency paths
shell: bash
run: |
echo "$(pwd)/build/.pixi/env/Library/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$(pwd)/build/.pixi/env/Library/lib" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$(pwd)/build/.pixi/env/Library/lib/pkgconfig" >> "$GITHUB_ENV"
# We manually pass in a checksum because it appears to be flaky on CI, occasionally
# downloading from sourceforge via insecure http without a checksum
# We also have to force powershell to use TLS1.2
# https://stackoverflow.com/a/41618979
- name: Install pkg-config
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
choco install pkgconfiglite -y --checksum 6004df17818f5a6dbf19cb335cc92702
- name: Install Python dependencies
shell: bash
run: |
python -V
python -m pip install maturin delvewheel
- name: Build
shell: bash
run: |
pixi run --manifest-path build/pixi.toml cd .. && maturin build --strip -o wheels-pre-repair
- name: Repair wheel
shell: bash
run: |
python -m delvewheel repair --add-path "$(pwd)/build/.pixi/env" --add-path "$(pwd)/build/.pixi/env/Library/bin" --namespace-pkg geoarrow --wheel-dir wheels wheels-pre-repair/*
- name: List wheels
shell: bash
run: find ./wheels
# Have to set path from root
# https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
- uses: actions/upload-artifact@v2
with:
path: python/geoarrow-proj/wheels/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
defaults:
run:
working-directory: python/geoarrow-proj
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.8"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build sdist
run: |
pip install -U build
python -m build --sdist
# Have to set path from root
# https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
- uses: actions/upload-artifact@v2
with:
path: python/geoarrow-proj/dist/*.tar.gz
# upload_pypi:
# needs:
# [
# build-wheel-manylinux2014,
# build-wheels-mac-x86,
# build-wheel-windows,
# build_sdist,
# ]
# runs-on: ubuntu-latest
# # Make sure we only run this on new tags/release
# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
# steps:
# - uses: actions/download-artifact@v2
# with:
# name: artifact
# path: dist
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD }}
# # To test: repository_url: https://test.pypi.org/legacy/