1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
From: Gard Spreemann <gspr@nonempty.org>
Date: Tue, 3 Dec 2024 16:33:29 +0100
Subject: Support for Cython 3
Based on upstream's commit 56464c67067cb201af1acf121bac2f0b3d2e9daa.
Thanks to s3v <c0llapsed@yahoo.it> for the hint and for testing [1].
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087645#10
---
setup.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/setup.py b/setup.py
index eacc352..7b4ee78 100644
--- a/setup.py
+++ b/setup.py
@@ -21,11 +21,14 @@ else:
use_cython = True
-class numpy_include(object):
- """Defers import of numpy until install_requires is through"""
- def __str__(self):
- import numpy
- return numpy.get_include()
+class numpy_include(os.PathLike):
+ """Defers import of numpy until install_requires is through"""
+ def __str__(self):
+ import numpy
+ return numpy.get_include()
+
+ def __fspath__(self):
+ return str(self)
if os.path.isfile("pyspike/cython/cython_add.c") and \
|