{"id":18657,"url":"https://patchwork.libcamera.org/api/patches/18657/?format=json","web_url":"https://patchwork.libcamera.org/patch/18657/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230530092016.34953-2-tomi.valkeinen@ideasonboard.com>","date":"2023-05-30T09:20:12","name":"[libcamera-devel,1/5] py: Fix CameraManager.version property","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"aeacee885768527c552765af689ed25ef59bc936","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/?format=json","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18657/mbox/","series":[{"id":3893,"url":"https://patchwork.libcamera.org/api/series/3893/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3893","date":"2023-05-30T09:20:11","name":"py: Misc changes & move to mainline pybind11","version":1,"mbox":"https://patchwork.libcamera.org/series/3893/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18657/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18657/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EE908C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 May 2023 09:20:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 56831627B7;\n\tTue, 30 May 2023 11:20:57 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CFFE760388\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 May 2023 11:20:55 +0200 (CEST)","from desky.lan (91-154-35-171.elisa-laajakaista.fi [91.154.35.171])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F0AE327C;\n\tTue, 30 May 2023 11:20:34 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685438457;\n\tbh=MojXN5LsK1M08AUQsQRtnbnFG2cVSxHBamwtr1V7GrE=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Yd+UQFCQwG+CMIEU133f/tspJEqaxLRLJXRWArPfOmPytorJysNmMlDt1vGlWrsOQ\n\taKW8JanbuntugSS9gVg+pzQWGbIIMN2/soYi/moVZkQUnQ59swTdgFThYb7EeZtMZY\n\tQb+mQsMYiWlfWyBQB6+NvRh3T1JFgNlgnFymccYXzOHmhls6vWHXwRho1O950ZwaOV\n\tYhFIb7nd8cwVrWIQCb93wZC8aR/BYRmnxQKeFDPtquQ1Bm/PHLSs0GDDzahr+j9oBD\n\tj3OxC2PBrE8/L1tYG7EyLudwXZX+2dJR9kGDl5bLJ6KVR5lE8Xl8a+4DxJpxYpEUbu\n\tD32Sjfl3mvkMg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1685438435;\n\tbh=MojXN5LsK1M08AUQsQRtnbnFG2cVSxHBamwtr1V7GrE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=L0LJm48UCeJtu/36DAl1YeZsNk+ZAk6VMTzt6jSNx5XMPL2QBmuG+qsdVOKENRnZu\n\tUQXpRq8Vrj9O+eGred7xk0lNFf1qi7nr5GAHdScEMAb4lM3mOZ6Wc5imKLG9bVxcVB\n\to3szmxqSAIPsD3C+egufs/0rfiPF8Zwj2GQC4cPE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"L0LJm48U\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 30 May 2023 12:20:12 +0300","Message-Id":"<20230530092016.34953-2-tomi.valkeinen@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20230530092016.34953-1-tomi.valkeinen@ideasonboard.com>","References":"<20230530092016.34953-1-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/5] py: Fix CameraManager.version property","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The current CameraManager.version doesn't work at all (raises a\nTypeError), as that's not how you use expose C++ static methods as\nPython class methods.\n\nFix it.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/py/libcamera/py_main.cpp | 2 +-\n test/py/unittests.py         | 4 ++++\n 2 files changed, 5 insertions(+), 1 deletion(-)","diff":"diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp\nindex d14e18e2..c55495cc 100644\n--- a/src/py/libcamera/py_main.cpp\n+++ b/src/py/libcamera/py_main.cpp\n@@ -105,7 +105,7 @@ PYBIND11_MODULE(_libcamera, m)\n \t\t\treturn cm;\n \t\t})\n \n-\t\t.def_property_readonly(\"version\", &PyCameraManager::version)\n+\t\t.def_property_readonly_static(\"version\", [](py::object /* self */) { return PyCameraManager::version(); })\n \t\t.def(\"get\", &PyCameraManager::get, py::keep_alive<0, 1>())\n \t\t.def_property_readonly(\"cameras\", &PyCameraManager::cameras)\n \ndiff --git a/test/py/unittests.py b/test/py/unittests.py\nindex 6dea80fc..90b04330 100755\n--- a/test/py/unittests.py\n+++ b/test/py/unittests.py\n@@ -68,6 +68,10 @@ class SimpleTestMethods(BaseTestCase):\n         # I expected EBUSY, but looks like double release works fine\n         self.assertZero(ret)\n \n+    def test_version(self):\n+        cm = libcam.CameraManager.singleton()\n+        self.assertIsInstance(cm.version, str)\n+\n \n class CameraTesterBase(BaseTestCase):\n     cm: typing.Any\n","prefixes":["libcamera-devel","1/5"]}