Skip to content

chore: Update + namespace nanoarrow #214

chore: Update + namespace nanoarrow

chore: Update + namespace nanoarrow #214

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.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: geoarrow/geoarrow-python
path: geoarrow-python
- 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 geoarrow-python/geoarrow-pyarrow
pip install ".[test]"
- name: Install (geoarrow-pandas)
run: |
pushd geoarrow-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 geoarrow-python/geoarrow-pyarrow/tests -v -s
- name: Run tests (geoarrow-pandas)
run: |
pytest geoarrow-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: |
pip install -e python/geoarrow-c/
- name: Coverage (geoarrow-c)
if: success() && matrix.python-version == '3.11'
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: Upload coverage to codecov
if: success() && matrix.python-version == '3.11'
uses: codecov/codecov-action@v2
with:
files: 'python/geoarrow-c/coverage.info,python/geoarrow-c/coverage.xml'
- name: Run doctests
if: success() && matrix.python-version == '3.11'
run: |
pushd python/geoarrow-c
pytest --pyargs geoarrow.c --doctest-modules