Skip to content

Commit 53e5bd9

Browse files
authored
MAINT: drop support for GDAL < 3.6 (#584)
1 parent 56a5961 commit 53e5bd9

File tree

16 files changed

+33
-163
lines changed

16 files changed

+33
-163
lines changed

.github/workflows/docker-gdal.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626
- "ghcr.io/osgeo/gdal:ubuntu-small-3.8.5" # python 3.10.12
2727
- "ghcr.io/osgeo/gdal:ubuntu-small-3.7.3" # python 3.10.12
2828
- "ghcr.io/osgeo/gdal:ubuntu-small-3.6.4" # python 3.10.6
29-
- "osgeo/gdal:ubuntu-small-3.5.3" # python 3.10 (installed manually)
30-
- "osgeo/gdal:ubuntu-small-3.4.3" # python 3.10 (installed manually)
3129

3230
container:
3331
image: ${{ matrix.container }}
@@ -37,14 +35,14 @@ jobs:
3735
run: |
3836
apt-get update && apt-get install -y build-essential git python3-dev
3937
40-
- name: Install Python
41-
# the GDAL 3.4 and 3.5 images do have Python 3.8 installed, so have to
42-
# install a more recent Python version manually
43-
if: matrix.container == 'osgeo/gdal:ubuntu-small-3.5.3' || matrix.container == 'osgeo/gdal:ubuntu-small-3.4.3'
44-
run: |
45-
apt-get update && apt-get install -y software-properties-common
46-
add-apt-repository -y ppa:deadsnakes/ppa
47-
apt-get update && apt-get install -y python3.10-dev
38+
# - name: Install Python
39+
# # the GDAL 3.4 and 3.5 images do have Python 3.8 installed, so have to
40+
# # install a more recent Python version manually
41+
# if: matrix.container == 'osgeo/gdal:ubuntu-small-3.5.3' || matrix.container == 'osgeo/gdal:ubuntu-small-3.4.3'
42+
# run: |
43+
# apt-get update && apt-get install -y software-properties-common
44+
# add-apt-repository -y ppa:deadsnakes/ppa
45+
# apt-get update && apt-get install -y python3.9-dev
4846

4947
- uses: actions/checkout@v5
5048

@@ -63,13 +61,8 @@ jobs:
6361
- name: Install Python Dependencies
6462
run: |
6563
uv pip install -e .[dev,test,geopandas]
66-
67-
- name: Install pyarrow
68-
# GDAL>=3.6 required to use Arrow API
69-
if: matrix.container != 'osgeo/gdal:ubuntu-small-3.5.3' && matrix.container != 'osgeo/gdal:ubuntu-small-3.4.3'
70-
run: |
7164
uv pip install pyarrow
72-
65+
7366
- name: Test with pytest
7467
run: |
7568
pytest --cov=pyogrio --cov-report term-missing pyogrio/tests

.github/workflows/tests-conda.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ jobs:
3535
- os: "ubuntu-latest"
3636
python: "3.10"
3737
env: "minimal"
38-
# environment for older Windows libgdal to make sure gdal_i.lib is
39-
# properly detected
40-
- os: "windows-2022"
41-
python: "3.10"
42-
env: "libgdal3.5.1"
4338
# environment with nightly wheels
4439
- os: "ubuntu-latest"
4540
python: "3.11"

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Return JSON fields (as identified by GDAL) as dicts/lists in `read_dataframe`;
88
these were previously returned as strings (#556).
9+
- Drop support for GDAL 3.4 and 3.5 (#584).
910

1011
### Improvements
1112

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Read the documentation for more information:
2626

2727
## Requirements
2828

29-
Supports Python 3.10 - 3.14 and GDAL 3.4.x - 3.11.x.
29+
Supports Python 3.10 - 3.14 and GDAL 3.6.x - 3.11.x.
3030

3131
Reading to GeoDataFrames requires `geopandas>=0.12` with `shapely>=2`.
3232

ci/envs/libgdal3.5.1.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/source/install.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Requirements
44

5-
Supports Python 3.10 - 3.14 and GDAL 3.4.x - 3.11.x
5+
Supports Python 3.10 - 3.14 and GDAL 3.6.x - 3.11.x
66

77
Reading to GeoDataFrames requires `geopandas>=0.12` with `shapely>=2`.
88

@@ -132,20 +132,20 @@ To build on Windows, you need to provide additional environment variables or
132132
command-line parameters because the location of the GDAL binaries and headers
133133
cannot be automatically determined.
134134

135-
Assuming GDAL 3.4.1 is installed to `c:\GDAL`, you can set the `GDAL_INCLUDE_PATH`,
135+
Assuming GDAL 3.8.3 is installed to `c:\GDAL`, you can set the `GDAL_INCLUDE_PATH`,
136136
`GDAL_LIBRARY_PATH` and `GDAL_VERSION` environment variables and build as follows:
137137

138138
```bash
139139
set GDAL_INCLUDE_PATH=C:\GDAL\include
140140
set GDAL_LIBRARY_PATH=C:\GDAL\lib
141-
set GDAL_VERSION=3.4.1
141+
set GDAL_VERSION=3.8.3
142142
python -m pip install --no-deps --force-reinstall --no-use-pep517 -e . -v
143143
```
144144

145145
Alternatively, you can pass those options also as command-line parameters:
146146

147147
```bash
148-
python -m pip install --install-option=build_ext --install-option="-IC:\GDAL\include" --install-option="-lgdal_i" --install-option="-LC:\GDAL\lib" --install-option="--gdalversion=3.4.1" --no-deps --force-reinstall --no-use-pep517 -e . -v
148+
python -m pip install --install-option=build_ext --install-option="-IC:\GDAL\include" --install-option="-lgdal_i" --install-option="-LC:\GDAL\lib" --install-option="--gdalversion=3.8.3" --no-deps --force-reinstall --no-use-pep517 -e . -v
149149
```
150150

151151
The location of the GDAL DLLs must be on your system `PATH`.

pyogrio/_compat.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
pandas = None
3030

3131

32-
HAS_ARROW_API = __gdal_version__ >= (3, 6, 0)
3332
HAS_ARROW_WRITE_API = __gdal_version__ >= (3, 8, 0)
3433
HAS_PYARROW = pyarrow is not None
3534
HAS_PYPROJ = pyproj is not None
@@ -44,8 +43,6 @@
4443
PANDAS_GE_22 = pandas is not None and Version(pandas.__version__) >= Version("2.2.0")
4544
PANDAS_GE_30 = pandas is not None and Version(pandas.__version__) >= Version("3.0.0dev")
4645

47-
GDAL_GE_350 = __gdal_version__ >= (3, 5, 0)
48-
GDAL_GE_352 = __gdal_version__ >= (3, 5, 2)
4946
GDAL_GE_37 = __gdal_version__ >= (3, 7, 0)
5047
GDAL_GE_38 = __gdal_version__ >= (3, 8, 0)
5148
GDAL_GE_311 = __gdal_version__ >= (3, 11, 0)

pyogrio/_io.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,9 +1620,6 @@ def ogr_open_arrow(
16201620
cdef ArrowArrayStream* stream
16211621
cdef ArrowSchema schema
16221622

1623-
IF CTE_GDAL_VERSION < (3, 6, 0):
1624-
raise RuntimeError("Need GDAL>=3.6 for Arrow support")
1625-
16261623
if force_2d:
16271624
raise ValueError("forcing 2D is not supported for Arrow")
16281625

pyogrio/_ogr.pxd

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,14 +418,10 @@ cdef extern from "ogr_api.h":
418418
const char* OLCFastGetExtent
419419
const char* OLCTransactions
420420

421-
422-
IF CTE_GDAL_VERSION >= (3, 6, 0):
423-
424-
cdef extern from "ogr_api.h":
425-
bint OGR_L_GetArrowStream(
426-
OGRLayerH hLayer, ArrowArrayStream *out_stream, char** papszOptions
427-
)
428-
421+
cdef extern from "ogr_api.h":
422+
bint OGR_L_GetArrowStream(
423+
OGRLayerH hLayer, ArrowArrayStream *out_stream, char** papszOptions
424+
)
429425

430426
IF CTE_GDAL_VERSION >= (3, 8, 0):
431427

pyogrio/_ogr.pyx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import sys
3-
from uuid import uuid4
43
import warnings
54

65
from pyogrio._err cimport check_pointer
@@ -44,21 +43,16 @@ def get_gdal_version_string():
4443
return get_string(version)
4544

4645

47-
IF CTE_GDAL_VERSION >= (3, 4, 0):
48-
49-
cdef extern from "ogr_api.h":
50-
bint OGRGetGEOSVersion(int *pnMajor, int *pnMinor, int *pnPatch)
46+
cdef extern from "ogr_api.h":
47+
bint OGRGetGEOSVersion(int *pnMajor, int *pnMinor, int *pnPatch)
5148

5249

5350
def get_gdal_geos_version():
5451
cdef int major, minor, revision
5552

56-
IF CTE_GDAL_VERSION >= (3, 4, 0):
57-
if not OGRGetGEOSVersion(&major, &minor, &revision):
58-
return None
59-
return (major, minor, revision)
60-
ELSE:
53+
if not OGRGetGEOSVersion(&major, &minor, &revision):
6154
return None
55+
return (major, minor, revision)
6256

6357

6458
def set_gdal_config_options(dict options):
@@ -167,7 +161,7 @@ def get_gdal_data_path():
167161
"""
168162
cdef const char *path_c = CPLFindFile("gdal", "header.dxf")
169163
if path_c != NULL:
170-
return get_string(path_c).rstrip("header.dxf")
164+
return get_string(path_c).replace("header.dxf", "")
171165
return None
172166

173167

0 commit comments

Comments
 (0)