diff --git a/graalpython/lib-graalpython/patches/metadata.toml b/graalpython/lib-graalpython/patches/metadata.toml index 0c326ce5e6..04daa09fef 100644 --- a/graalpython/lib-graalpython/patches/metadata.toml +++ b/graalpython/lib-graalpython/patches/metadata.toml @@ -413,6 +413,10 @@ dist-type = 'sdist' version = '1.22.1' url = 'https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.22.1.tar.gz' +[[optree.rules]] +patch = 'optree.patch' +license = 'Apache-2.0' + [[orjson.rules]] version = '== 3.9.7' patch = 'orjson-3.9.7.patch' @@ -691,10 +695,15 @@ patch = 'pythran-0.15.patch' license = 'BSD-3-Clause' [[pythran.rules]] -version = '>= 0.16' +version = '>= 0.16, < 0.18.1' patch = 'pythran-0.16.patch' license = 'BSD-3-Clause' +[[pythran.rules]] +version = '== 0.18.1' +patch = 'pythran-0.18.1.patch' +license = 'BSD-3-Clause' + [[pyzmq.rules]] version = '< 26' install-priority = 0 diff --git a/graalpython/lib-graalpython/patches/optree.patch b/graalpython/lib-graalpython/patches/optree.patch new file mode 100644 index 0000000000..c41a0bf4ad --- /dev/null +++ b/graalpython/lib-graalpython/patches/optree.patch @@ -0,0 +1,13 @@ +diff --git a/include/optree/pymacros.h b/include/optree/pymacros.h +index 7f2ac9a..ecb6faf 100644 +--- a/include/optree/pymacros.h ++++ b/include/optree/pymacros.h +@@ -52,7 +52,7 @@ namespace py = pybind11; + # define Py_IsFalse(x) Py_Is((x), Py_False) + #endif + +-inline constexpr Py_ALWAYS_INLINE bool Py_IsConstant(PyObject *x) noexcept { ++inline Py_ALWAYS_INLINE bool Py_IsConstant(PyObject *x) noexcept { + return Py_IsNone(x) || Py_IsTrue(x) || Py_IsFalse(x); + } + #define Py_IsConstant(x) Py_IsConstant(x) diff --git a/graalpython/lib-graalpython/patches/pythran-0.18.1.patch b/graalpython/lib-graalpython/patches/pythran-0.18.1.patch new file mode 100644 index 0000000000..a6657e2330 --- /dev/null +++ b/graalpython/lib-graalpython/patches/pythran-0.18.1.patch @@ -0,0 +1,42 @@ +diff --git a/pythran/pythonic/python/core.hpp b/pythran/pythonic/python/core.hpp +index 86d2f63..050fe21 100644 +--- a/pythran/pythonic/python/core.hpp ++++ b/pythran/pythonic/python/core.hpp +@@ -50,7 +50,7 @@ PYTHONIC_NS_BEGIN + namespace python + { + +-#ifdef Py_LIMITED_API ++#if defined(Py_LIMITED_API) || defined(GRAALVM_PYTHON) + + struct ByteHolder { + PyObject *holder; +diff --git a/pythran/pythonic/types/str.hpp b/pythran/pythonic/types/str.hpp +index a7dd51a..09fdd59 100644 +--- a/pythran/pythonic/types/str.hpp ++++ b/pythran/pythonic/types/str.hpp +@@ -732,7 +732,7 @@ namespace std + }()) + #else + #ifndef PyString_Check +-#define PyString_Check(x) (PyUnicode_Check(x) && PyUnicode_IS_COMPACT_ASCII(x)) ++#define PyString_Check(x) PyUnicode_Check(x) + #endif + #endif + +diff --git a/pythran/tables.py b/pythran/tables.py +index a9f5712..5a0dff2 100644 +--- a/pythran/tables.py ++++ b/pythran/tables.py +@@ -4633,7 +4633,10 @@ def save_arguments(module_name, elements): + # some function are actually forward function, detect those + # and accept to use our description instead. + if looks_like_a_forward_function(spec): +- assert signature.args.args, "{} require an explicit description".format(elem) ++ # GraalPy change: we have signatures for more builtins than ++ # CPython and this trips up on type constructors like `dict` or ++ # `BaseException`. ++ # assert signature.args.args, "{} require an explicit description".format(elem) + continue + + args = [ast.Name(arg, ast.Param(), None, None)