From 81a8201e67abe9d2faf701e8fc66347202a53b93 Mon Sep 17 00:00:00 2001 From: Emily Soth Date: Tue, 7 May 2024 15:55:03 -0700 Subject: [PATCH 1/4] update to cython 3 --- HISTORY.rst | 1 + pyproject.toml | 2 +- requirements.txt | 1 - setup.py | 5 +++-- src/pygeoprocessing/geoprocessing_core.pyx | 3 --- src/pygeoprocessing/routing/watershed.pyx | 2 -- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5be210b9..c665e882 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,6 +10,7 @@ Unreleased Changes called with an invalid resampling algorithm. We now fall back to the underlying GDAL functions' error messages. https://github.com/natcap/pygeoprocessing/issues/387 +* Updated to Cython 3. 2.4.3 (2024-03-06) ------------------ diff --git a/pyproject.toml b/pyproject.toml index a35f5e28..576ba958 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ # that we can provide a much easier build experience so long as GDAL is # available at runtime. requires = [ - 'setuptools', 'wheel', 'setuptools_scm', 'cython<3.0.0', 'oldest-supported-numpy' + 'setuptools', 'wheel', 'setuptools_scm', 'cython>=3.0.0', 'oldest-supported-numpy' ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 910f6861..3084426e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,6 @@ # -------------------- # This file records the packages and requirements needed in order for # pygeoprocessing to work as expected. -Cython<3.0.0 GDAL>=3.0.4 numpy>=1.10.1 Rtree>=0.8.3 diff --git a/setup.py b/setup.py index f8fee38c..61f8c6d2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ """setup.py module for PyGeoprocessing.""" import platform +from Cython.Build import cythonize import numpy from setuptools import setup from setuptools.extension import Extension @@ -62,7 +63,7 @@ 'Topic :: Scientific/Engineering :: GIS', 'License :: OSI Approved :: BSD License' ], - ext_modules=[ + ext_modules=cythonize([ Extension( name="pygeoprocessing.routing.routing", sources=["src/pygeoprocessing/routing/routing.pyx"], @@ -92,5 +93,5 @@ extra_link_args=compiler_and_linker_args, language="c++" ), - ] + ]) ) diff --git a/src/pygeoprocessing/geoprocessing_core.pyx b/src/pygeoprocessing/geoprocessing_core.pyx index 0b82085a..6b545f6d 100644 --- a/src/pygeoprocessing/geoprocessing_core.pyx +++ b/src/pygeoprocessing/geoprocessing_core.pyx @@ -1,6 +1,3 @@ -# coding=UTF-8 -# distutils: language=c++ -# cython: language_level=3 import logging import multiprocessing import os diff --git a/src/pygeoprocessing/routing/watershed.pyx b/src/pygeoprocessing/routing/watershed.pyx index c3287cef..e35590f4 100644 --- a/src/pygeoprocessing/routing/watershed.pyx +++ b/src/pygeoprocessing/routing/watershed.pyx @@ -1,5 +1,3 @@ -# coding=UTF-8 -# cython: language_level=3 import logging import os import shutil From c7658939c83f1a4586229b4771ab3ac6636195f0 Mon Sep 17 00:00:00 2001 From: Emily Soth Date: Wed, 8 May 2024 13:20:23 -0700 Subject: [PATCH 2/4] try removing python architecture from setup-python --- .github/workflows/build-py-dists.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-py-dists.yml b/.github/workflows/build-py-dists.yml index 0b968dcc..618cc018 100644 --- a/.github/workflows/build-py-dists.yml +++ b/.github/workflows/build-py-dists.yml @@ -9,7 +9,6 @@ jobs: matrix: os: [windows-latest, macos-latest] python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] - python-arch: [x64] steps: - uses: actions/checkout@v4 @@ -20,11 +19,10 @@ jobs: - name: Fetch git tags run: git fetch origin +refs/tags/*:refs/tags/* - - name: Set up python ${{ matrix.python-version }} ${{ matrix.python-arch }} + - name: Set up python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.python-arch }} - name: Install dependencies run: python -m pip install build @@ -34,7 +32,7 @@ jobs: - uses: actions/upload-artifact@v1 with: - name: Wheel for ${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.python-arch }} + name: Wheel for ${{ matrix.os }} ${{ matrix.python-version }} path: dist build-sdist: From a51da8411c3d6de4b879a85f8ad3cd8ef7e65be4 Mon Sep 17 00:00:00 2001 From: Emily Soth Date: Wed, 8 May 2024 14:08:24 -0700 Subject: [PATCH 3/4] remove python 7 from wheel builds --- .github/workflows/build-py-dists.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-py-dists.yml b/.github/workflows/build-py-dists.yml index 618cc018..2a9e4fd0 100644 --- a/.github/workflows/build-py-dists.yml +++ b/.github/workflows/build-py-dists.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, macos-latest] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -50,7 +50,7 @@ jobs: - name: Set up python uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.12 - name: Install dependencies run: python -m pip install build From d10c9207242e2a2e29c74207f491ef76b0f374af Mon Sep 17 00:00:00 2001 From: Emily Soth Date: Wed, 8 May 2024 17:05:29 -0700 Subject: [PATCH 4/4] drop python 3.7 --- HISTORY.rst | 1 + setup.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index c665e882..112de94e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -11,6 +11,7 @@ Unreleased Changes underlying GDAL functions' error messages. https://github.com/natcap/pygeoprocessing/issues/387 * Updated to Cython 3. +* Dropped support for Python 3.7. 2.4.3 (2024-03-06) ------------------ diff --git a/setup.py b/setup.py index 61f8c6d2..78d517ab 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,6 @@ 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft', 'Operating System :: POSIX', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10',