From 574e1753f4152794cfa32ae3d6460116abb784ac Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Mon, 31 Jul 2023 18:13:07 +0000 Subject: Adding metadata --- dev-python/cftime/cftime-1.6.2-r1.ebuild | 43 ++++++++++++++++++++++ dev-python/cftime/cftime-1.6.2.ebuild | 39 -------------------- .../cftime/files/cftime-1.6.2-cython-3.patch | 34 +++++++++++++++++ 3 files changed, 77 insertions(+), 39 deletions(-) create mode 100644 dev-python/cftime/cftime-1.6.2-r1.ebuild delete mode 100644 dev-python/cftime/cftime-1.6.2.ebuild create mode 100644 dev-python/cftime/files/cftime-1.6.2-cython-3.patch (limited to 'dev-python/cftime') diff --git a/dev-python/cftime/cftime-1.6.2-r1.ebuild b/dev-python/cftime/cftime-1.6.2-r1.ebuild new file mode 100644 index 000000000000..22b7082b8fd5 --- /dev/null +++ b/dev-python/cftime/cftime-1.6.2-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 2020-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{7,8,9,10,11} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Time-handling functionality from netcdf4-python" +HOMEPAGE=" + https://github.com/Unidata/cftime/ + https://pypi.org/project/cftime/ +" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~riscv ~x86" + +DEPEND=" + >=dev-python/numpy-1.13.4[${PYTHON_USEDEP}] +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + >=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 + + distutils-r1_python_prepare_all +} diff --git a/dev-python/cftime/cftime-1.6.2.ebuild b/dev-python/cftime/cftime-1.6.2.ebuild deleted file mode 100644 index 3889ef671ba2..000000000000 --- a/dev-python/cftime/cftime-1.6.2.ebuild +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_EXT=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{7,8,9,10,11} ) - -inherit distutils-r1 pypi - -DESCRIPTION="Time-handling functionality from netcdf4-python" -HOMEPAGE=" - https://github.com/Unidata/cftime/ - https://pypi.org/project/cftime/ -" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~amd64 ~riscv ~x86" - -DEPEND=" - >=dev-python/numpy-1.13.4[${PYTHON_USEDEP}] -" -RDEPEND=" - ${DEPEND} -" -BDEPEND=" - +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' -- cgit v1.3.1