public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Nikita Popov <npopov@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-nanobind] rawhide: Update to nanobind 2.15.0
Date: Mon, 09 Nov 2026 13:09:47 GMT [thread overview]
Message-ID: <179422978714.1.12475618941914485192.rpms-python-nanobind-2611d44fc4fd@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-nanobind
Branch : rawhide
Commit : 2611d44fc4fd9f934fa8a77d256f5ea1dd54ef85
Author : Nikita Popov <npopov@redhat.com>
Date : 2026-11-06T14:51:23+01:00
Stats : +119/-6 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/python-nanobind/c/2611d44fc4fd9f934fa8a77d256f5ea1dd54ef85?branch=rawhide
Log:
Update to nanobind 2.15.0
We were not able to update to nanobind 3.0 because it's not suppored
by LLVM yet, but we should update to a newer nanobind 2.x release.
It will be required by https://github.com/llvm/llvm-project/pull/232181
when building against Python 3.15.
---
diff --git a/0001-Avoid-implicit-conversions.patch b/0001-Avoid-implicit-conversions.patch
new file mode 100644
index 0000000..227d54e
--- /dev/null
+++ b/0001-Avoid-implicit-conversions.patch
@@ -0,0 +1,77 @@
+From 64d680246af169f45bcc2ef9f61f3ab1ae218f93 Mon Sep 17 00:00:00 2001
+From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
+Date: Tue, 13 Oct 2026 14:55:49 -0300
+Subject: [PATCH] Avoid implicit conversions
+
+Ensure the following conversions are explicit in order to avoid errors
+reported by the compiler, e.g.:
+
+error: implicit conversion changes signedness: 'uint32_t' (aka 'unsigned int') to 'Py_ssize_t' (aka 'int') [-Werror,-Wsign-conversion]
+
+This fixes issues on 32-bit x86.
+
+(cherry picked from commit ee0382688c026b95711fd142f4912cc132a3ae30)
+---
+ src/nb_func.cpp | 8 ++++----
+ src/nb_type.cpp | 4 ++--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/nb_func.cpp b/src/nb_func.cpp
+index d9e1fee..b86397c 100644
+--- a/src/nb_func.cpp
++++ b/src/nb_func.cpp
+@@ -1639,12 +1639,12 @@ PyObject *nb_func_get_nb_signature(PyObject *self, void *) {
+ *defaults = nullptr;
+
+ func_data *f = nb_func_data(self);
+- uint32_t count = (uint32_t) Py_SIZE(self);
++ Py_ssize_t count = Py_SIZE(self);
+ PyObject *result = PyTuple_New(count);
+ if (!result)
+ return nullptr;
+
+- for (uint32_t i = 0; i < count; ++i) {
++ for (Py_ssize_t i = 0; i < count; ++i) {
+ docstr = item = sigstr = defaults = nullptr;
+
+ const func_data *fi = f + i;
+@@ -1665,7 +1665,7 @@ PyObject *nb_func_get_nb_signature(PyObject *self, void *) {
+ item = PyTuple_New(3);
+ sigstr = PyUnicode_FromString(buf.get());
+ if (n_default_args) {
+- defaults = PyTuple_New(n_default_args);
++ defaults = PyTuple_New((Py_ssize_t) n_default_args);
+ } else {
+ defaults = Py_None;
+ Py_INCREF(defaults);
+@@ -1699,7 +1699,7 @@ PyObject *nb_func_get_nb_signature(PyObject *self, void *) {
+ NB_TUPLE_SET_ITEM(item, 0, sigstr);
+ NB_TUPLE_SET_ITEM(item, 1, docstr);
+ NB_TUPLE_SET_ITEM(item, 2, defaults);
+- NB_TUPLE_SET_ITEM(result, (Py_ssize_t) i, item);
++ NB_TUPLE_SET_ITEM(result, i, item);
+ }
+
+ return result;
+diff --git a/src/nb_type.cpp b/src/nb_type.cpp
+index f31e498..8f1344b 100644
+--- a/src/nb_type.cpp
++++ b/src/nb_type.cpp
+@@ -24,12 +24,12 @@ NAMESPACE_BEGIN(NB_NAMESPACE)
+ NAMESPACE_BEGIN(detail)
+
+ static PyObject **nb_dict_ptr(PyObject *self, PyTypeObject *tp) {
+- Py_ssize_t dictoffset = nb_type_data(tp)->dictoffset;
++ Py_ssize_t dictoffset = (Py_ssize_t) nb_type_data(tp)->dictoffset;
+ return dictoffset ? (PyObject **) ((uint8_t *) self + dictoffset) : nullptr;
+ }
+
+ static PyObject **nb_weaklist_ptr(PyObject *self, PyTypeObject *tp) {
+- Py_ssize_t weaklistoffset = nb_type_data(tp)->weaklistoffset;
++ Py_ssize_t weaklistoffset = (Py_ssize_t) nb_type_data(tp)->weaklistoffset;
+ return weaklistoffset ? (PyObject **) ((uint8_t *) self + weaklistoffset) : nullptr;
+ }
+
+--
+2.56.0
+
diff --git a/0001-Avoid-more-implicit-conversions.patch b/0001-Avoid-more-implicit-conversions.patch
new file mode 100644
index 0000000..01e9aa3
--- /dev/null
+++ b/0001-Avoid-more-implicit-conversions.patch
@@ -0,0 +1,34 @@
+From 953cc2b9b3574a1303928de4e520b69ae4629bf8 Mon Sep 17 00:00:00 2001
+From: Nikita Popov <npopov@redhat.com>
+Date: Fri, 6 Nov 2026 14:44:49 +0100
+Subject: [PATCH] Avoid more implicit conversions
+
+---
+ include/nanobind/eigen/dense.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/nanobind/eigen/dense.h b/include/nanobind/eigen/dense.h
+index 8ba181b..d24de6b 100644
+--- a/include/nanobind/eigen/dense.h
++++ b/include/nanobind/eigen/dense.h
+@@ -317,13 +317,13 @@ struct type_caster<Eigen::Map<T, Options, StrideType>,
+ constexpr int IS = StrideType::InnerStrideAtCompileTime,
+ OS = StrideType::OuterStrideAtCompileTime;
+
+- int64_t inner = caster.value.stride(0),
+- outer;
++ Eigen::Index inner = (Eigen::Index) caster.value.stride(0),
++ outer;
+
+ if constexpr (ndim_v<T> == 1)
+- outer = (int64_t) caster.value.shape(0);
++ outer = (Eigen::Index) caster.value.shape(0);
+ else
+- outer = caster.value.stride(1);
++ outer = (Eigen::Index) caster.value.stride(1);
+
+ (void) inner; (void) outer;
+ if constexpr (ndim_v<T> == 2 && T::IsRowMajor)
+--
+2.56.0
+
diff --git a/python-nanobind.spec b/python-nanobind.spec
index 1e55ae3..a47767f 100644
--- a/python-nanobind.spec
+++ b/python-nanobind.spec
@@ -15,11 +15,8 @@ Name: python-nanobind
# WARNING: Before updating the version, check if LLVM and sundials support the new version:
# https://github.com/llvm/llvm-project/blob/main/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
# https://github.com/llnl/sundials/blob/main/pyproject.toml
-Version: 2.12.0
-# TODO: Remove the '-b 5' part when the version is updated.
-# This was a temporary measure in order to deal with a revert in the
-# version.
-Release: %autorelease -b 5
+Version: 2.15.0
+Release: %autorelease
Summary: Tiny and efficient C++/Python bindings
License: BSD-3-Clause
@@ -27,6 +24,11 @@ URL: https://nanobind.readthedocs.org/
VCS: git:%{nanobind_giturl}.git
Source0: %{nanobind_giturl}/archive/v%{version}/%{name}-%{version}.tar.gz
+# Fixes i686 build.
+# https://github.com/wjakob/nanobind/pull/1453
+Patch: 0001-Avoid-implicit-conversions.patch
+Patch: 0001-Avoid-more-implicit-conversions.patch
+
BuildRequires: clang
BuildRequires: cmake
BuildRequires: eigen3-devel
diff --git a/sources b/sources
index b7f283d..826d430 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (python-nanobind-2.12.0.tar.gz) = a187f0efae1833b2caeaff41074a3d8fbd866ee1874aac088ffd5daf026aeaa6a73a8943b682bd39ef59b755e36b73a221eaf71343a28351dce0c8f284debdd9
+SHA512 (python-nanobind-2.15.0.tar.gz) = 376c4e86cec0e97fe9d6d844fe4e79c1cbfdd2d6355d68ee5b8acff4329983044ea0f22d0948f731ee82009afa7bba837f4f849967c831bad9ea322ffb52fc00
reply other threads:[~2026-11-09 13:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179422978714.1.12475618941914485192.rpms-python-nanobind-2611d44fc4fd@fedoraproject.org \
--to=npopov@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox