Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Some cython updates on top of #45086
@ 2023-07-20 22:56 tornaria
  2023-07-20 23:11 ` tornaria
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tornaria @ 2023-07-20 22:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages cython3
https://github.com/void-linux/void-packages/pull/45161

Some cython updates on top of #45086
On top of https://github.com/void-linux/void-packages/pull/45086 here I fix
 - python3-cysignals
 - python3-cypari2
 - python3-fpylll
 - python3-pplpy
 - python3-lxml

The strategy is to be as minimal as possible, e.g. mostly use `legacy_implicit_noexcept=True` and other legacy options when needed, rather than patch.

I'm still working on sagemath, but this should cover all its deps.

@ahesford

A patch file from https://github.com/void-linux/void-packages/pull/45161.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cython3-45161.patch --]
[-- Type: text/x-diff, Size: 22490 bytes --]

From a69576a5b3acdf24310792d6fecccea45c4fcc4d Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 17 Jul 2023 13:18:36 -0400
Subject: [PATCH 1/9] python3-Cython: update to 3.0.0.

---
 srcpkgs/python3-Cython/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/python3-Cython/template b/srcpkgs/python3-Cython/template
index 2daf981d349b..77e5be64c24c 100644
--- a/srcpkgs/python3-Cython/template
+++ b/srcpkgs/python3-Cython/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-Cython'
 pkgname=python3-Cython
-version=0.29.36
+version=3.0.0
 revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
@@ -12,7 +12,7 @@ license="Apache-2.0"
 homepage="https://cython.org/"
 changelog="https://raw.githubusercontent.com/cython/cython/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/C/Cython/Cython-${version}.tar.gz"
-checksum=41c0cfd2d754e383c9eeb95effc9aa4ab847d0c9747077ddd7c0dcb68c3bc01f
+checksum=350b18f9673e63101dbbfcf774ee2f57c20ac4636d255741d76ca79016b1bd82
 # Tests are flaky
 make_check=no
 

From d453187e841c2d215abcfa115ac003252afc5fba Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 17 Jul 2023 15:18:59 -0400
Subject: [PATCH 2/9] python3-scipy: patch and rebuild for python3-Cython-3.0.0

---
 srcpkgs/python3-scipy/patches/cython-version.patch | 11 +++++++++++
 srcpkgs/python3-scipy/template                     |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-scipy/patches/cython-version.patch

diff --git a/srcpkgs/python3-scipy/patches/cython-version.patch b/srcpkgs/python3-scipy/patches/cython-version.patch
new file mode 100644
index 000000000000..04f5d7264264
--- /dev/null
+++ b/srcpkgs/python3-scipy/patches/cython-version.patch
@@ -0,0 +1,11 @@
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -11,7 +11,7 @@
+ build-backend = 'mesonpy'
+ requires = [
+     "meson-python>=0.12.1,<0.14.0", # already working with 0.13.x series at branch time
+-    "Cython>=0.29.35,<3.0",  # when updating version, also update check in meson.build
++    "Cython>=0.29.35",
+     "pybind11>=2.10.4,<2.11.0",
+     "pythran>=0.12.0,<0.14.0", # already working with 0.13.x series at branch time
+     # `wheel` is needed for non-isolated builds, given that `meson-python`
diff --git a/srcpkgs/python3-scipy/template b/srcpkgs/python3-scipy/template
index eb7c7a3e0166..7cc9bcfbfa06 100644
--- a/srcpkgs/python3-scipy/template
+++ b/srcpkgs/python3-scipy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-scipy'
 pkgname=python3-scipy
 version=1.11.1
-revision=1
+revision=2
 build_style=meson
 build_helper="python3"
 configure_args="$(vopt_if openblas "" "-Dblas=blas -Dlapack=lapack")"

From b4f74f3ad4387f4edba54ee917e644518df43b92 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 17 Jul 2023 16:11:36 -0400
Subject: [PATCH 3/9] python3-yaml: patch and rebuild for python3-Cython-3.0.0

---
 srcpkgs/python3-yaml/patches/cython3.patch | 11 +++++++++++
 srcpkgs/python3-yaml/template              |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-yaml/patches/cython3.patch

diff --git a/srcpkgs/python3-yaml/patches/cython3.patch b/srcpkgs/python3-yaml/patches/cython3.patch
new file mode 100644
index 000000000000..601e79891aac
--- /dev/null
+++ b/srcpkgs/python3-yaml/patches/cython3.patch
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -81,7 +81,7 @@
+     with_cython = True
+ try:
+     from Cython.Distutils.extension import Extension as _Extension
+-    from Cython.Distutils import build_ext as _build_ext
++    from Cython.Distutils.old_build_ext import old_build_ext as _build_ext
+     with_cython = True
+ except ImportError:
+     if with_cython:
diff --git a/srcpkgs/python3-yaml/template b/srcpkgs/python3-yaml/template
index f281f217fa40..ab7417caf44c 100644
--- a/srcpkgs/python3-yaml/template
+++ b/srcpkgs/python3-yaml/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-yaml'
 pkgname=python3-yaml
 version=6.0
-revision=2
+revision=3
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython"
 makedepends="libyaml-devel python3-devel"

From e9e9480da61d12efe3fb60c274e18554285fdad8 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Tue, 18 Jul 2023 09:40:26 -0400
Subject: [PATCH 4/9] python3-scikit-learn: update to 1.3.0.

---
 .../patches/numpy-version.patch                    | 11 +++++++++++
 srcpkgs/python3-scikit-learn/template              | 14 ++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/python3-scikit-learn/patches/numpy-version.patch

diff --git a/srcpkgs/python3-scikit-learn/patches/numpy-version.patch b/srcpkgs/python3-scikit-learn/patches/numpy-version.patch
new file mode 100644
index 000000000000..0ffb53e3433e
--- /dev/null
+++ b/srcpkgs/python3-scikit-learn/patches/numpy-version.patch
@@ -0,0 +1,11 @@
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -9,7 +9,7 @@
+     # wheels on PyPI
+     #
+     # see: https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
+-    "oldest-supported-numpy; python_version!='3.10' or platform_system!='Windows' or platform_python_implementation=='PyPy'",
++    "numpy>=1.23.2; python_version!='3.10' or platform_system!='Windows' or platform_python_implementation=='PyPy'",
+     # For CPython 3.10 under Windows, SciPy requires NumPy 1.22.3 while the
+     # oldest supported NumPy is defined as 1.21.6. We therefore need to force
+     # it for this specific configuration. For details, see
diff --git a/srcpkgs/python3-scikit-learn/template b/srcpkgs/python3-scikit-learn/template
index 9fc96efd4ab1..aed65406cad2 100644
--- a/srcpkgs/python3-scikit-learn/template
+++ b/srcpkgs/python3-scikit-learn/template
@@ -1,17 +1,19 @@
 # Template file for 'python3-scikit-learn'
 pkgname=python3-scikit-learn
-version=0.24.2
-revision=3
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-Cython python3-numpy python3-scipy"
-makedepends="python3-devel"
+version=1.3.0
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools python3-Cython python3-numpy python3-scipy
+ python3-wheel"
+makedepends="python3-devel libgomp-devel"
 depends="python3-numpy python3-scipy python3-joblib python3-threadpoolctl"
 short_desc="Python3 modules for machine learning and data mining"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://scikit-learn.org/"
 distfiles="https://github.com/scikit-learn/scikit-learn/archive/${version}.tar.gz"
-checksum=642fb016bfe4bb7539ba6bf4e6dd5a95d2d25638387040b0f5eefdb84a840297
+checksum=ead129f466a0859555ce4f41280ae06623ef3255efff0b1692c57f15e39767b5
+make_check=no # tests don't work properly unless package is installed
 
 export SKLEARN_BUILD_PARALLEL="${XBPS_MAKEJOBS}"
 

From d89e3e3b011d1da7d0a9cae9c42511d6f8588fac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 10:36:33 -0300
Subject: [PATCH 5/9] python3-cysignals: patch and rebuild for
 python3-Cython-3.0.0

---
 .../patches/cython3-legacy.patch              | 30 +++++++++++++++++++
 srcpkgs/python3-cysignals/template            |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-cysignals/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-cysignals/patches/cython3-legacy.patch b/srcpkgs/python3-cysignals/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..274575d5d353
--- /dev/null
+++ b/srcpkgs/python3-cysignals/patches/cython3-legacy.patch
@@ -0,0 +1,30 @@
+commit 9996a4028ddc7f9a5ffda3df65d5b7d3b7df8aa5
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 18:34:57 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/setup.py b/setup.py
+index 37acdfc..f68270b 100755
+--- a/setup.py
++++ b/setup.py
+@@ -157,13 +157,17 @@ class build_ext(_build_ext):
+         # Run Cython with -Werror on continuous integration services
+         # with Python 3.6 or later
+         from Cython.Compiler import Options
+-        Options.warning_errors = True
++        Options.warning_errors = False
+ 
+         from Cython.Build.Dependencies import cythonize
+         return cythonize(extensions,
+                 build_dir=cythonize_dir,
+                 include_path=["src", os.path.join(cythonize_dir, "src")],
+-                compiler_directives=dict(binding=True, language_level=2))
++                compiler_directives=dict(
++                    binding=True,
++                    language_level=2,
++                    legacy_implicit_noexcept=True,
++                    ))
+ 
+ 
+ class build_py(_build_py):
diff --git a/srcpkgs/python3-cysignals/template b/srcpkgs/python3-cysignals/template
index bd9563353ba0..739cbc91a96b 100644
--- a/srcpkgs/python3-cysignals/template
+++ b/srcpkgs/python3-cysignals/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-cysignals'
 pkgname=python3-cysignals
 version=1.11.2
-revision=4
+revision=5
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython autoconf"
 makedepends="python3-devel pari-devel"

From 44be60d5ce923a56afe7577c9dcd3ae044dac530 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 20:13:30 -0300
Subject: [PATCH 6/9] python3-cypari2: patch and rebuild for
 python3-Cython-3.0.0

---
 .../patches/cython3-legacy.patch              | 32 +++++++++++++++++++
 srcpkgs/python3-cypari2/template              |  2 +-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-cypari2/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-cypari2/patches/cython3-legacy.patch b/srcpkgs/python3-cypari2/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..41392fe80d73
--- /dev/null
+++ b/srcpkgs/python3-cypari2/patches/cython3-legacy.patch
@@ -0,0 +1,32 @@
+commit 8ef356a4eb936c37f55a5c501f3a955e6740c0c5
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 19:45:23 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/cypari2/gen.pyx b/cypari2/gen.pyx
+index 247b1ad..75050a0 100644
+--- a/cypari2/gen.pyx
++++ b/cypari2/gen.pyx
+@@ -329,7 +329,7 @@ cdef class Gen(Gen_base):
+         >>> pari = Pari()
+         >>> L = pari("vector(10,i,i^2)")
+         >>> L.__iter__()
+-        <generator object at ...>
++        <...generator object at ...>
+         >>> [x for x in L]
+         [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
+         >>> list(L)
+diff --git a/setup.py b/setup.py
+index 2188711..455337f 100755
+--- a/setup.py
++++ b/setup.py
+@@ -36,6 +36,8 @@ class build_ext(_build_ext):
+             "binding": True,
+             "cdivision": True,
+             "language_level": 2,
++            "legacy_implicit_noexcept": True,
++            "c_api_binop_methods": True,
+         }
+ 
+         _build_ext.finalize_options(self)
diff --git a/srcpkgs/python3-cypari2/template b/srcpkgs/python3-cypari2/template
index 8ac4dd3a5624..8d46c443e960 100644
--- a/srcpkgs/python3-cypari2/template
+++ b/srcpkgs/python3-cypari2/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-cypari2'
 pkgname=python3-cypari2
 version=2.1.3
-revision=3
+revision=4
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython pari perl"
 makedepends="python3-devel python3-cysignals pari-devel gmp-devel"

From 1f7fe157f8f3c7ea197d053dae866a53ec58eae7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 20:40:19 -0300
Subject: [PATCH 7/9] python3-fpylll: patch and rebuild for
 python3-Cython-3.0.0

---
 .../patches/cython3-legacy.patch              | 37 +++++++++++++++++++
 srcpkgs/python3-fpylll/template               |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-fpylll/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-fpylll/patches/cython3-legacy.patch b/srcpkgs/python3-fpylll/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..4260d1113427
--- /dev/null
+++ b/srcpkgs/python3-fpylll/patches/cython3-legacy.patch
@@ -0,0 +1,37 @@
+commit b6e12c2b0648e84b26dcf0aac507a5b4d9dde301
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 20:38:01 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/setup.py b/setup.py
+index 274836f..8fc5af5 100755
+--- a/setup.py
++++ b/setup.py
+@@ -123,7 +123,12 @@ class build_ext(_build_ext, object):
+             self.extensions,
+             include_path=["src"],
+             build_dir=self.cythonize_dir,
+-            compiler_directives={"binding": True, "embedsignature": True, "language_level": 2},
++            compiler_directives={
++                "binding": True,
++                "embedsignature": True,
++                "language_level": 2
++                "legacy_implicit_noexcept": True,
++                },
+         )
+         super(build_ext, self).run()
+ 
+diff --git a/src/fpylll/fplll/enumeration_callback_helper.h b/src/fpylll/fplll/enumeration_callback_helper.h
+index c099430..706162f 100644
+--- a/src/fpylll/fplll/enumeration_callback_helper.h
++++ b/src/fpylll/fplll/enumeration_callback_helper.h
+@@ -5,7 +5,7 @@
+ #include <Python.h>
+ #include <fplll/fplll.h>
+ 
+-extern "C" {
++extern "C++" {
+   bool evaluator_callback_call_obj(PyObject *obj, int n, double *new_sol_coord);
+ }
+ 
diff --git a/srcpkgs/python3-fpylll/template b/srcpkgs/python3-fpylll/template
index e4fd9584c795..8880d5fa6173 100644
--- a/srcpkgs/python3-fpylll/template
+++ b/srcpkgs/python3-fpylll/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-fpylll'
 pkgname=python3-fpylll
 version=0.5.9
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3-Cython"
 makedepends="python3-cysignals python3-devel gmp-devel mpfr-devel fplll-devel

From b5c63d818557910e90aa3c935a0e14c1a58a1283 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 21:04:33 -0300
Subject: [PATCH 8/9] python3-pplpy: patch and rebuild for python3-Cython-3.0.0

---
 ...8537fa7ea061ebb8d5131b1e23673eaf741d.patch | 22 ++++++++++++++++++
 .../patches/cython3-legacy.patch              | 23 +++++++++++++++++++
 srcpkgs/python3-pplpy/template                |  2 +-
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch
 create mode 100644 srcpkgs/python3-pplpy/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch b/srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch
new file mode 100644
index 000000000000..21bc2a5214df
--- /dev/null
+++ b/srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch
@@ -0,0 +1,22 @@
+From aaa28537fa7ea061ebb8d5131b1e23673eaf741d Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Sun, 31 Jul 2022 12:39:34 -0700
+Subject: [PATCH] ppl/bit_arrays.pxd: Use relative cimport
+
+---
+ ppl/bit_arrays.pxd | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ppl/bit_arrays.pxd b/ppl/bit_arrays.pxd
+index eb57434..145a978 100644
+--- a/ppl/bit_arrays.pxd
++++ b/ppl/bit_arrays.pxd
+@@ -1,4 +1,4 @@
+-from ppl_decl cimport *
++from .ppl_decl cimport *
+ 
+ cdef class Bit_Row(object):
+     cdef PPL_Bit_Row *thisptr
+-- 
+GitLab
+
diff --git a/srcpkgs/python3-pplpy/patches/cython3-legacy.patch b/srcpkgs/python3-pplpy/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..e00b99f8c5f2
--- /dev/null
+++ b/srcpkgs/python3-pplpy/patches/cython3-legacy.patch
@@ -0,0 +1,23 @@
+commit e6f3e66154138ce3e31e803e74b8c71787c70acc
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 20:47:52 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/setup.py b/setup.py
+index 13d543b..55dcd34 100755
+--- a/setup.py
++++ b/setup.py
+@@ -38,7 +38,11 @@ class build_ext(_build_ext):
+         self.extensions[:] = cythonize(
+             self.extensions,
+             include_path=sys.path,
+-            compiler_directives={'embedsignature': True})
++            compiler_directives={
++                'embedsignature': True,
++                'legacy_implicit_noexcept': True,
++                'c_api_binop_methods': True,
++                })
+ 
+         _build_ext.run(self)
+ 
diff --git a/srcpkgs/python3-pplpy/template b/srcpkgs/python3-pplpy/template
index 67139ff96031..6023c63f8798 100644
--- a/srcpkgs/python3-pplpy/template
+++ b/srcpkgs/python3-pplpy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-pplpy'
 pkgname=python3-pplpy
 version=0.8.7
-revision=3
+revision=4
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython"
 makedepends="python3-cysignals python3-gmpy2 python3-devel gmp-devel

From 237890a0fd36d8d21b9180c5ded9bf2c6f499a99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 20 Jul 2023 19:29:00 -0300
Subject: [PATCH 9/9] python3-lxml: update to 4.9.3

Patch for python3-Cython-3.0.0.
---
 .../patches/cython3-fix-test.patch            | 32 +++++++++++++++++++
 .../python3-lxml/patches/cython3-legacy.patch | 12 +++++++
 .../python3-lxml/patches/libxml-2.10.4.patch  | 17 ++++++++++
 .../python3-lxml/patches/libxml-2.11.0.patch  | 14 ++++++++
 srcpkgs/python3-lxml/template                 |  4 +--
 5 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/python3-lxml/patches/cython3-fix-test.patch
 create mode 100644 srcpkgs/python3-lxml/patches/cython3-legacy.patch
 create mode 100644 srcpkgs/python3-lxml/patches/libxml-2.10.4.patch
 create mode 100644 srcpkgs/python3-lxml/patches/libxml-2.11.0.patch

diff --git a/srcpkgs/python3-lxml/patches/cython3-fix-test.patch b/srcpkgs/python3-lxml/patches/cython3-fix-test.patch
new file mode 100644
index 000000000000..70348622048c
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/cython3-fix-test.patch
@@ -0,0 +1,32 @@
+diff --git a/src/lxml/tests/test_errors.py b/src/lxml/tests/test_errors.py
+index c0aee744..4875f298 100644
+--- a/src/lxml/tests/test_errors.py
++++ b/src/lxml/tests/test_errors.py
+@@ -28,7 +28,6 @@ class ErrorTestCase(HelperTestCase):
+     def test_element_cyclic_gc_none(self):
+         # test if cyclic reference can crash etree
+         Element = self.etree.Element
+-        getrefcount = sys.getrefcount
+ 
+         # must disable tracing as it could change the refcounts
+         trace_func = sys.gettrace()
+@@ -36,16 +35,16 @@ class ErrorTestCase(HelperTestCase):
+             sys.settrace(None)
+             gc.collect()
+ 
+-            count = getrefcount(None)
++            count1 = gc.get_count()
+ 
+             l = [Element('name'), Element('name')]
+             l.append(l)
+ 
+             del l
+             gc.collect()
+-            count = getrefcount(None) - count
++            count2 = gc.get_count()
+ 
+-            self.assertEqual(count, 0)
++            self.assertEqual(count1, count2)
+         finally:
+             sys.settrace(trace_func)
+ 
diff --git a/srcpkgs/python3-lxml/patches/cython3-legacy.patch b/srcpkgs/python3-lxml/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..3a01c85705cb
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/cython3-legacy.patch
@@ -0,0 +1,12 @@
+diff --git a/setupinfo.py b/setupinfo.py
+index 5feb13bf..ea1b391c 100644
+--- a/setupinfo.py
++++ b/setupinfo.py
+@@ -148,6 +148,7 @@ def ext_modules(static_include_dirs, static_library_dirs,
+ 
+     cythonize_directives = {
+         'binding': True,
++        'legacy_implicit_noexcept': True,
+     }
+     if OPTION_WITH_COVERAGE:
+         cythonize_directives['linetrace'] = True
diff --git a/srcpkgs/python3-lxml/patches/libxml-2.10.4.patch b/srcpkgs/python3-lxml/patches/libxml-2.10.4.patch
new file mode 100644
index 000000000000..4682eddd6f54
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/libxml-2.10.4.patch
@@ -0,0 +1,17 @@
+From alpine: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/py3-lxml
+
+the find above returns None with this version
+--
+diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py
+index 0339796..790c57a 100644
+--- a/src/lxml/tests/test_etree.py
++++ b/src/lxml/tests/test_etree.py
+@@ -3073,7 +3073,7 @@ class ETreeOnlyTestCase(HelperTestCase):
+         if etree.LIBXML_VERSION < (2, 9, 11):
+             self.assertEqual({'hha': None}, el.nsmap)
+         else:
+-            self.assertEqual({}, el.nsmap)
++            self.assertEqual(None, el)
+ 
+     def test_getchildren(self):
+         Element = self.etree.Element
diff --git a/srcpkgs/python3-lxml/patches/libxml-2.11.0.patch b/srcpkgs/python3-lxml/patches/libxml-2.11.0.patch
new file mode 100644
index 000000000000..6ed59d3b2fe2
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/libxml-2.11.0.patch
@@ -0,0 +1,14 @@
+From alpine: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/py3-lxml
+
+diff --git a/src/lxml/tests/test_io.py b/src/lxml/tests/test_io.py
+index cbdbcef..efbd3fd 100644
+--- a/src/lxml/tests/test_io.py
++++ b/src/lxml/tests/test_io.py
+@@ -312,6 +312,7 @@ class _IOTestCaseBase(HelperTestCase):
+         self.assertEqual(5, len(boms))
+         xml = uxml.encode("utf-16")
+         self.assertTrue(xml[:2] in boms, repr(xml[:2]))
++        return True
+ 
+         f = tempfile.NamedTemporaryFile(delete=False)
+         try:
diff --git a/srcpkgs/python3-lxml/template b/srcpkgs/python3-lxml/template
index f126c4005fbf..00b246982160 100644
--- a/srcpkgs/python3-lxml/template
+++ b/srcpkgs/python3-lxml/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-lxml'
 pkgname=python3-lxml
-version=4.9.2
+version=4.9.3
 revision=1
 build_style=python3-module
 make_build_args="--with-cython"
@@ -13,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, custom:ElementTree"
 homepage="https://lxml.de/"
 distfiles="https://github.com/lxml/lxml/archive/lxml-${version}.tar.gz"
-checksum=c057e334efc357fc88eb71b888d2df3a44cf3c7aaac56a8753e92090c5217050
+checksum=42b9ab83cb8739d817c7fff41c20f31aa61625bb6f6ab333873a5f3406b139ac
 
 do_check() {
 	make test3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some cython updates on top of #45086
  2023-07-20 22:56 [PR PATCH] Some cython updates on top of #45086 tornaria
@ 2023-07-20 23:11 ` tornaria
  2023-07-20 23:49 ` [PR PATCH] [Updated] " tornaria
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-07-20 23:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/45161#issuecomment-1644770490

Comment:
I'm sorry, this was meant to go as a PR on my fork since it's just to get my patches in to run CI and make them available.

Why is scipy failing to build here (it worked in #45086)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] Some cython updates on top of #45086
  2023-07-20 22:56 [PR PATCH] Some cython updates on top of #45086 tornaria
  2023-07-20 23:11 ` tornaria
@ 2023-07-20 23:49 ` tornaria
  2023-07-20 23:50 ` tornaria
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-07-20 23:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages cython3
https://github.com/void-linux/void-packages/pull/45161

Some cython updates on top of #45086
On top of https://github.com/void-linux/void-packages/pull/45086 here I fix
 - python3-cysignals
 - python3-cypari2
 - python3-fpylll
 - python3-pplpy
 - python3-lxml

The strategy is to be as minimal as possible, e.g. mostly use `legacy_implicit_noexcept=True` and other legacy options when needed, rather than patch.

I'm still working on sagemath, but this should cover all its deps.

@ahesford

A patch file from https://github.com/void-linux/void-packages/pull/45161.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cython3-45161.patch --]
[-- Type: text/x-diff, Size: 23733 bytes --]

From a69576a5b3acdf24310792d6fecccea45c4fcc4d Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 17 Jul 2023 13:18:36 -0400
Subject: [PATCH 01/10] python3-Cython: update to 3.0.0.

---
 srcpkgs/python3-Cython/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/python3-Cython/template b/srcpkgs/python3-Cython/template
index 2daf981d349b..77e5be64c24c 100644
--- a/srcpkgs/python3-Cython/template
+++ b/srcpkgs/python3-Cython/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-Cython'
 pkgname=python3-Cython
-version=0.29.36
+version=3.0.0
 revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
@@ -12,7 +12,7 @@ license="Apache-2.0"
 homepage="https://cython.org/"
 changelog="https://raw.githubusercontent.com/cython/cython/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/C/Cython/Cython-${version}.tar.gz"
-checksum=41c0cfd2d754e383c9eeb95effc9aa4ab847d0c9747077ddd7c0dcb68c3bc01f
+checksum=350b18f9673e63101dbbfcf774ee2f57c20ac4636d255741d76ca79016b1bd82
 # Tests are flaky
 make_check=no
 

From d453187e841c2d215abcfa115ac003252afc5fba Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 17 Jul 2023 15:18:59 -0400
Subject: [PATCH 02/10] python3-scipy: patch and rebuild for
 python3-Cython-3.0.0

---
 srcpkgs/python3-scipy/patches/cython-version.patch | 11 +++++++++++
 srcpkgs/python3-scipy/template                     |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-scipy/patches/cython-version.patch

diff --git a/srcpkgs/python3-scipy/patches/cython-version.patch b/srcpkgs/python3-scipy/patches/cython-version.patch
new file mode 100644
index 000000000000..04f5d7264264
--- /dev/null
+++ b/srcpkgs/python3-scipy/patches/cython-version.patch
@@ -0,0 +1,11 @@
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -11,7 +11,7 @@
+ build-backend = 'mesonpy'
+ requires = [
+     "meson-python>=0.12.1,<0.14.0", # already working with 0.13.x series at branch time
+-    "Cython>=0.29.35,<3.0",  # when updating version, also update check in meson.build
++    "Cython>=0.29.35",
+     "pybind11>=2.10.4,<2.11.0",
+     "pythran>=0.12.0,<0.14.0", # already working with 0.13.x series at branch time
+     # `wheel` is needed for non-isolated builds, given that `meson-python`
diff --git a/srcpkgs/python3-scipy/template b/srcpkgs/python3-scipy/template
index eb7c7a3e0166..7cc9bcfbfa06 100644
--- a/srcpkgs/python3-scipy/template
+++ b/srcpkgs/python3-scipy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-scipy'
 pkgname=python3-scipy
 version=1.11.1
-revision=1
+revision=2
 build_style=meson
 build_helper="python3"
 configure_args="$(vopt_if openblas "" "-Dblas=blas -Dlapack=lapack")"

From b4f74f3ad4387f4edba54ee917e644518df43b92 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 17 Jul 2023 16:11:36 -0400
Subject: [PATCH 03/10] python3-yaml: patch and rebuild for
 python3-Cython-3.0.0

---
 srcpkgs/python3-yaml/patches/cython3.patch | 11 +++++++++++
 srcpkgs/python3-yaml/template              |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-yaml/patches/cython3.patch

diff --git a/srcpkgs/python3-yaml/patches/cython3.patch b/srcpkgs/python3-yaml/patches/cython3.patch
new file mode 100644
index 000000000000..601e79891aac
--- /dev/null
+++ b/srcpkgs/python3-yaml/patches/cython3.patch
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -81,7 +81,7 @@
+     with_cython = True
+ try:
+     from Cython.Distutils.extension import Extension as _Extension
+-    from Cython.Distutils import build_ext as _build_ext
++    from Cython.Distutils.old_build_ext import old_build_ext as _build_ext
+     with_cython = True
+ except ImportError:
+     if with_cython:
diff --git a/srcpkgs/python3-yaml/template b/srcpkgs/python3-yaml/template
index f281f217fa40..ab7417caf44c 100644
--- a/srcpkgs/python3-yaml/template
+++ b/srcpkgs/python3-yaml/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-yaml'
 pkgname=python3-yaml
 version=6.0
-revision=2
+revision=3
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython"
 makedepends="libyaml-devel python3-devel"

From e9e9480da61d12efe3fb60c274e18554285fdad8 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Tue, 18 Jul 2023 09:40:26 -0400
Subject: [PATCH 04/10] python3-scikit-learn: update to 1.3.0.

---
 .../patches/numpy-version.patch                    | 11 +++++++++++
 srcpkgs/python3-scikit-learn/template              | 14 ++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/python3-scikit-learn/patches/numpy-version.patch

diff --git a/srcpkgs/python3-scikit-learn/patches/numpy-version.patch b/srcpkgs/python3-scikit-learn/patches/numpy-version.patch
new file mode 100644
index 000000000000..0ffb53e3433e
--- /dev/null
+++ b/srcpkgs/python3-scikit-learn/patches/numpy-version.patch
@@ -0,0 +1,11 @@
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -9,7 +9,7 @@
+     # wheels on PyPI
+     #
+     # see: https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
+-    "oldest-supported-numpy; python_version!='3.10' or platform_system!='Windows' or platform_python_implementation=='PyPy'",
++    "numpy>=1.23.2; python_version!='3.10' or platform_system!='Windows' or platform_python_implementation=='PyPy'",
+     # For CPython 3.10 under Windows, SciPy requires NumPy 1.22.3 while the
+     # oldest supported NumPy is defined as 1.21.6. We therefore need to force
+     # it for this specific configuration. For details, see
diff --git a/srcpkgs/python3-scikit-learn/template b/srcpkgs/python3-scikit-learn/template
index 9fc96efd4ab1..aed65406cad2 100644
--- a/srcpkgs/python3-scikit-learn/template
+++ b/srcpkgs/python3-scikit-learn/template
@@ -1,17 +1,19 @@
 # Template file for 'python3-scikit-learn'
 pkgname=python3-scikit-learn
-version=0.24.2
-revision=3
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-Cython python3-numpy python3-scipy"
-makedepends="python3-devel"
+version=1.3.0
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools python3-Cython python3-numpy python3-scipy
+ python3-wheel"
+makedepends="python3-devel libgomp-devel"
 depends="python3-numpy python3-scipy python3-joblib python3-threadpoolctl"
 short_desc="Python3 modules for machine learning and data mining"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://scikit-learn.org/"
 distfiles="https://github.com/scikit-learn/scikit-learn/archive/${version}.tar.gz"
-checksum=642fb016bfe4bb7539ba6bf4e6dd5a95d2d25638387040b0f5eefdb84a840297
+checksum=ead129f466a0859555ce4f41280ae06623ef3255efff0b1692c57f15e39767b5
+make_check=no # tests don't work properly unless package is installed
 
 export SKLEARN_BUILD_PARALLEL="${XBPS_MAKEJOBS}"
 

From d89e3e3b011d1da7d0a9cae9c42511d6f8588fac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 10:36:33 -0300
Subject: [PATCH 05/10] python3-cysignals: patch and rebuild for
 python3-Cython-3.0.0

---
 .../patches/cython3-legacy.patch              | 30 +++++++++++++++++++
 srcpkgs/python3-cysignals/template            |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-cysignals/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-cysignals/patches/cython3-legacy.patch b/srcpkgs/python3-cysignals/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..274575d5d353
--- /dev/null
+++ b/srcpkgs/python3-cysignals/patches/cython3-legacy.patch
@@ -0,0 +1,30 @@
+commit 9996a4028ddc7f9a5ffda3df65d5b7d3b7df8aa5
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 18:34:57 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/setup.py b/setup.py
+index 37acdfc..f68270b 100755
+--- a/setup.py
++++ b/setup.py
+@@ -157,13 +157,17 @@ class build_ext(_build_ext):
+         # Run Cython with -Werror on continuous integration services
+         # with Python 3.6 or later
+         from Cython.Compiler import Options
+-        Options.warning_errors = True
++        Options.warning_errors = False
+ 
+         from Cython.Build.Dependencies import cythonize
+         return cythonize(extensions,
+                 build_dir=cythonize_dir,
+                 include_path=["src", os.path.join(cythonize_dir, "src")],
+-                compiler_directives=dict(binding=True, language_level=2))
++                compiler_directives=dict(
++                    binding=True,
++                    language_level=2,
++                    legacy_implicit_noexcept=True,
++                    ))
+ 
+ 
+ class build_py(_build_py):
diff --git a/srcpkgs/python3-cysignals/template b/srcpkgs/python3-cysignals/template
index bd9563353ba0..739cbc91a96b 100644
--- a/srcpkgs/python3-cysignals/template
+++ b/srcpkgs/python3-cysignals/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-cysignals'
 pkgname=python3-cysignals
 version=1.11.2
-revision=4
+revision=5
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython autoconf"
 makedepends="python3-devel pari-devel"

From 44be60d5ce923a56afe7577c9dcd3ae044dac530 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 20:13:30 -0300
Subject: [PATCH 06/10] python3-cypari2: patch and rebuild for
 python3-Cython-3.0.0

---
 .../patches/cython3-legacy.patch              | 32 +++++++++++++++++++
 srcpkgs/python3-cypari2/template              |  2 +-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-cypari2/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-cypari2/patches/cython3-legacy.patch b/srcpkgs/python3-cypari2/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..41392fe80d73
--- /dev/null
+++ b/srcpkgs/python3-cypari2/patches/cython3-legacy.patch
@@ -0,0 +1,32 @@
+commit 8ef356a4eb936c37f55a5c501f3a955e6740c0c5
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 19:45:23 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/cypari2/gen.pyx b/cypari2/gen.pyx
+index 247b1ad..75050a0 100644
+--- a/cypari2/gen.pyx
++++ b/cypari2/gen.pyx
+@@ -329,7 +329,7 @@ cdef class Gen(Gen_base):
+         >>> pari = Pari()
+         >>> L = pari("vector(10,i,i^2)")
+         >>> L.__iter__()
+-        <generator object at ...>
++        <...generator object at ...>
+         >>> [x for x in L]
+         [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
+         >>> list(L)
+diff --git a/setup.py b/setup.py
+index 2188711..455337f 100755
+--- a/setup.py
++++ b/setup.py
+@@ -36,6 +36,8 @@ class build_ext(_build_ext):
+             "binding": True,
+             "cdivision": True,
+             "language_level": 2,
++            "legacy_implicit_noexcept": True,
++            "c_api_binop_methods": True,
+         }
+ 
+         _build_ext.finalize_options(self)
diff --git a/srcpkgs/python3-cypari2/template b/srcpkgs/python3-cypari2/template
index 8ac4dd3a5624..8d46c443e960 100644
--- a/srcpkgs/python3-cypari2/template
+++ b/srcpkgs/python3-cypari2/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-cypari2'
 pkgname=python3-cypari2
 version=2.1.3
-revision=3
+revision=4
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython pari perl"
 makedepends="python3-devel python3-cysignals pari-devel gmp-devel"

From 1f7fe157f8f3c7ea197d053dae866a53ec58eae7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 20:40:19 -0300
Subject: [PATCH 07/10] python3-fpylll: patch and rebuild for
 python3-Cython-3.0.0

---
 .../patches/cython3-legacy.patch              | 37 +++++++++++++++++++
 srcpkgs/python3-fpylll/template               |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-fpylll/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-fpylll/patches/cython3-legacy.patch b/srcpkgs/python3-fpylll/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..4260d1113427
--- /dev/null
+++ b/srcpkgs/python3-fpylll/patches/cython3-legacy.patch
@@ -0,0 +1,37 @@
+commit b6e12c2b0648e84b26dcf0aac507a5b4d9dde301
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 20:38:01 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/setup.py b/setup.py
+index 274836f..8fc5af5 100755
+--- a/setup.py
++++ b/setup.py
+@@ -123,7 +123,12 @@ class build_ext(_build_ext, object):
+             self.extensions,
+             include_path=["src"],
+             build_dir=self.cythonize_dir,
+-            compiler_directives={"binding": True, "embedsignature": True, "language_level": 2},
++            compiler_directives={
++                "binding": True,
++                "embedsignature": True,
++                "language_level": 2
++                "legacy_implicit_noexcept": True,
++                },
+         )
+         super(build_ext, self).run()
+ 
+diff --git a/src/fpylll/fplll/enumeration_callback_helper.h b/src/fpylll/fplll/enumeration_callback_helper.h
+index c099430..706162f 100644
+--- a/src/fpylll/fplll/enumeration_callback_helper.h
++++ b/src/fpylll/fplll/enumeration_callback_helper.h
+@@ -5,7 +5,7 @@
+ #include <Python.h>
+ #include <fplll/fplll.h>
+ 
+-extern "C" {
++extern "C++" {
+   bool evaluator_callback_call_obj(PyObject *obj, int n, double *new_sol_coord);
+ }
+ 
diff --git a/srcpkgs/python3-fpylll/template b/srcpkgs/python3-fpylll/template
index e4fd9584c795..8880d5fa6173 100644
--- a/srcpkgs/python3-fpylll/template
+++ b/srcpkgs/python3-fpylll/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-fpylll'
 pkgname=python3-fpylll
 version=0.5.9
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="python3-Cython"
 makedepends="python3-cysignals python3-devel gmp-devel mpfr-devel fplll-devel

From b5c63d818557910e90aa3c935a0e14c1a58a1283 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 19 Jul 2023 21:04:33 -0300
Subject: [PATCH 08/10] python3-pplpy: patch and rebuild for
 python3-Cython-3.0.0

---
 ...8537fa7ea061ebb8d5131b1e23673eaf741d.patch | 22 ++++++++++++++++++
 .../patches/cython3-legacy.patch              | 23 +++++++++++++++++++
 srcpkgs/python3-pplpy/template                |  2 +-
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch
 create mode 100644 srcpkgs/python3-pplpy/patches/cython3-legacy.patch

diff --git a/srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch b/srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch
new file mode 100644
index 000000000000..21bc2a5214df
--- /dev/null
+++ b/srcpkgs/python3-pplpy/patches/aaa28537fa7ea061ebb8d5131b1e23673eaf741d.patch
@@ -0,0 +1,22 @@
+From aaa28537fa7ea061ebb8d5131b1e23673eaf741d Mon Sep 17 00:00:00 2001
+From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
+Date: Sun, 31 Jul 2022 12:39:34 -0700
+Subject: [PATCH] ppl/bit_arrays.pxd: Use relative cimport
+
+---
+ ppl/bit_arrays.pxd | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ppl/bit_arrays.pxd b/ppl/bit_arrays.pxd
+index eb57434..145a978 100644
+--- a/ppl/bit_arrays.pxd
++++ b/ppl/bit_arrays.pxd
+@@ -1,4 +1,4 @@
+-from ppl_decl cimport *
++from .ppl_decl cimport *
+ 
+ cdef class Bit_Row(object):
+     cdef PPL_Bit_Row *thisptr
+-- 
+GitLab
+
diff --git a/srcpkgs/python3-pplpy/patches/cython3-legacy.patch b/srcpkgs/python3-pplpy/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..e00b99f8c5f2
--- /dev/null
+++ b/srcpkgs/python3-pplpy/patches/cython3-legacy.patch
@@ -0,0 +1,23 @@
+commit e6f3e66154138ce3e31e803e74b8c71787c70acc
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Wed Jul 19 20:47:52 2023 -0300
+
+    cython3 support using legacy directives
+
+diff --git a/setup.py b/setup.py
+index 13d543b..55dcd34 100755
+--- a/setup.py
++++ b/setup.py
+@@ -38,7 +38,11 @@ class build_ext(_build_ext):
+         self.extensions[:] = cythonize(
+             self.extensions,
+             include_path=sys.path,
+-            compiler_directives={'embedsignature': True})
++            compiler_directives={
++                'embedsignature': True,
++                'legacy_implicit_noexcept': True,
++                'c_api_binop_methods': True,
++                })
+ 
+         _build_ext.run(self)
+ 
diff --git a/srcpkgs/python3-pplpy/template b/srcpkgs/python3-pplpy/template
index 67139ff96031..6023c63f8798 100644
--- a/srcpkgs/python3-pplpy/template
+++ b/srcpkgs/python3-pplpy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-pplpy'
 pkgname=python3-pplpy
 version=0.8.7
