Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to cython 3 #390

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python 3.7 is end-of-life, we already removed it from the test workflow. And setup-python couldn't find an ARM64 python 3.7 distribution.

python-arch: [x64]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python-arch isn't needed here, and it caused an issue with the new ARM64 mac runners.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet this is a holdover from when we were still doing x86 builds. Makes sense to remove!

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
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing testing/wheel-building support for python 3.7, should that also be noted here in HISTORY and also removed from the setup.py trove classifiers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh you're right


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
5 changes: 3 additions & 2 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 @@ -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"],
Expand Down Expand Up @@ -92,5 +93,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
Loading