Compare commits

...

48 Commits

Author SHA1 Message Date
David Abdurachmanov 06b523ed6b
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-12-05 10:02:24 +02:00
Miro Hrončok 704bbe1117 Fix C++17 error: standard attributes in middle of decl-specifiers (CYTHON_UNUSED)
This is only relevant on Python 3.13+

Fixes (part of) https://bugzilla.redhat.com/2247486
2023-11-06 11:37:34 +01:00
Miro Hrončok 5907573e25 Convert to pyproject-rpm-macros 2023-10-31 17:07:38 +01:00
Miro Hrončok 86fdd7be24 Update to 3.0.5 2023-10-31 17:06:56 +01:00
David Abdurachmanov fe05ef1471
Bootstrap for Python 3.12 on riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-10-21 10:27:42 +03:00
Miro Hrončok b652c0db5c Update to 3.0.4 2023-10-18 20:12:46 +02:00
Miro Hrončok 816bc6d12f Add more optional test dependencies to run more tests 2023-10-18 00:29:48 +02:00
Miro Hrončok 2323ac7d60 Exclude gil_in_var on i686 2023-10-18 00:29:48 +02:00
Miro Hrončok 7b55261c3d Add upstream link to the comment about skipped pstats profile tests 2023-10-13 15:00:24 +02:00
Miro Hrončok 7cb8cd1040 Update to 3.0.3 2023-10-13 12:15:25 +02:00
Miro Hrončok 8319632a82 Update to 3.0.2 2023-09-01 16:14:25 +02:00
Miro Hrončok 14926296e2 Rename python3-Cython to python3-cython 2023-07-19 07:00:16 +02:00
Miro Hrončok 87851c9fe5 Add more optional test deps 2023-07-19 07:00:16 +02:00
Miro Hrončok 1f32e41a7e Exclude tests failing on Python 3.12 2023-07-19 07:00:16 +02:00
Miro Hrončok d2e6364600 Update to 3.0.0 2023-07-19 07:00:16 +02:00
Tomáš Hrnčiar 47185aeaea Update to 3.0.0rc2 2023-07-19 07:00:16 +02:00
Petr Viktorin c6b945e9de Backport compile-time Python 3.12 compatibility for CYTHON_TRACE support 2023-06-30 16:52:02 +02:00
Miro Hrončok 5bbbb81a09 Bootstrap Python 3.12 with 0.29.35 2023-06-18 18:31:49 +02:00
Python Maint 4a30dd7e93 Rebuilt for Python 3.12 2023-06-16 08:21:08 +02:00
Python Maint 1c3444e22e Bootstrap for Python 3.12 2023-06-13 20:25:36 +02:00
Miro Hrončok e08af6dcb7 Use a consistent %bcond syntax 2023-05-26 19:01:26 +02:00
Miro Hrončok 1e9bead9ab Stop shipping emacs-cython-mode in RHEL builds 2023-05-26 19:01:26 +02:00
Yaakov Selkowitz 5cc48f1485 Avoid python-jedi dependency in RHEL builds
python-jedi is unwanted in RHEL; the tests which use it are skipped
if absent, see the comment for details.

Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2023-05-26 10:42:42 +02:00
Miro Hrončok 5c173e36d1 Update to 0.29.34
Includes fixes for Python 3.12.0a5 and a6.
2023-04-03 08:21:24 +02:00
Miro Hrončok d55635fb41 Update the RPM license tag to SPDX 2023-02-17 17:47:57 +01:00
Miro Hrončok d52e2fc9c5 Update to 0.29.33 2023-02-17 17:46:58 +01:00
Fedora Release Engineering 92cc956a76 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-18 19:43:47 +00:00
Miro Hrončok 4c46cbf0e0 emacs-cython-mode: Wrap the docstring of cython-default-compile-format to 80 characters
Fixes: https://bugzilla.redhat.com/2155090
2022-12-20 01:14:01 +01:00
Miro Hrončok 7b06dc068d Avoid RPM warning
warning: line 71: Possible unexpanded macro in: Requires:       emacs(bin) >= %{_emacs_version}
2022-08-08 12:04:40 +02:00
Miro Hrončok 2f1be2ed78 Update to 0.29.32 2022-08-08 12:03:50 +02:00
Fedora Release Engineering 29491f0523 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-20 18:34:09 +00:00
Python Maint 6dc133adcf Rebuilt for Python 3.11 2022-06-13 18:55:39 +02:00
Python Maint b85dfd3bda Bootstrap for Python 3.11 2022-06-13 14:53:36 +02:00
Tomáš Hrnčiar 374291e8ee Update to 0.29.30 2022-05-30 14:58:39 +02:00
Miro Hrončok ba54d3b2cd Remove a very weird rm -rf that has not been needed for a long time 2022-03-31 13:55:10 +02:00
Miro Hrončok db919742fc Update to 0.29.28 2022-03-31 13:55:01 +02:00
Fedora Release Engineering 6678a84899 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-19 19:18:59 +00:00
Miro Hrončok f52c2ecc11 Update to 0.29.26 2022-01-07 10:44:03 +01:00
Scott Talbert d5f7a019c7 Update to 0.29.24 to fix FTBFS with Python 3.10 2021-07-22 11:26:10 -04:00
Fedora Release Engineering 1ee3b1a90c - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 15:43:52 +00:00
Fedora Release Engineering d42d4b95f6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 10:49:24 +00:00
Python Maint 5f403f6493 Rebuilt for Python 3.10 2021-06-02 22:04:38 +02:00
Python Maint f2f31bc0ff Bootstrap for Python 3.10 2021-06-02 14:57:15 +02:00
Miro Hrončok d66d4fa971 Adapt tracing code to Python 3.10 2021-05-19 12:25:50 +02:00
Miro Hrončok abebf576dc General cleanup 2021-03-10 12:14:56 +01:00
Miro Hrončok 705633024a Introduce cython_compile bcond 2021-03-04 10:25:03 +01:00
Miro Hrončok e54e595a42 Update to 0.29.22 2021-03-04 09:22:10 +01:00
Fedora Release Engineering 9a9bbcd568 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-25 22:20:58 +00:00
5 changed files with 236 additions and 184 deletions

