Skip to content

Commit

Permalink
Merge pull request #390 from emlys/task/update-cython
Browse files Browse the repository at this point in the history
update to cython 3
  • Loading branch information
phargogh authored May 9, 2024
2 parents c4a8830 + d10c920 commit 1e2de27
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build-py-dists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +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-arch: [x64]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -52,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
Expand Down
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ 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.
* Dropped support for Python 3.7.
2.4.3 (2024-03-06)
------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -52,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',
Expand All @@ -62,7 +62,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"],
Expand Down Expand Up @@ -92,5 +92,5 @@
extra_link_args=compiler_and_linker_args,
language="c++"
),
]
])
)
3 changes: 0 additions & 3 deletions src/pygeoprocessing/geoprocessing_core.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# coding=UTF-8
# distutils: language=c++
# cython: language_level=3
import logging
import multiprocessing
import os
Expand Down
2 changes: 0 additions & 2 deletions src/pygeoprocessing/routing/watershed.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding=UTF-8
# cython: language_level=3
import logging
import os
import shutil
Expand Down

0 comments on commit 1e2de27

Please sign in to comment.