Skip to content

Commit

Permalink
python proj wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Jan 23, 2024
1 parent 835db98 commit 569b42a
Show file tree
Hide file tree
Showing 5 changed files with 435 additions and 1,436 deletions.
244 changes: 244 additions & 0 deletions .github/workflows/python-proj-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
name: Python (PROJ) Wheels

on:
push:
# tags:
# - "py-v*"

jobs:
build-wheel-manylinux2014:
name: "Build manylinux2014 wheels"
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64

# NOTE: We abstain from most reusable github actions given that this is running in a docker
# image
steps:
- uses: actions/checkout@v3

- name: Install latest stable rust
run: |
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain stable -y
- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git
yum install perl-IPC-Cmd curl zip unzip tar -y
./vcpkg/bootstrap-vcpkg.sh
- name: Install PROJ
run: |
./vcpkg/vcpkg install proj
- name: Install dependencies
run: |
export PATH="/opt/python/cp38-cp38/bin/:$PATH"
pip install -U pip
pip install maturin
# - name: Copy PROJ_DATA into current tree
# run: |
# export PROJ_DIR=/project/pyproj/proj_dir
# /opt/python/cp38-cp38/bin/python scripts/copy-proj-data.py
# ls python/geopolars/proj_data/

# --release
- name: Build Python wheel
shell: bash
run: |
source $HOME/.cargo/env
export PATH="/opt/python/cp38-cp38/bin/:$PATH"
export PKG_CONFIG_PATH="./vcpkg/installed/x64-linux/lib/pkgconfig/:$PKG_CONFIG_PATH"
python -m maturin build --strip --interpreter /opt/python/cp38-cp38/bin/python --manylinux 2014 -o dist
- name: List wheels
run: find ./dist

# Have to set path from root
# https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
- uses: actions/upload-artifact@v2
with:
path: dist/*.whl

# macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-python@v4
# with:
# python-version: 3.8
# architecture: x64

# - uses: dtolnay/rust-toolchain@stable

# - name: Build wheels - x86_64
# uses: PyO3/maturin-action@v1
# with:
# target: x86_64
# args: --release --out dist --sdist -m python/core/Cargo.toml

# - name: Install built wheel - x86_64
# run: |
# pip install geoarrow-rust-core --no-index --find-links dist --force-reinstall
# python -c "import geoarrow.rust.core"

# - name: Build wheels - universal2
# uses: PyO3/maturin-action@v1
# with:
# target: universal2-apple-darwin
# args: --release --out dist -m python/core/Cargo.toml

# - name: Install built wheel - universal2
# run: |
# pip install geoarrow-rust-core --no-index --find-links dist --force-reinstall
# python -c "import geoarrow.rust.core"

# # Have to set path from root
# # https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist

# windows:
# runs-on: windows-latest
# strategy:
# matrix:
# target: [x64, x86]
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-python@v4
# with:
# python-version: 3.8
# architecture: ${{ matrix.target }}

# - uses: dtolnay/rust-toolchain@stable

# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# args: --release --out dist -m python/core/Cargo.toml

# - name: Install built wheel
# run: |
# pip install geoarrow-rust-core --no-index --find-links dist --force-reinstall
# python -c "import geoarrow.rust.core"

# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist/*.whl

# # NOTE: musllinux builds are commented out because importing them failed with:
# # ImportError: Error loading shared library libgcc_s-60abea67.so.1: No such file or directory

# # musllinux:
# # runs-on: ubuntu-latest
# # strategy:
# # matrix:
# # target:
# # - x86_64-unknown-linux-musl
# # - i686-unknown-linux-musl
# # steps:
# # - uses: actions/checkout@v4
# # - uses: actions/setup-python@v4
# # with:
# # python-version: 3.8
# # architecture: x64

# # - name: Build wheels
# # uses: PyO3/maturin-action@v1
# # with:
# # target: ${{ matrix.target }}
# # manylinux: musllinux_1_2
# # args: --release --out dist -m python/core/Cargo.toml

# # - name: Install built wheel
# # if: matrix.target == 'x86_64-unknown-linux-musl'
# # uses: addnab/docker-run-action@v3
# # with:
# # image: alpine:latest
# # options: -v ${{ github.workspace }}:/io -w /io
# # run: |
# # apk add py3-pip
# # pip3 install -U pip
# # pip3 install geoarrow-rust-core --no-index --find-links /io/dist/ --force-reinstall
# # python3 -c "import geoarrow.rust.core"

# # - name: Upload wheels
# # uses: actions/upload-artifact@v3
# # with:
# # name: wheels
# # path: dist

# # musllinux-cross:
# # runs-on: ubuntu-latest
# # strategy:
# # matrix:
# # platform:
# # - target: aarch64-unknown-linux-musl
# # arch: aarch64
# # - target: armv7-unknown-linux-musleabihf
# # arch: armv7

# # steps:
# # - uses: actions/checkout@v4

# # - uses: actions/setup-python@v4
# # with:
# # python-version: 3.8

# # - name: Build wheels
# # uses: PyO3/maturin-action@v1
# # with:
# # target: ${{ matrix.platform.target }}
# # manylinux: musllinux_1_2
# # args: --release --out dist -m python/core/Cargo.toml

# # - uses: uraimo/[email protected]
# # name: Install built wheel
# # with:
# # arch: ${{ matrix.platform.arch }}
# # distro: alpine_latest
# # githubToken: ${{ github.token }}
# # install: |
# # apk add py3-pip
# # pip3 install -U pip
# # run: |
# # pip3 install geoarrow-rust-core --no-index --find-links dist/ --force-reinstall
# # python3 -c "import geoarrow.rust.core"

# # - name: Upload wheels
# # uses: actions/upload-artifact@v3
# # with:
# # name: wheels
# # path: dist

# release:
# name: Release
# environment:
# name: release
# url: https://pypi.org/p/geoarrow-rust-core
# permissions:
# # IMPORTANT: this permission is mandatory for trusted publishing
# id-token: write
# runs-on: ubuntu-latest
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# needs: [macos, windows, linux, linux-cross]
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: wheels
# path: dist

# - uses: actions/setup-python@v4
# with:
# python-version: 3.8

# # - name: Publish package distributions to PyPI
# # uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit 569b42a

Please sign in to comment.