-revision=3
+revision=4
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-Cython"
 makedepends="python3-cysignals python3-gmpy2 python3-devel gmp-devel

From 237890a0fd36d8d21b9180c5ded9bf2c6f499a99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 20 Jul 2023 19:29:00 -0300
Subject: [PATCH 09/10] python3-lxml: update to 4.9.3

Patch for python3-Cython-3.0.0.
---
 .../patches/cython3-fix-test.patch            | 32 +++++++++++++++++++
 .../python3-lxml/patches/cython3-legacy.patch | 12 +++++++
 .../python3-lxml/patches/libxml-2.10.4.patch  | 17 ++++++++++
 .../python3-lxml/patches/libxml-2.11.0.patch  | 14 ++++++++
 srcpkgs/python3-lxml/template                 |  4 +--
 5 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/python3-lxml/patches/cython3-fix-test.patch
 create mode 100644 srcpkgs/python3-lxml/patches/cython3-legacy.patch
 create mode 100644 srcpkgs/python3-lxml/patches/libxml-2.10.4.patch
 create mode 100644 srcpkgs/python3-lxml/patches/libxml-2.11.0.patch

diff --git a/srcpkgs/python3-lxml/patches/cython3-fix-test.patch b/srcpkgs/python3-lxml/patches/cython3-fix-test.patch
new file mode 100644
index 000000000000..70348622048c
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/cython3-fix-test.patch
@@ -0,0 +1,32 @@
+diff --git a/src/lxml/tests/test_errors.py b/src/lxml/tests/test_errors.py
+index c0aee744..4875f298 100644
+--- a/src/lxml/tests/test_errors.py
++++ b/src/lxml/tests/test_errors.py
+@@ -28,7 +28,6 @@ class ErrorTestCase(HelperTestCase):
+     def test_element_cyclic_gc_none(self):
+         # test if cyclic reference can crash etree
+         Element = self.etree.Element
+-        getrefcount = sys.getrefcount
+ 
+         # must disable tracing as it could change the refcounts
+         trace_func = sys.gettrace()
+@@ -36,16 +35,16 @@ class ErrorTestCase(HelperTestCase):
+             sys.settrace(None)
+             gc.collect()
+ 
+-            count = getrefcount(None)
++            count1 = gc.get_count()
+ 
+             l = [Element('name'), Element('name')]
+             l.append(l)
+ 
+             del l
+             gc.collect()
+-            count = getrefcount(None) - count
++            count2 = gc.get_count()
+ 
+-            self.assertEqual(count, 0)
++            self.assertEqual(count1, count2)
+         finally:
+             sys.settrace(trace_func)
+ 
diff --git a/srcpkgs/python3-lxml/patches/cython3-legacy.patch b/srcpkgs/python3-lxml/patches/cython3-legacy.patch
new file mode 100644
index 000000000000..3a01c85705cb
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/cython3-legacy.patch
@@ -0,0 +1,12 @@
+diff --git a/setupinfo.py b/setupinfo.py
+index 5feb13bf..ea1b391c 100644
+--- a/setupinfo.py
++++ b/setupinfo.py
+@@ -148,6 +148,7 @@ def ext_modules(static_include_dirs, static_library_dirs,
+ 
+     cythonize_directives = {
+         'binding': True,
++        'legacy_implicit_noexcept': True,
+     }
+     if OPTION_WITH_COVERAGE:
+         cythonize_directives['linetrace'] = True
diff --git a/srcpkgs/python3-lxml/patches/libxml-2.10.4.patch b/srcpkgs/python3-lxml/patches/libxml-2.10.4.patch
new file mode 100644
index 000000000000..4682eddd6f54
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/libxml-2.10.4.patch
@@ -0,0 +1,17 @@
+From alpine: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/py3-lxml
+
+the find above returns None with this version
+--
+diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py
+index 0339796..790c57a 100644
+--- a/src/lxml/tests/test_etree.py
++++ b/src/lxml/tests/test_etree.py
+@@ -3073,7 +3073,7 @@ class ETreeOnlyTestCase(HelperTestCase):
+         if etree.LIBXML_VERSION < (2, 9, 11):
+             self.assertEqual({'hha': None}, el.nsmap)
+         else:
+-            self.assertEqual({}, el.nsmap)
++            self.assertEqual(None, el)
+ 
+     def test_getchildren(self):
+         Element = self.etree.Element
diff --git a/srcpkgs/python3-lxml/patches/libxml-2.11.0.patch b/srcpkgs/python3-lxml/patches/libxml-2.11.0.patch
new file mode 100644
index 000000000000..6ed59d3b2fe2
--- /dev/null
+++ b/srcpkgs/python3-lxml/patches/libxml-2.11.0.patch
@@ -0,0 +1,14 @@
+From alpine: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/py3-lxml
+
+diff --git a/src/lxml/tests/test_io.py b/src/lxml/tests/test_io.py
+index cbdbcef..efbd3fd 100644
+--- a/src/lxml/tests/test_io.py
++++ b/src/lxml/tests/test_io.py
+@@ -312,6 +312,7 @@ class _IOTestCaseBase(HelperTestCase):
+         self.assertEqual(5, len(boms))
+         xml = uxml.encode("utf-16")
+         self.assertTrue(xml[:2] in boms, repr(xml[:2]))
++        return True
+ 
+         f = tempfile.NamedTemporaryFile(delete=False)
+         try:
diff --git a/srcpkgs/python3-lxml/template b/srcpkgs/python3-lxml/template
index f126c4005fbf..00b246982160 100644
--- a/srcpkgs/python3-lxml/template
+++ b/srcpkgs/python3-lxml/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-lxml'
 pkgname=python3-lxml
-version=4.9.2
+version=4.9.3
 revision=1
 build_style=python3-module
 make_build_args="--with-cython"
@@ -13,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, custom:ElementTree"
 homepage="https://lxml.de/"
 distfiles="https://github.com/lxml/lxml/archive/lxml-${version}.tar.gz"
-checksum=c057e334efc357fc88eb71b888d2df3a44cf3c7aaac56a8753e92090c5217050
+checksum=42b9ab83cb8739d817c7fff41c20f31aa61625bb6f6ab333873a5f3406b139ac
 
 do_check() {
 	make test3

From 3287e868040c505fd4821ca6b2ebde91667ca78c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 20 Jul 2023 20:37:29 -0300
Subject: [PATCH 10/10] python3-scipy: patch and rebuild for
 python3-pybind11-2.11.1

---
 srcpkgs/python3-scipy/patches/pybind11-version.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/python3-scipy/patches/pybind11-version.patch

diff --git a/srcpkgs/python3-scipy/patches/pybind11-version.patch b/srcpkgs/python3-scipy/patches/pybind11-version.patch
new file mode 100644
index 000000000000..ef8565421041
--- /dev/null
+++ b/srcpkgs/python3-scipy/patches/pybind11-version.patch
@@ -0,0 +1,12 @@
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -12,7 +12,7 @@
+ build-backend = 'mesonpy'
+ requires = [
+     "meson-python>=0.12.1,<0.14.0", # already working with 0.13.x series at branch time
+     "Cython>=0.29.35",
+-    "pybind11>=2.10.4,<2.11.0",
++    "pybind11>=2.10.4",
+     "pythran>=0.12.0,<0.14.0", # already working with 0.13.x series at branch time
+     # `wheel` is needed for non-isolated builds, given that `meson-python`
+     # doesn't list it as a runtime requirement (at least in 0.5.0)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some cython updates on top of #45086
  2023-07-20 22:56 [PR PATCH] Some cython updates on top of #45086 tornaria
  2023-07-20 23:11 ` tornaria
  2023-07-20 23:49 ` [PR PATCH] [Updated] " tornaria
@ 2023-07-20 23:50 ` tornaria
  2023-07-21  1:42 ` ahesford
  2023-07-21 19:53 ` [PR PATCH] [Closed]: " tornaria
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-07-20 23:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/45161#issuecomment-1644770490

Comment:
I'm sorry, this was meant to go as a PR on my fork since it's just to get my patches in to run CI and make them available.

~~Why is scipy failing to build here (it worked in #45086)~~ pybind11 update broke scipy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some cython updates on top of #45086
  2023-07-20 22:56 [PR PATCH] Some cython updates on top of #45086 tornaria
                   ` (2 preceding siblings ...)
  2023-07-20 23:50 ` tornaria
@ 2023-07-21  1:42 ` ahesford
  2023-07-21 19:53 ` [PR PATCH] [Closed]: " tornaria
  4 siblings, 0 replies; 6+ messages in thread
From: ahesford @ 2023-07-21  1:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/45161#issuecomment-1644872511

Comment:
Sigh, thanks for catching the pybind11 incompatibility. I fixed this on master already and incorporated all of your commits to date in my cython PR. You can close this PR, or you can leave it open and add any later commits after rebasing on my current branch. (You can also PR against the cython branch on my void-packages fork and I'll pull your changes there.)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Closed]: Some cython updates on top of #45086
  2023-07-20 22:56 [PR PATCH] Some cython updates on top of #45086 tornaria
                   ` (3 preceding siblings ...)
  2023-07-21  1:42 ` ahesford
@ 2023-07-21 19:53 ` tornaria
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-07-21 19:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

There's a closed pull request on the void-packages repository

Some cython updates on top of #45086
https://github.com/void-linux/void-packages/pull/45161

Description:
On top of https://github.com/void-linux/void-packages/pull/45086 here I fix
 - python3-cysignals
 - python3-cypari2
 - python3-fpylll
 - python3-pplpy
 - python3-lxml

The strategy is to be as minimal as possible, e.g. mostly use `legacy_implicit_noexcept=True` and other legacy options when needed, rather than patch.

I'm still working on sagemath, but this should cover all its deps.

@ahesford

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-21 19:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 22:56 [PR PATCH] Some cython updates on top of #45086 tornaria
2023-07-20 23:11 ` tornaria
2023-07-20 23:49 ` [PR PATCH] [Updated] " tornaria
2023-07-20 23:50 ` tornaria
2023-07-21  1:42 ` ahesford
2023-07-21 19:53 ` [PR PATCH] [Closed]: " tornaria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).