From e17e921795248f5bd202c0e54f102932a329e5b2 Mon Sep 17 00:00:00 2001 From: Matthew Plough Date: Fri, 2 Feb 2024 14:08:48 -0500 Subject: [PATCH 1/2] Stop using distutils for Python 3.12 compatibility --- pysheds/pgrid.py | 2 +- pysheds/pview.py | 2 +- pysheds/sview.py | 2 +- setup.py | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pysheds/pgrid.py b/pysheds/pgrid.py index 3a2ae13..4c2abd3 100644 --- a/pysheds/pgrid.py +++ b/pysheds/pgrid.py @@ -6,7 +6,7 @@ import pandas as pd import geojson from affine import Affine -from distutils.version import LooseVersion +from looseversion import LooseVersion try: import scipy.sparse import scipy.spatial diff --git a/pysheds/pview.py b/pysheds/pview.py index f515055..9d6e61b 100644 --- a/pysheds/pview.py +++ b/pysheds/pview.py @@ -3,7 +3,7 @@ from scipy import interpolate import pyproj from affine import Affine -from distutils.version import LooseVersion +from looseversion import LooseVersion _OLD_PYPROJ = LooseVersion(pyproj.__version__) < LooseVersion('2.2') _pyproj_init = '+init=epsg:4326' if _OLD_PYPROJ else 'epsg:4326' diff --git a/pysheds/sview.py b/pysheds/sview.py index a8e088d..0d09fbe 100644 --- a/pysheds/sview.py +++ b/pysheds/sview.py @@ -2,7 +2,7 @@ import numpy as np from . import projection from affine import Affine -from distutils.version import LooseVersion +from looseversion import LooseVersion try: import scipy.spatial _HAS_SCIPY = True diff --git a/setup.py b/setup.py index c5d799f..3f7dc00 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: GIS", "Topic :: Scientific/Engineering :: Hydrology", ], @@ -33,6 +34,7 @@ install_requires=[ "affine", "geojson", + "looseversion", "numba", "numpy", "pandas", From 8df5b2bb9496e9de2e0f593e58652d36febba419 Mon Sep 17 00:00:00 2001 From: Matthew Plough Date: Fri, 2 Feb 2024 14:10:03 -0500 Subject: [PATCH 2/2] Add 3.12 to CI --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 94055ef..9d5c4a8 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3