Skip to content

Commit d67c31d

Browse files
committed
[GR-71528] Update pythran
PullRequest: graalpython/4117
2 parents a7f22a5 + 42145fa commit d67c31d

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ dist-type = 'sdist'
413413
version = '1.22.1'
414414
url = 'https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.22.1.tar.gz'
415415

416+
[[optree.rules]]
417+
patch = 'optree.patch'
418+
license = 'Apache-2.0'
419+
416420
[[orjson.rules]]
417421
version = '== 3.9.7'
418422
patch = 'orjson-3.9.7.patch'
@@ -691,10 +695,15 @@ patch = 'pythran-0.15.patch'
691695
license = 'BSD-3-Clause'
692696

693697
[[pythran.rules]]
694-
version = '>= 0.16'
698+
version = '>= 0.16, < 0.18.1'
695699
patch = 'pythran-0.16.patch'
696700
license = 'BSD-3-Clause'
697701

702+
[[pythran.rules]]
703+
version = '== 0.18.1'
704+
patch = 'pythran-0.18.1.patch'
705+
license = 'BSD-3-Clause'
706+
698707
[[pyzmq.rules]]
699708
version = '< 26'
700709
install-priority = 0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/include/optree/pymacros.h b/include/optree/pymacros.h
2+
index 7f2ac9a..ecb6faf 100644
3+
--- a/include/optree/pymacros.h
4+
+++ b/include/optree/pymacros.h
5+
@@ -52,7 +52,7 @@ namespace py = pybind11;
6+
# define Py_IsFalse(x) Py_Is((x), Py_False)
7+
#endif
8+
9+
-inline constexpr Py_ALWAYS_INLINE bool Py_IsConstant(PyObject *x) noexcept {
10+
+inline Py_ALWAYS_INLINE bool Py_IsConstant(PyObject *x) noexcept {
11+
return Py_IsNone(x) || Py_IsTrue(x) || Py_IsFalse(x);
12+
}
13+
#define Py_IsConstant(x) Py_IsConstant(x)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/pythran/pythonic/python/core.hpp b/pythran/pythonic/python/core.hpp
2+
index 86d2f63..050fe21 100644
3+
--- a/pythran/pythonic/python/core.hpp
4+
+++ b/pythran/pythonic/python/core.hpp
5+
@@ -50,7 +50,7 @@ PYTHONIC_NS_BEGIN
6+
namespace python
7+
{
8+
9+
-#ifdef Py_LIMITED_API
10+
+#if defined(Py_LIMITED_API) || defined(GRAALVM_PYTHON)
11+
12+
struct ByteHolder {
13+
PyObject *holder;
14+
diff --git a/pythran/pythonic/types/str.hpp b/pythran/pythonic/types/str.hpp
15+
index a7dd51a..09fdd59 100644
16+
--- a/pythran/pythonic/types/str.hpp
17+
+++ b/pythran/pythonic/types/str.hpp
18+
@@ -732,7 +732,7 @@ namespace std
19+
}())
20+
#else
21+
#ifndef PyString_Check
22+
-#define PyString_Check(x) (PyUnicode_Check(x) && PyUnicode_IS_COMPACT_ASCII(x))
23+
+#define PyString_Check(x) PyUnicode_Check(x)
24+
#endif
25+
#endif
26+
27+
diff --git a/pythran/tables.py b/pythran/tables.py
28+
index a9f5712..5a0dff2 100644
29+
--- a/pythran/tables.py
30+
+++ b/pythran/tables.py
31+
@@ -4633,7 +4633,10 @@ def save_arguments(module_name, elements):
32+
# some function are actually forward function, detect those
33+
# and accept to use our description instead.
34+
if looks_like_a_forward_function(spec):
35+
- assert signature.args.args, "{} require an explicit description".format(elem)
36+
+ # GraalPy change: we have signatures for more builtins than
37+
+ # CPython and this trips up on type constructors like `dict` or
38+
+ # `BaseException`.
39+
+ # assert signature.args.args, "{} require an explicit description".format(elem)
40+
continue
41+
42+
args = [ast.Name(arg, ast.Param(), None, None)

0 commit comments

Comments
 (0)