Skip to content
Merged
42 changes: 41 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -75,6 +75,46 @@ jobs:
cd geoarrow-pandas
pytest --pyargs geoarrow.pandas --doctest-modules --import-mode=importlib

# This is a test of geoarrow-types on Python 3.7 (which implies pyarrow 12
# since this is the last supported version there). Python 3.7 is still the
# runtime available on some hosted platforms (e.g., it is the minimum required
# version for apache-sedona Python)
oldest-supported:
runs-on: ubuntu-latest
container:
image: python:3.7

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
tags: true

- name: Check git setup
run: |
git config --global --add safe.directory "$(pwd)"
git describe --long --match='geoarrow-types-*'

# setuptools_scm available for Python 3.7 does not support version_file
# (it can still be installed on Python 3.7, it just can't be built there
# without this modification)
- name: Patch pyproject.toml
run: |
cd geoarrow-types
sed -i.bak '/^version_file/d' pyproject.toml
echo '__version__ = "0.0.0"' > src/geoarrow/types/_version.py
echo '__version_tuple__ = (0, 0, 0)' >> src/geoarrow/types/_version.py

- name: Install (geoarrow-types)
run: |
pip install --upgrade setuptools setuptools_scm
cd geoarrow-types
pip install ".[test]"

- name: Run tests (geoarrow-types)
run: |
pytest geoarrow-types/tests -v -s

coverage:
needs: [test]

Expand Down
4 changes: 2 additions & 2 deletions geoarrow-types/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ dynamic = ["version"]
description = ""
authors = [{name = "Dewey Dunnington", email = "[email protected]"}]
license = {text = "Apache-2.0"}
requires-python = ">=3.8"
requires-python = ">=3.7"
dependencies = []

[project.optional-dependencies]
test = ["pytest", "pyarrow"]
test = ["pytest", "pyarrow >= 12", "numpy"]

[project.urls]
homepage = "https://geoarrow.org"
Expand Down
9 changes: 8 additions & 1 deletion geoarrow-types/src/geoarrow/types/crs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from copy import deepcopy
import json
from typing import Union, Mapping, Protocol, Optional
from typing import Union, Mapping, Optional

try:
from typing import Protocol
except ImportError:

class Protocol:
pass


class Crs(Protocol):
Expand Down
8 changes: 8 additions & 0 deletions geoarrow-types/tests/test_type_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@


def test_wrap_array_non_exact():
pa_version_tuple = tuple(int(component) for component in pa.__version__.split("."))
if pa_version_tuple < (14,):
pytest.skip("wrap_array with non-exact type requires pyarrow >= 14")

from pyarrow import compute as pc

storage = pc.make_struct(
Expand Down Expand Up @@ -448,6 +452,10 @@ def test_roundtrip_extension_type(spec):


def test_register_extension_type():
pa_version_tuple = tuple(int(component) for component in pa.__version__.split("."))
if pa_version_tuple < (14,):
pytest.skip("Can't test extension type registration pyarrow < 14")

with type_pyarrow.registered_extension_types():
schema_capsule = gt.point().to_pyarrow().__arrow_c_schema__()
pa_type = pa.DataType._import_from_c_capsule(schema_capsule)
Expand Down
Loading