Skip to content

Commit

Permalink
[SEDONA-227] Implemented Python geometry serializer as a native exten…
Browse files Browse the repository at this point in the history
…sion (#767)
  • Loading branch information
Kontinuation authored and zzs-wherobots committed Feb 19, 2023
1 parent b9a1b91 commit 9fdab1e
Show file tree
Hide file tree
Showing 17 changed files with 3,161 additions and 612 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/python-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Python build extension

on:
push:
branches:
- master
pull_request:
branches:
- '*'

jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
python: ['3.10', '3.9', '3.8']

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install pipenv
run: pip install -U pipenv
- name: Install dependencies
run: |
cd python
pipenv --python ${{ matrix.python }}
pipenv install --dev
- name: Build extension
run: |
cd python
pipenv run python setup.py build_ext --inplace
- name: Run tests
run: |
cd python
pipenv run pytest tests/utils/test_geomserde_speedup.py
- name: Run tests on Shapely 2.0
run: |
cd python
pipenv install shapely~=2.0
pipenv run pytest tests/utils/test_geomserde_speedup.py
- name: Run tests on Shapley 1.7
# Shapely 1.7 only provides wheels for cp36 ~ cp39, so we'll skip running
# this test for recent python versions.
if: ${{ matrix.python == '3.9' || matrix.python == '3.8' }}
run: |
cd python
pipenv install shapely~=1.7
pipenv run pytest tests/utils/test_geomserde_speedup.py
33 changes: 33 additions & 0 deletions .github/workflows/python-wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python build wheels

on:
push:
branches:
- master
pull_request:
branches:
- '*'

jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
env:
CIBW_SKIP: 'pp* *musl*'
CIBW_ARCHS: 'auto64'
with:
package-dir: python
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
3 changes: 2 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ jobs:
SPARK_VERSION: ${{ matrix.spark }}
HADOOP_VERSION: ${{ matrix.hadoop }}
run: tar -xzf spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz
- run: sudo apt-get -y install python3-pip python-dev libgeos-dev
- run: sudo apt-get -y install python3-pip python-dev
- run: sudo pip3 install -U setuptools
- run: sudo pip3 install -U wheel
- run: sudo pip3 install -U virtualenvwrapper
- run: python3 -m pip install pipenv
- run: cd python; python3 setup.py build_ext --inplace
- env:
SPARK_VERSION: ${{ matrix.spark }}
PYTHON_VERSION: ${{ matrix.python }}
Expand Down
Loading

0 comments on commit 9fdab1e

Please sign in to comment.