DEP: Python 3.10+ & GDAL 3.6+ (#3440)

This commit is contained in:
Alan D. Snow 2025-12-05 08:47:04 -06:00 committed by GitHub
parent e8d7e445f8
commit 9880c5c40f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 23 additions and 32 deletions

View File

@ -97,23 +97,21 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
gdal-version: ['3.11.5']
include:
- python-version: '3.14'
gdal-version: 'latest'
- python-version: '3.9'
- python-version: '3.10'
gdal-version: '3.10.3'
- python-version: '3.9'
- python-version: '3.10'
gdal-version: '3.9.3'
- python-version: '3.9'
- python-version: '3.10'
gdal-version: '3.8.5'
- python-version: '3.9'
- python-version: '3.10'
gdal-version: '3.7.3'
- python-version: '3.9'
- python-version: '3.10'
gdal-version: '3.6.4'
- python-version: '3.9'
gdal-version: '3.5.3'
steps:
- uses: actions/checkout@v6
@ -157,7 +155,7 @@ jobs:
# macos-15-intel is OSX Intel
# macos-14 is OSX Arm64
os: [macos-15-intel, macos-14]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
include:
- os: ubuntu-latest
python-version: '*'

View File

@ -122,7 +122,7 @@ C extension modules are written using `Cython <http://cython.org/>`__. The
Cython language is a superset of Python. Cython files end with ``.pyx`` and
``.pxd`` and are where we keep all the code that calls GDAL's C functions.
Rasterio works with Python versions 3.6 through 3.9.
Rasterio works with Python versions 3.10 through 3.14.
We strongly prefer code adhering to `PEP8
<https://www.python.org/dev/peps/pep-0008/>`__.
@ -161,7 +161,7 @@ Developing Rasterio requires Python 3.6 or any final release after and
including 3.10. We prefer developing with the most recent version of Python
but recognize this is not possible for all contributors. A C compiler is also
required to leverage `existing protocols
<https://docs.python.org/3.5/extending/extending.html>`__ for extending Python
<https://docs.python.org/3.10/extending/extending.html>`__ for extending Python
with C or C++. See the Windows install instructions in the `readme
<README.rst>`__ for more information about building on Windows.

View File

@ -1,6 +1,6 @@
ARG GDAL=ubuntu-small-3.6.4
FROM ghcr.io/osgeo/gdal:${GDAL} AS gdal
ARG PYTHON_VERSION=3.9
ARG PYTHON_VERSION=3.10
ENV LANG="C.UTF-8" LC_ALL="C.UTF-8"
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa

View File

@ -1,4 +1,4 @@
PYTHON_VERSION ?= 3.9
PYTHON_VERSION ?= 3.10
GDAL ?= ubuntu-small-3.6.4
all: deps clean install test

View File

@ -20,7 +20,7 @@ Geographic information systems use GeoTIFF and other formats to organize and
store gridded, or raster, datasets. Rasterio reads and writes these formats and
provides a Python API based on N-D arrays.
Rasterio 1.4 works with Python >= 3.9, Numpy >= 1.24, and GDAL >= 3.5. Official
Rasterio 1.4.4+ works with Python >= 3.10, Numpy >= 1.24, and GDAL >= 3.6. Official
binary packages for Linux, macOS, and Windows with most built-in format drivers
plus HDF5, netCDF, and OpenJPEG2000 are available on PyPI.

View File

@ -27,7 +27,7 @@ optional format drivers.
Many users find Anaconda and conda-forge a good way to install Rasterio and get
access to more optional format drivers (like TileDB and others).
Rasterio 1.4 requires Python 3.9 or higher and GDAL 3.5 or higher.
Rasterio 1.4.4+ requires Python 3.10 or higher and GDAL 3.5 or higher.
Advanced installation
=====================

View File

@ -348,16 +348,6 @@ def rasterize(
values_arr = np.array(shape_values)
dtype = values_arr.dtype.name
# GDAL 3.5 doesn't support int64 output. We'll try int32.
if dtype not in valid_dtypes and dtype.startswith("int"):
lo, hi = values_arr.min(), values_arr.max()
if -2147483648 <= lo and hi <= 2147483647:
dtype = "int32"
elif 0 <= lo and hi <= 4294967295:
dtype = "uint32"
else:
raise ValueError("GDAL versions < 3.6 cannot rasterize int64 values.")
with ExitStack() as exit_stack:
if dst_path is not None:
if isinstance(dst_path, DatasetWriter):

View File

@ -133,8 +133,8 @@ if "clean" not in sys.argv:
int, re.findall("[0-9]+", gdalversion)[:3]
)
if (gdal_major_version, gdal_minor_version) < (3, 5):
raise SystemExit("ERROR: GDAL >= 3.5 is required for rasterio. "
if (gdal_major_version, gdal_minor_version) < (3, 6):
raise SystemExit("ERROR: GDAL >= 3.6 is required for rasterio. "
"Please upgrade GDAL.")
# Conditionally copy the GDAL data. To be used in conjunction with
@ -297,7 +297,6 @@ setup_args = dict(
"License :: OSI Approved :: BSD License",
"Programming Language :: C",
"Programming Language :: Cython",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@ -319,7 +318,7 @@ setup_args = dict(
zip_safe=False,
install_requires=inst_reqs,
extras_require=extra_reqs,
python_requires=">=3.9",
python_requires=">=3.10",
)
if os.environ.get('PACKAGE_DATA'):

View File

@ -34,8 +34,13 @@ def mock_fhs(tmpdir):
@pytest.fixture
def mock_debian(tmpdir):
"""A fake Debian multi-install system"""
tmpdir.ensure("share/gdal/3.5/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.6/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.7/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.8/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.9/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.10/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.11/gdalvrt.xsd")
tmpdir.ensure("share/gdal/3.12/gdalvrt.xsd")
tmpdir.ensure(f"share/gdal/{gdal_version.major}.{gdal_version.minor}/gdalvrt.xsd")
tmpdir.ensure("share/proj/epsg")
return tmpdir

View File

@ -2487,8 +2487,7 @@ def test_geoloc_warp_dataset(data, tmp_path):
# MEM:::DATAPOINTER=137539856,PIXELS=791,LINES=718,BANDS=3,DATATYPE=Byte.
# There is no affine transformation and no GCPs. Specify transformation
# option SRC_METHOD=NO_GEOTRANSFORM to bypass this check.
@pytest.mark.skipif(not gdal_version.at_least("3.6"), reason="Requires GDAL 3.6")
def test_geoloc_warp_array(path_rgb_byte_tif, tmp_path):
def test_geoloc_warp_array(path_rgb_byte_tif):
"""Warp an array using external geolocation arrays."""
with rasterio.open(path_rgb_byte_tif) as src:
xs, ys = src.transform * np.meshgrid(