20
.gitignore vendored
View File

@ -45,3 +45,23 @@ Cython-0.12.1.tar.gz
/Cython-0.29.17.tar.gz
/Cython-0.29.19.tar.gz
/Cython-0.29.21.tar.gz
/Cython-0.29.22.tar.gz
/Cython-0.29.24.tar.gz
/Cython-0.29.26.tar.gz
/Cython-0.29.28.tar.gz
/Cython-0.29.29.tar.gz
/Cython-0.29.30.tar.gz
/Cython-0.29.32.tar.gz
/Cython-0.29.33.tar.gz
/Cython-0.29.34.tar.gz
/Cython-0.29.35.tar.gz
/Cython-3.0.0a11.tar.gz
/Cython-3.0.0b1.tar.gz
/Cython-3.0.0b2.tar.gz
/Cython-3.0.0b3.tar.gz
/Cython-3.0.0rc2.tar.gz
/Cython-3.0.0.tar.gz
/Cython-3.0.2.tar.gz
/Cython-3.0.3.tar.gz
/Cython-3.0.4.tar.gz
/Cython-3.0.5.tar.gz

35
5791.patch Normal file
View File

@ -0,0 +1,35 @@
From add379d9df149149e3718bd8f71945b7d02fcf4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Wed, 1 Nov 2023 21:32:40 +0100
Subject: [PATCH] Fix C++17 error: standard attributes in middle of
decl-specifiers (CYTHON_UNUSED)
This is only relevant on Python 3.13+
Fixes https://github.com/cython/cython/issues/5790
---
Cython/Utility/FunctionArguments.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Cython/Utility/FunctionArguments.c b/Cython/Utility/FunctionArguments.c
index 5050a094a88..0dc89c638ab 100644
--- a/Cython/Utility/FunctionArguments.c
+++ b/Cython/Utility/FunctionArguments.c
@@ -505,7 +505,7 @@ static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
#define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
- static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);/*proto*/
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);/*proto*/
#else
#define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
#endif
@@ -563,7 +563,7 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
-static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
+CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
PyObject *dict;

