summaryrefslogtreecommitdiff
path: root/dev-python/cftime
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/cftime')
-rw-r--r--dev-python/cftime/Manifest3
-rw-r--r--dev-python/cftime/cftime-1.6.2-r1.ebuild (renamed from dev-python/cftime/cftime-1.6.2.ebuild)6
-rw-r--r--dev-python/cftime/files/cftime-1.6.2-cython-3.patch34
3 files changed, 41 insertions, 2 deletions
diff --git a/dev-python/cftime/Manifest b/dev-python/cftime/Manifest
index fdaa3e1c82cf..28a4283b2898 100644
--- a/dev-python/cftime/Manifest
+++ b/dev-python/cftime/Manifest
@@ -1,3 +1,4 @@
+AUX cftime-1.6.2-cython-3.patch 1355 BLAKE2B 18574813e6a889e4161e4062bd3c6efba47526d90c9eb54b69083ea4fc37655cc2f84a7aeab914e5c3d706e0ecd9c16f3b0b48ffc691fff4860dcd01d5286c63 SHA512 6230c460abe67562de565e69eb138d3603c68f9ca848f2e180eaad691a0ee7df618218d40c3ccc35672f295eae0113cbbc9755aace960ce5b420b272534eca34
DIST cftime-1.6.2.tar.gz 52745 BLAKE2B f3e91585b40a981e1c752ec3f086a4611354e228592a1b581b05f003d68878245a8ab4fae332d9054c2a9e85ef921b9110a0f8473861bd3e4cc92c287259ad44 SHA512 d5135a55e5c9982247835e379bd35e4d8b47f0f70d08766f73223e0c40dc1875840c5cb40515e233196af1c10e992911325ff33a3c41efc3b8009e49de2a6e31
-EBUILD cftime-1.6.2.ebuild 712 BLAKE2B 145bb27257c5b4b28c4e9964f6a75825c5875af73e139e6a97286ad9b2f95598d47d5e1e827f9bf759178872ec29f3faea2ccefc2d17d66cbbd63d99cc72eec1 SHA512 2eb8902b2ce4236971b68f80ce542665fac7865ec1784062e1dbdccb47eab038f2b7a277fb0f23cc0417a1cacb02cc7d3131ea71f0ffffcf38c497c79a892e22
+EBUILD cftime-1.6.2-r1.ebuild 776 BLAKE2B 0663ad2af4dfa7ff07c8ddcc261114c5c84cf2f24ce538faf92fc8d30383eb133678af92f40a282b35b8ff042a26a55c9c9cd376e512c269331537eb907b4188 SHA512 06db37108b74d2f6598ee4ba061414258e31320c39a64dee38be7bd97bfb2327f7f7e70d6d4adecaa8cff1930c7861f7dc89b7bcf28d5d47f4494329da81ff0e
MISC metadata.xml 478 BLAKE2B 4999918d1667d93d5b8a38bc28b65255734bd11bcb9c56bcdd1920cfa7b3e1e9a5ce6751496e59dd914d1817bb3cf7fbb8a1c7a1a946c916f31dccb320c5a763 SHA512 af6b5275bb79ea316621108ce930d2a6aa3b7a42fa99b722573bcdae2c1488d3d2948c661dcf13cf50a35eb353ef125d47c387761ce1ea57cb6887349b5b0889
diff --git a/dev-python/cftime/cftime-1.6.2.ebuild b/dev-python/cftime/cftime-1.6.2-r1.ebuild
index c1341db6add8..c7709831ca42 100644
--- a/dev-python/cftime/cftime-1.6.2.ebuild
+++ b/dev-python/cftime/cftime-1.6.2-r1.ebuild
@@ -26,12 +26,16 @@ RDEPEND="
${DEPEND}
"
BDEPEND="
- <dev-python/cython-3[${PYTHON_USEDEP}]
+ >=dev-python/cython-0.29.20[${PYTHON_USEDEP}]
"
distutils_enable_tests pytest
python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}/${P}-cython-3.patch"
+ )
+
# remove pytest-cov dep
sed -e "/--cov/d" -i setup.cfg || die
diff --git a/dev-python/cftime/files/cftime-1.6.2-cython-3.patch b/dev-python/cftime/files/cftime-1.6.2-cython-3.patch
new file mode 100644
index 000000000000..c52ebdb3c84f
--- /dev/null
+++ b/dev-python/cftime/files/cftime-1.6.2-cython-3.patch
@@ -0,0 +1,34 @@
+From 31f782aed3de56300886dd7350f1faff657e14dd Mon Sep 17 00:00:00 2001
+From: Spencer Clark <spencerkclark@gmail.com>
+Date: Sat, 29 Jul 2023 09:51:10 -0400
+Subject: [PATCH] Set c_api_binop_methods compiler directive to True
+
+This retains Cython 0.x behavior for arithmetic operators for
+Cython >= 3.0.0.
+---
+ Changelog | 2 ++
+ pyproject.toml | 2 +-
+ requirements-dev.txt | 2 +-
+ setup.py | 9 ++++++++-
+ 4 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 006f1a92..360396fa 100644
+--- a/setup.py
++++ b/setup.py
+@@ -16,7 +16,14 @@
+ BASEDIR = os.path.abspath(os.path.dirname(__file__))
+ SRCDIR = os.path.join(BASEDIR,'src')
+ CMDS_NOCYTHONIZE = ['clean','clean_cython','sdist']
+-COMPILER_DIRECTIVES = {}
++COMPILER_DIRECTIVES = {
++ # Cython 3.0.0 changes the default of the c_api_binop_methods directive to
++ # False, resulting in errors in datetime and timedelta arithmetic:
++ # https://github.com/Unidata/cftime/issues/271. We explicitly set it to
++ # True to retain Cython 0.x behavior for future Cython versions. This
++ # directive was added in Cython version 0.29.20.
++ "c_api_binop_methods": True
++}
+ DEFINE_MACROS = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
+ FLAG_COVERAGE = '--cython-coverage' # custom flag enabling Cython line tracing
+ NAME = 'cftime'