Skip to content

Unpin pyarrow version #178

Unpin pyarrow version

Unpin pyarrow version #178

Workflow file for this run

name: test-python
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- '.github/workflows/python.yaml'
- 'src/geoarrow/**'
- 'python/**'
jobs:
test-python:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install (geoarrow-c)
run: |
pushd python/geoarrow-c
pip install ".[test]"
- name: Install (geoarrow-pyarrow)
run: |
pushd python/geoarrow-pyarrow
pip install ".[test]"
- name: Install (geoarrow-pandas)
run: |
pushd python/geoarrow-pandas
pip install ".[test]"
- name: Run tests (geoarrow-c)
run: |
pytest python/geoarrow-c/tests -v -s
- name: Run tests (geoarrow-pyarrow)
run: |
pytest python/geoarrow-pyarrow/tests -v -s
- name: Run tests (geoarrow-pandas)
run: |
pytest python/geoarrow-pandas/tests -v -s
- name: Install coverage dependencies
run: |
sudo apt-get install -y lcov
pip install pytest-cov Cython
- name: Install editable
run: |
for pkg in c pyarrow pandas; do
pip install -e python/geoarrow-$pkg/
done
- name: Coverage (geoarrow-c)
if: success() && matrix.python-version == '3.10'
run: |
pushd python/geoarrow-c
# Build with Cython + gcc coverage options
GEOARROW_COVERAGE=1 python setup.py build_ext --inplace
# Run tests
python -m pytest --cov ./src/geoarrow ..
# Generate xml Python coverage
python -m coverage xml
# Generate C coverage
lcov \
--capture --directory build \
--exclude "/usr/*" \
--exclude "/opt/*" \
--exclude "/Library/*" \
--exclude "*/_lib.cpp" \
--exclude "*/src/geoarrow/c/geoarrow/*" \
--output-file=coverage.info
lcov --list coverage.info
popd
- name: Coverage (geoarrow-pyarrow, geoarrow-pandas)
if: success() && matrix.python-version == '3.10'
run: |
# Have to install non-editable geoarrow-c or xml generation will not work
# because it gets confused about the .pxd file
pip uninstall --yes geoarrow-c
pip install python/geoarrow-c/
pushd python/geoarrow-pyarrow
python -m pytest --cov ./src/geoarrow ..
python -m coverage xml
popd
pushd python/geoarrow-pandas
python -m pytest --cov ./src/geoarrow ..
python -m coverage xml
popd
- name: Upload coverage to codecov
if: success() && matrix.python-version == '3.10'
uses: codecov/codecov-action@v2
with:
files: 'python/geoarrow-c/geoarrow-coverage.info,python/geoarrow-c/coverage.xml,python/geoarrow-pyarrow/coverage.xml,python/geoarrow-pandas/coverage.xml'
- name: Run doctests
if: success() && matrix.python-version == '3.10'
run: |
# Because of namespace packaging we have to add __init__.py in geoarrow and
# rebuild to avoid confusing pytest
for pkg in c pyarrow pandas; do
pushd python/geoarrow-$pkg
touch src/geoarrow/__init__.py
pip uninstall --yes geoarrow-$pkg
pip install .
pytest --pyargs geoarrow.$pkg --doctest-modules
popd
done