View File

@ -1,51 +1,77 @@
%global srcname Cython
%global upname cython
%bcond tests 0
%bcond_without tests
# This bcond allows to ship a non-compiled version
# Slower, but sometimes necessary with alpha Python versions
%bcond cython_compile 1
Name: Cython
Version: 0.29.21
%global upver %{version_no_tilde %{nil}}
Release: 4%{?dist}
Version: 3.0.5
Release: 1.0.riscv64%{?dist}
Summary: Language for writing Python extension modules
License: ASL 2.0
License: Apache-2.0
URL: http://www.cython.org
Source: https://github.com/cython/cython/archive/%{upver}/%{srcname}-%{version}.tar.gz
Source: https://github.com/cython/cython/archive/%{version}/Cython-%{version}.tar.gz
# Partially work around issues with class and static methods
# See https://bugzilla.redhat.com/show_bug.cgi?id=1788506
# Mostly backported from upstream: https://github.com/cython/cython/pull/3106
# This also:
# - Removes staticmethod optimizations for normal functions
# - Removes failing test for staticmethod fused functions, which still fail
# See also: https://github.com/cython/cython/issues/3614
Patch3106: class-static-method-workaround.patch
# Fix C++17 error: standard attributes in middle of decl-specifiers (CYTHON_UNUSED)
# This is only relevant on Python 3.13+
Patch: https://github.com/cython/cython/pull/5791.patch
BuildRequires: python3-devel
BuildRequires: gcc
%if %{with tests}
BuildRequires: gcc-c++
BuildRequires: gdb
# optionally uses Python's test.support for some test
BuildRequires: python3-test
# the Python tests requirements are curated manually
# the test-requirements*.txt files mix in coverage and optional deps
BuildRequires: python3-numpy
BuildRequires: python3-pythran
%if %{undefined rhel}
# We don't want to pull in ipython to RHEL just to run more tests.
# The tests use IPython.testing.globalipapp
BuildRequires: python3-ipython+test
# The tests requiring jedi are optional and skipped when jedi is not installed.
# Note that the jedi tests were forcefully disabled a long time ago,
# in https://github.com/cython/cython/issues/1845 far, far away.
# We keep the dependency here so we don't forget to re-add it once the balance is restored.
# We don't want to pull in jedi to RHEL just to potentially run more tests.
BuildRequires: python3-jedi
%endif
%endif
%global _description \
This is a development version of Pyrex, a language\
for writing Python extension modules.
%if %{with cython_compile}
BuildRequires: gcc
%else
BuildArch: noarch
%endif
%global _description %{expand:
The Cython language makes writing C extensions for the Python language as easy
as Python itself. Cython is a source code translator based on Pyrex,
but supports more cutting edge functionality and optimizations.
The Cython language is a superset of the Python language (almost all Python
code is also valid Cython code), but Cython additionally supports optional
static typing to natively call C functions, operate with C++ classes and
declare fast C types on variables and class attributes.
This allows the compiler to generate very efficient C code from Cython code.
This makes Cython the ideal language for writing glue code for external C/C++
libraries, and for fast C modules that speed up the execution of Python code.}
%description %{_description}
%package -n python3-%{srcname}
%package -n python3-cython
Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
Conflicts: python2-%{srcname} < 0.28.4-2
Provides: Cython = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: Cython%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: Cython < %{?epoch:%{epoch}:}%{version}-%{release}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if %{with tests}
BuildRequires: python3-numpy
BuildRequires: python3-jedi
%endif
Provides: cython = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: cython%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%py_provides python3-Cython
Obsoletes: python3-Cython < 3~~
# A small templating library is bundled in Cython/Tempita
# Upstream version 0.5.2 is available from https://pypi.org/project/Tempita
@ -53,70 +79,155 @@ BuildRequires: python3-jedi
# Upstream homepage is inaccessible.
Provides: bundled(python3dist(tempita))
%description -n python3-%{srcname} %{_description}
%description -n python3-cython %{_description}
Python 3 version.
%package -n emacs-cython-mode
Summary: A major mode for editing Cython source files in Emacs
BuildArch: noarch
BuildRequires: emacs
Requires: emacs(bin) >= %{_emacs_version}
%description -n emacs-cython-mode
cython-mode is an Emacs major mode for editing Cython source files.
%prep
%autosetup -n %{upname}-%{upver} -p1
%autosetup -n cython-%{version} -p1
%generate_buildrequires
%pyproject_buildrequires
%build
%py3_build
# emacs-cython-mode build
echo ";;
(require 'cython-mode)" > cython-mode-init.el
cp -p Tools/cython-mode.el .
%{_emacs_bytecompile} *.el
%pyproject_wheel %{!?with_cython_compile:-C--global-option=--no-cython-compile}
%install
%py3_install
rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
# emacs-cython-mode install
mkdir -p %{buildroot}%{_emacs_sitelispdir}/
cp -p cython-mode.el cython-mode.elc %{buildroot}%{_emacs_sitelispdir}/
mkdir -p %{buildroot}%{_emacs_sitestartdir}/
cp -p cython-mode-init.el cython-mode-init.elc %{buildroot}%{_emacs_sitestartdir}/
%pyproject_install
%pyproject_save_files Cython cython pyximport
%if %{with tests}
%check
# run.pstats_profile_test* fails on Python 3.12
# https://github.com/cython/cython/issues/5470
# run.parallel fails on i686
# https://github.com/cython/cython/issues/2807
%{python3} runtests.py -vv --no-pyregr %{?_smp_mflags} \
--exclude 'run.pstats_profile_test*' \
%ifarch %{ix86}
--exclude run.parallel # https://github.com/cython/cython/issues/2807
--exclude run.parallel \
%endif
%endif
%files -n python3-%{srcname}
%license LICENSE.txt
%files -n python3-cython -f %{pyproject_files}
%doc *.txt Demos Doc Tools
%{_bindir}/cython
%{_bindir}/cygdb
%{_bindir}/cythonize
%{python3_sitearch}/%{srcname}-*.egg-info/
%{python3_sitearch}/%{srcname}/
%{python3_sitearch}/pyximport/
%{python3_sitearch}/%{upname}.py
%{python3_sitearch}/__pycache__/%{upname}.*
%files -n emacs-cython-mode
%license LICENSE.txt
%{_emacs_sitelispdir}/cython*.el*
%{_emacs_sitestartdir}/cython*.el*
%changelog
* Tue Dec 05 2023 David Abdurachmanov <davidlt@rivosinc.com> - 3.0.5-1.0.riscv64
- Bootstrap for Python 3.12 on riscv64
* Tue Oct 31 2023 Miro Hrončok <mhroncok@redhat.com> - 3.0.5-1
- Update to 3.0.5
* Wed Oct 18 2023 Miro Hrončok <mhroncok@redhat.com> - 3.0.4-1
- Update to 3.0.4
- Fixes: rhbz#2244865
* Fri Oct 13 2023 Miro Hrončok <mhroncok@redhat.com> - 3.0.3-1
- Update to 3.0.3
- Fixes: rhbz#2242429
* Fri Sep 01 2023 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-1
- Update to 3.0.2
- Fixes: rhbz#2235027
* Mon Jul 17 2023 Miro Hrončok <mhroncok@redhat.com> - 3.0.0-1
- Update to 3.0.0
- Rename python3-Cython to python3-cython
* Thu Jul 13 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.0.0~rc2-1
- Update to 3.0.0rc2
- The emacs-cython-mode package is no longer part of this project
* Fri Jun 30 2023 Petr Viktorin <pviktori@redhat.com> - 0.29.35-2
- Compile-time Python 3.12 compatibility for CYTHON_TRACE support
* Sun Jun 18 2023 Miro Hrončok <mhroncok@redhat.com> - 0.29.35-1
- Update to 0.29.35
- Fixes: rhbz#2210064
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.29.34-3
- Bootstrap for Python 3.12
* Wed May 24 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.29.34-2
- Avoid python-jedi dependency in RHEL builds
- Stop shipping emacs-cython-mode in RHEL builds
* Mon Apr 03 2023 Miro Hrončok <mhroncok@redhat.com> - 0.29.34-1
- Update to 0.29.34
- Fixes: rhbz#1823181
- Fixes: rhbz#2172822
- Fixes: rhbz#2177838
* Fri Feb 17 2023 Miro Hrončok <mhroncok@redhat.com> - 0.29.33-1
- Update to 0.29.33
- Fix test failures with NumPy 1.24
- Update the RPM license tag to SPDX
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.32-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Dec 20 2022 Miro Hrončok <mhroncok@redhat.com> - 0.29.32-2
- emacs-cython-mode: Wrap the docstring of cython-default-compile-format to 80 characters
- Fixes: rhbz#2155090
* Mon Aug 08 2022 Miro Hrončok <mhroncok@redhat.com> - 0.29.32-1
- Update to 0.29.32
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.30-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.29.30-3
- Rebuilt for Python 3.11
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.29.30-2
- Bootstrap for Python 3.11
* Mon May 30 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 0.29.30-1
- Update to 0.29.30
* Thu Mar 31 2022 Miro Hrončok <mhroncok@redhat.com> - 0.29.28-1
- Update to 0.29.28
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.26-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jan 07 2022 Miro Hrončok <mhroncok@redhat.com> - 0.29.26-1
- Update to 0.29.26
* Wed Jul 21 2021 Scott Talbert <swt@techie.net> - 0.29.24-1
- Update to 0.29.24 to fix FTBFS with Python 3.10
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.22-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 0.29.22-4
- Rebuilt for Python 3.10
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 0.29.22-3
- Bootstrap for Python 3.10
* Tue Mar 09 2021 Miro Hrončok <mhroncok@redhat.com> - 0.29.22-2
- Remove an obsoleted patch
- Remove old Obsoletes and Conflicts
- Update description
- Provide cython, python3-cython
* Thu Mar 04 2021 Miro Hrončok <mhroncok@redhat.com> - 0.29.22-1
- Update to 0.29.22
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.21-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Nov 13 2020 Miro Hrončok <mhroncok@redhat.com> - 0.29.21-4
- Drop build dependency on coverage

View File

@ -1,114 +0,0 @@
diff -U3 -r cython-0.29.17.orig/Cython/Compiler/ExprNodes.py cython-0.29.17/Cython/Compiler/ExprNodes.py
--- cython-0.29.17.orig/Cython/Compiler/ExprNodes.py 2020-04-26 13:48:48.000000000 +0200
+++ cython-0.29.17/Cython/Compiler/ExprNodes.py 2020-05-15 17:44:55.157172257 +0200
@@ -2295,8 +2295,10 @@
setter = 'PyDict_SetItem'
namespace = Naming.moddict_cname
elif entry.is_pyclass_attr:
- code.globalstate.use_utility_code(UtilityCode.load_cached("SetNameInClass", "ObjectHandling.c"))
- setter = '__Pyx_SetNameInClass'
+ # Special-case setting __new__
+ n = "SetNewInClass" if self.name == "__new__" else "SetNameInClass"
+ code.globalstate.use_utility_code(UtilityCode.load_cached(n, "ObjectHandling.c"))
+ setter = '__Pyx_' + n
else:
assert False, repr(entry)
code.put_error_if_neg(
diff -U3 -r cython-0.29.17.orig/Cython/Compiler/Nodes.py cython-0.29.17/Cython/Compiler/Nodes.py
--- cython-0.29.17.orig/Cython/Compiler/Nodes.py 2020-04-26 13:48:48.000000000 +0200
+++ cython-0.29.17/Cython/Compiler/Nodes.py 2020-05-15 17:44:55.159172253 +0200
@@ -2872,7 +2872,6 @@
func = decorator.decorator
if func.is_name:
self.is_classmethod |= func.name == 'classmethod'
- self.is_staticmethod |= func.name == 'staticmethod'
if self.is_classmethod and env.lookup_here('classmethod'):
# classmethod() was overridden - not much we can do here ...
diff -U3 -r cython-0.29.17.orig/Cython/Utility/ObjectHandling.c cython-0.29.17/Cython/Utility/ObjectHandling.c
--- cython-0.29.17.orig/Cython/Utility/ObjectHandling.c 2020-04-26 13:48:48.000000000 +0200
+++ cython-0.29.17/Cython/Utility/ObjectHandling.c 2020-05-15 17:44:55.160172251 +0200
@@ -1163,6 +1163,30 @@
#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
#endif
+/////////////// SetNewInClass.proto ///////////////
+
+static int __Pyx_SetNewInClass(PyObject *ns, PyObject *name, PyObject *value);
+
+/////////////// SetNewInClass ///////////////
+//@requires: SetNameInClass
+
+// Special-case setting __new__: if it's a Cython function, wrap it in a
+// staticmethod. This is similar to what Python does for a Python function
+// called __new__.
+static int __Pyx_SetNewInClass(PyObject *ns, PyObject *name, PyObject *value) {
+#ifdef __Pyx_CyFunction_USED
+ int ret;
+ if (__Pyx_CyFunction_Check(value)) {
+ PyObject *staticnew = PyStaticMethod_New(value);
+ if (unlikely(!staticnew)) return -1;
+ ret = __Pyx_SetNameInClass(ns, name, staticnew);
+ Py_DECREF(staticnew);
+ return ret;
+ }
+#endif
+ return __Pyx_SetNameInClass(ns, name, value);
+}
+
/////////////// GetModuleGlobalName.proto ///////////////
//@requires: PyDictVersioning
Only in cython-0.29.17.orig: cython-0.29.17
diff -U3 -r cython-0.29.17.orig/tests/run/cyfunction.pyx cython-0.29.17/tests/run/cyfunction.pyx
--- cython-0.29.17.orig/tests/run/cyfunction.pyx 2020-04-26 13:48:48.000000000 +0200
+++ cython-0.29.17/tests/run/cyfunction.pyx 2020-05-15 17:44:55.160172251 +0200
@@ -376,6 +376,18 @@
def meth(self): pass
+class TestStaticmethod(object):
+ """
+ >>> x = TestStaticmethod()
+ >>> x.staticmeth(42)
+ 42
+ >>> x.staticmeth.__get__(42)()
+ 42
+ """
+ @staticmethod
+ def staticmeth(arg): return arg
+
+
cdef class TestOptimisedBuiltinMethod:
"""
>>> obj = TestOptimisedBuiltinMethod()
diff -U3 -r cython-0.29.17.orig/tests/run/fused_def.pyx cython-0.29.17/tests/run/fused_def.pyx
--- cython-0.29.17.orig/tests/run/fused_def.pyx 2020-04-26 13:48:48.000000000 +0200
+++ cython-0.29.17/tests/run/fused_def.pyx 2020-05-15 18:03:39.436752174 +0200
@@ -268,14 +268,6 @@
def test_fused_def_super():
"""
>>> test_fused_def_super()
- long 10
- long 11
- long 11
- long 12
- short 12
- long 13
- short 13
- long 14
<class 'fused_def.SubClass'> long 14
<class 'fused_def.SubClass'> long 15
<class 'fused_def.SubClass'> long 15
@@ -296,11 +288,6 @@
obj = SubClass()
cls = SubClass
- obj.mystaticmethod(obj, 10)
- cls.mystaticmethod(obj, 11)
- obj.mystaticmethod[cy.short](obj, 12)
- cls.mystaticmethod[cy.short](obj, 13)
-
obj.myclassmethod(14)
cls.myclassmethod(15)
obj.myclassmethod[cy.short](16)

View File

@ -1 +1 @@
SHA512 (Cython-0.29.21.tar.gz) = 2c0c3e3fff07106eb98862f71cd5dec9ff29460cf9b9e4de74537ca5e033f7523989beb5fbdc14723beaf94a535976f75c803e791b87e017961d9694b8c37679
SHA512 (Cython-3.0.5.tar.gz) = 585d3fe810ace55278fcc6ea4508b3b5259320f92998cd688da787cd5f88ac5fc2467025f20da6d968969eb3296ae9c517136d24a4dbb475441271227968f6be