Repository: rasterio/rasterio

Issue:
DEP: python, numpy, GDAL versions for rasterio 1.4
Related #2064

- Python 3.9+ (https://numpy.org/neps/nep-0029-deprecation_policy.html)
- Numpy 1.21+
- GDAL 3.3+



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -136,8 +136,8 @@ def copy_data_tree(datadir, destdir):
     gdal_minor_version = int(gdal_minor_version)
     gdal_patch_version = int(gdal_patch_version)
 
-    if (gdal_major_version, gdal_minor_version) < (3, 1):
-        raise SystemExit("ERROR: GDAL >= 3.1 is required for rasterio. "
+    if (gdal_major_version, gdal_minor_version) < (3, 3):
+        raise SystemExit("ERROR: GDAL >= 3.3 is required for rasterio. "
                  "Please upgrade GDAL.")
 
 # Conditionally copy the GDAL data. To be used in conjunction with
@@ -267,7 +267,7 @@ def copy_data_tree(datadir, destdir):
     "certifi",
     "click>=4.0",
     "cligj>=0.5",
-    "numpy>=1.18",
+    "numpy>=1.21",
     "snuggs>=1.4.1",
     "click-plugins",
     "setuptools",
@@ -310,7 +310,6 @@ def copy_data_tree(datadir, destdir):
         "License :: OSI Approved :: BSD License",
         "Programming Language :: C",
         "Programming Language :: Cython",
-        "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: 3",
@@ -329,7 +328,7 @@ def copy_data_tree(datadir, destdir):
     zip_safe=False,
     install_requires=inst_reqs,
     extras_require=extra_reqs,
-    python_requires=">=3.8",
+    python_requires=">=3.9",
 )
 
 if os.environ.get('PACKAGE_DATA'):


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -53,14 +53,12 @@ jobs:
       fail-fast: false
       matrix:
         python-version: ['3.9', '3.10']
-        gdal-version: ['3.5.3', '3.6.1']
+        gdal-version: ['3.5.3', '3.6.2']
         include:
-          - python-version: '3.8'
+          - python-version: '3.9'
             gdal-version: '3.4.3'
-          - python-version: '3.8'
+          - python-version: '3.9'
             gdal-version: '3.3.3'
-          - python-version: '3.8'
-            gdal-version: '3.2.3'
 
     steps:
       - uses: actions/checkout@v3
@@ -104,7 +102,7 @@ jobs:
       fail-fast: true
       matrix:
         os: [macos-latest]
-        python-version: ['3.8' , '3.9']
+        python-version: ['3.9', '3.10']
         include:
           - os: ubuntu-latest
             python-version: '3.10'
diff --git a/tests/conftest.py b/tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -638,11 +638,6 @@ def __init__(self, geojson):
 # Define helpers to skip tests based on GDAL version
 gdal_version = GDALVersion.runtime()
 
-
-requires_gdal32 = pytest.mark.skipif(
-    not gdal_version.at_least('3.2'),
-    reason="Requires GDAL 3.2.x")
-
 requires_gdal33 = pytest.mark.skipif(
     not gdal_version.at_least('3.3'),
     reason="Requires GDAL 3.3.x")
diff --git a/tests/test__env.py b/tests/test__env.py
--- a/tests/test__env.py
+++ b/tests/test__env.py
@@ -34,8 +34,6 @@ def mock_fhs(tmpdir):
 @pytest.fixture
 def mock_debian(tmpdir):
     """A fake Debian multi-install system"""
-    tmpdir.ensure("share/gdal/3.1/header.dxf")
-    tmpdir.ensure("share/gdal/3.2/header.dxf")
     tmpdir.ensure("share/gdal/3.3/header.dxf")
     tmpdir.ensure("share/gdal/3.4/header.dxf")
     tmpdir.ensure("share/gdal/3.5/header.dxf")
diff --git a/tests/test_boundless_read.py b/tests/test_boundless_read.py
--- a/tests/test_boundless_read.py
+++ b/tests/test_boundless_read.py
@@ -137,7 +137,6 @@ def test_boundless_mask_not_all_valid():
     assert masked.mask[-1, :].all()
 
 
-@pytest.mark.xfail(reason="fill_value requires GDAL 3.1.4 or equivalent patches")
 def test_boundless_fill_value():
     """Confirm resolution of issue #1471"""
     with rasterio.open("tests/data/red.tif") as src:
@@ -168,7 +167,6 @@ def test_boundless_mask_special():
     assert not mask[-1, :].any()
 
 
-@pytest.mark.xfail(reason="fill_value requires GDAL 3.1.4 or equivalent patches")
 def test_boundless_fill_value_overview_masks():
     """Confirm a more general resolution to issue #1471"""
     with rasterio.open("tests/data/cogeo.tif") as src:
@@ -176,7 +174,6 @@ def test_boundless_fill_value_overview_masks():
     assert (data[:, 0] == 5).all()
 
 
-@pytest.mark.xfail(reason="fill_value requires GDAL 3.1.4 or equivalent patches")
 def test_boundless_masked_fill_value_overview_masks():
     """Confirm a more general resolution to issue #1471"""
     with rasterio.open("tests/data/cogeo.tif") as src:
diff --git a/tests/test_read_boundless.py b/tests/test_read_boundless.py
--- a/tests/test_read_boundless.py
+++ b/tests/test_read_boundless.py
@@ -146,13 +146,8 @@ def test_msk_read_masks(path_rgb_msk_byte_tif):
         assert msk.mean() > 90
 
 
-@pytest.mark.xfail(reason="GDAL 3.1 skips overviews because of background layer")
 def test_issue1982(capfd):
     """See a curl request for overview file"""
-    # Note: the underlying GDAL issue has been fixed after 3.1.3. The
-    # rasterio 1.1.6 wheels published to PyPI will include a patched
-    # 2.4.4 that also fixes the issue.  This test will XPASS in the
-    # rasterio-wheels tests.
     with rasterio.Env(CPL_CURL_VERBOSE=True), rasterio.open(
         "https://raw.githubusercontent.com/mapbox/rasterio/main/tests/data/green.tif"
     ) as src:
diff --git a/tests/test_rio_info.py b/tests/test_rio_info.py
--- a/tests/test_rio_info.py
+++ b/tests/test_rio_info.py
@@ -5,7 +5,7 @@
 import rasterio
 from rasterio.rio.main import main_group
 
-from .conftest import requires_gdal32, credentials
+from .conftest import credentials
 
 
 with rasterio.Env() as env:
@@ -422,7 +422,6 @@ def test_info_aws_unsigned(runner):
     assert result.exit_code == 0
 
 
-@requires_gdal32(reason="Unsigned Azure requests require GDAL ~= 3.2")
 @pytest.mark.network
 @pytest.mark.skip(reason="Undiagnosed problem accessing this file")
 def test_info_azure_unsigned(monkeypatch, runner):
diff --git a/tests/test_warp.py b/tests/test_warp.py
--- a/tests/test_warp.py
+++ b/tests/test_warp.py
@@ -1210,7 +1210,7 @@ def test_reproject_resampling(path_rgb_byte_tif, method):
         Resampling.cubic: [437888],
         Resampling.cubic_spline: [440475],
         Resampling.lanczos: [436001],
-        Resampling.average: [439419, 439172],  # latter value for GDAL 3.1
+        Resampling.average: [439172],
         Resampling.mode: [437298],
         Resampling.max: [439464],
         Resampling.min: [436397],
@@ -1303,7 +1303,7 @@ def test_reproject_resampling_alpha(method):
         Resampling.cubic: [437888],
         Resampling.cubic_spline: [440475],
         Resampling.lanczos: [436001],
-        Resampling.average: [439419, 439172],  # latter value for GDAL 3.1
+        Resampling.average: [439172],
         Resampling.mode: [437298],
         Resampling.max: [439464],
         Resampling.min: [436397],