Patch Detail
Show a patch.
GET /api/patches/18663/?format=api
{ "id": 18663, "url": "https://patchwork.libcamera.org/api/patches/18663/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18663/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20230530120133.99033-2-tomi.valkeinen@ideasonboard.com>", "date": "2023-05-30T12:01:29", "name": "[libcamera-devel,v2,1/5] py: Fix CameraManager.version property", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "aeacee885768527c552765af689ed25ef59bc936", "submitter": { "id": 109, "url": "https://patchwork.libcamera.org/api/people/109/?format=api", "name": "Tomi Valkeinen", "email": "tomi.valkeinen@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18663/mbox/", "series": [ { "id": 3894, "url": "https://patchwork.libcamera.org/api/series/3894/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3894", "date": "2023-05-30T12:01:28", "name": "py: Misc changes & move to mainline pybind11", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3894/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18663/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18663/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 154A8C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 May 2023 12:01:51 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE8E9627D3;\n\tTue, 30 May 2023 14:01:50 +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 E9B5D60599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 May 2023 14:01:47 +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 0C9A37F3;\n\tTue, 30 May 2023 14:01:26 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685448110;\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=x9YWbrp/AxDX1lIfEMDLrxdNJk60fw0qrFeVccRB88dZ+IcVawKn2HmyV0hGvfRru\n\t+bG4AC4KtYShw86JkoZRe+NzWauKhVMArHATGSpCAUaleIN2O3iJqiCpF0NrTR5f9g\n\tamVYaie0xfiy8d9FDrIKluuE6SKD3LX5AW3gRAWdnPLxbT2SkTrEe2Em4KugZQ57T4\n\ttqcpgiQ4rVzXpOUTR0/wYiU8hTYLmmMuQx6NY8ZGCZfmEbxyVJCBQqR6+zp5T4QSxa\n\tsbylkXbK9dwrmnKzkXDv29TxCBWofdIMniAXEnRWB8iKPy9ZlG6jQPhrigZwMepgRB\n\tAwJbHYuyO4Mhw==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1685448087;\n\tbh=MojXN5LsK1M08AUQsQRtnbnFG2cVSxHBamwtr1V7GrE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=weL0xyHR91mR6w7yyttaozCPfEXgdzRrOT7113s5b19FBU5gmMdhhZr0589i3HbRe\n\tz846ABJ0WbBjy4TloyQAie9sbnxcgnNCU0YlJLdyYhguXaT91tWGfQFPtta4K4y3gt\n\tQJicsCZm5hN8Mm2IYu4rpDOaum/6m2hSSbwgsEq8=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"weL0xyHR\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 30 May 2023 15:01:29 +0300", "Message-Id": "<20230530120133.99033-2-tomi.valkeinen@ideasonboard.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230530120133.99033-1-tomi.valkeinen@ideasonboard.com>", "References": "<20230530120133.99033-1-tomi.valkeinen@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 1/5] py: Fix CameraManager.version\n\tproperty", "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", "v2", "1/5" ] }