From e729ca057f1488f98366d8efcb855e244c13b07e Mon Sep 17 00:00:00 2001 From: James Douglass Date: Fri, 16 Feb 2024 09:35:27 -0800 Subject: [PATCH 1/4] Adding python 3.12 to github actions, setup.py and noting change in HISTORY. --- .github/workflows/pythonpackage.yml | 4 ++-- HISTORY.rst | 2 ++ setup.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 24f3c45f..5471dc0a 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -13,8 +13,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] - gdal: ["3.2.2", "3.3.0", "3.4.3", "3.5", "3.6", "3.7"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + gdal: ["3.2.2", "3.3.0", "3.4.3", "3.5", "3.6", "3.7", "3.8"] os: [ubuntu-latest, windows-latest, macos-latest] exclude: - gdal: "3.2.2" diff --git a/HISTORY.rst b/HISTORY.rst index 4825b6ea..37ea03d1 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -20,6 +20,8 @@ Unreleased Changes provided instead of a vector. If both are provided, the mask raster alone is used. The new mask raster must have the same dimensions and geotransform as the output warped raster. https://github.com/natcap/pygeoprocessing/issues/366 +* Pygeoprocessing is now tested against python 3.12. + https://github.com/natcap/pygeoprocessing/issues/355 2.4.2 (2023-10-24) ------------------ diff --git a/setup.py b/setup.py index ddf635cc..f8fee38c 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Scientific/Engineering :: GIS', 'License :: OSI Approved :: BSD License' From 36d89074671c216e58541f1ed4dc459dd0930db4 Mon Sep 17 00:00:00 2001 From: James Douglass Date: Fri, 16 Feb 2024 09:44:22 -0800 Subject: [PATCH 2/4] AssertEquals was removed in python 3.12. RE:#355 --- tests/test_geoprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_geoprocessing.py b/tests/test_geoprocessing.py index f5a79ca3..05bf229a 100644 --- a/tests/test_geoprocessing.py +++ b/tests/test_geoprocessing.py @@ -4180,7 +4180,7 @@ def test_align_and_resize_raster_stack_int_with_vector_mask(self): # have valid data. self.assertTrue(os.path.exists(mask_raster_path)) mask_array = pygeoprocessing.raster_to_numpy_array(mask_raster_path) - self.assertEquals(mask_array.sum(), 1) + self.assertEqual(mask_array.sum(), 1) numpy.testing.assert_allclose(target_array[mask_array.astype(bool)], 1) def test_align_and_resize_raster_stack_int_with_vector_mask_bb(self): From c70cf4165a0ecb84c4177b7d7cbb996ede3c8a46 Mon Sep 17 00:00:00 2001 From: James Douglass Date: Fri, 16 Feb 2024 09:47:24 -0800 Subject: [PATCH 3/4] Excluding older gdal versions from build matrix for py3.12. RE:#355 --- .github/workflows/pythonpackage.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 5471dc0a..3ecfc9e9 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -21,12 +21,20 @@ jobs: python-version: 3.10 - gdal: "3.2.2" python-version: 3.11 + - gdal: "3.2.2" + python-version: 3.12 - gdal: "3.3.0" python-version: 3.10 - gdal: "3.3.0" python-version: 3.11 + - gdal: "3.3.0" + python-version: 3.12 - gdal: "3.4.3" python-version: 3.11 + - gdal: "3.4.3" + python-version: 3.12 + - gdal: "3.5" + python-version: 3.12 steps: - uses: actions/checkout@v3 From c0c60145e56a9b1237e964980a5aa84040b0a5ed Mon Sep 17 00:00:00 2001 From: James Douglass Date: Fri, 16 Feb 2024 09:54:46 -0800 Subject: [PATCH 4/4] Updating to checkout v4 due to deprecation warnings in GHA. RE:#355 --- .github/workflows/build-py-dists.yml | 4 ++-- .github/workflows/pythonpackage.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-py-dists.yml b/.github/workflows/build-py-dists.yml index 4ad0f2ee..d55379b2 100644 --- a/.github/workflows/build-py-dists.yml +++ b/.github/workflows/build-py-dists.yml @@ -12,7 +12,7 @@ jobs: python-arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Fetch all history so that setuptools_scm can build the correct version string. fetch-depth: 0 @@ -41,7 +41,7 @@ jobs: name: Source Dist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Fetch all history so that setuptools_scm can build the correct version string. fetch-depth: 0 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 3ecfc9e9..fb2dae0a 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -37,7 +37,7 @@ jobs: python-version: 3.12 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Fetch all history so that setuptool_scm can build the correct # version string.