Patch Detail
Show a patch.
GET /api/patches/15912/?format=api
{ "id": 15912, "url": "https://patchwork.libcamera.org/api/patches/15912/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15912/", "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": "<20220516141022.96327-7-tomi.valkeinen@ideasonboard.com>", "date": "2022-05-16T14:10:14", "name": "[libcamera-devel,06/14] py: unittests: make typechecker happy", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5fefc98ce38eba1be4168ab89beba4a2edde570a", "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/15912/mbox/", "series": [ { "id": 3113, "url": "https://patchwork.libcamera.org/api/series/3113/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3113", "date": "2022-05-16T14:10:08", "name": "Misc Python bindings patches", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3113/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15912/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15912/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 F16B7C326D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 May 2022 14:10:57 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D31CF6566C;\n\tMon, 16 May 2022 16:10:56 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F051865665\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 May 2022 16:10:50 +0200 (CEST)", "from deskari.lan (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BB6A48F;\n\tMon, 16 May 2022 16:10:50 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652710256;\n\tbh=0K2ROD8e2fMSSZhVgjcTx+alQj+rvakcSDAIWLV9tJ0=;\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=T6TNvMj9HRpei4ti2I1q4buoIb1X0YkhwyasSuRbb5tvCRRLHcA89f1QzdBbmOcqC\n\tV2LiVknUeTCYmsUWXMFf04YWampZIpTuIrksaLJND4lcUKXI5L+4yzqsIn8owH6FLI\n\tVy9CBiL4HVLDU7itnQ3xWG8pe8pAxXOGB7rbIbcSjz6dlM9AwAJX8Hlnj1iC0rfcXM\n\t0RWFMxtun6o+9Y+RijoC8QIj1pmQgGbF3OMwWHFQn5+OQY5idzXzhn5RaNCHlW4iDC\n\tY5ctnYM7GYqAEqvZfBfqZ6XZMQle2nGAbo158Cy3hsPot31DUoewWALFcVWRcI4Srl\n\tolX7BOPssHEJg==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652710250;\n\tbh=0K2ROD8e2fMSSZhVgjcTx+alQj+rvakcSDAIWLV9tJ0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=iy/V0Ij6WeQdV7LYiRfLF+cE3wvv+KKVS6Ic0zIVEAr+AdWSdUWMpl4y7gkeIvk5e\n\t2/2Vs5DxJNbVFpyzvGIYUXo38SIXufGh4KT7/zGfs1Ts6dV8PApOTSSMkIaA4a4I8S\n\t4IzC55bDUUepCPzlkE7q1ae52vskFoHi8PXvj/VM=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"iy/V0Ij6\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>", "Date": "Mon, 16 May 2022 17:10:14 +0300", "Message-Id": "<20220516141022.96327-7-tomi.valkeinen@ideasonboard.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20220516141022.96327-1-tomi.valkeinen@ideasonboard.com>", "References": "<20220516141022.96327-1-tomi.valkeinen@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 06/14] py: unittests: make typechecker\n\thappy", "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": "Add some annotations to reduce the typechecker warnings.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n---\n test/py/unittests.py | 17 +++++++++++------\n 1 file changed, 11 insertions(+), 6 deletions(-)", "diff": "diff --git a/test/py/unittests.py b/test/py/unittests.py\nindex 288dcd48..e5591f3f 100755\n--- a/test/py/unittests.py\n+++ b/test/py/unittests.py\n@@ -10,6 +10,7 @@ import libcamera as libcam\n import os\n import selectors\n import time\n+import typing\n import unittest\n import weakref\n \n@@ -70,6 +71,9 @@ class SimpleTestMethods(BaseTestCase):\n \n \n class CameraTesterBase(BaseTestCase):\n+ cm: typing.Any\n+ cam: typing.Any\n+\n def setUp(self):\n self.cm = libcam.CameraManager.singleton()\n self.cam = next((cam for cam in self.cm.cameras if 'platform/vimc' in cam.id), None)\n@@ -131,8 +135,8 @@ class AllocatorTestMethods(CameraTesterBase):\n self.assertTrue(ret > 0)\n wr_allocator = weakref.ref(allocator)\n \n- buffers = allocator.buffers(stream)\n- buffers = None\n+ buffers = allocator.buffers(stream) # type: ignore\n+ buffers = None # type: ignore\n \n buffer = allocator.buffers(stream)[0]\n self.assertIsNotNone(buffer)\n@@ -166,7 +170,8 @@ class SimpleCaptureMethods(CameraTesterBase):\n self.assertTrue(camconfig.size == 1)\n \n streamconfig = camconfig.at(0)\n- fmts = streamconfig.formats\n+ fmts = streamconfig.formats # type: ignore\n+ fmts = None # type: ignore\n \n ret = cam.configure(camconfig)\n self.assertZero(ret)\n@@ -225,7 +230,7 @@ class SimpleCaptureMethods(CameraTesterBase):\n self.assertTrue(camconfig.size == 1)\n \n streamconfig = camconfig.at(0)\n- fmts = streamconfig.formats\n+ fmts = streamconfig.formats # type: ignore\n \n ret = cam.configure(camconfig)\n self.assertZero(ret)\n@@ -349,9 +354,9 @@ if __name__ == '__main__':\n gc.unfreeze()\n gc.collect()\n \n- obs_after = get_all_objects([obs_before])\n+ obs_after = get_all_objects([obs_before]) # type: ignore\n \n- before = create_type_count_map(obs_before)\n+ before = create_type_count_map(obs_before) # type: ignore\n after = create_type_count_map(obs_after)\n \n leaks = diff_type_count_maps(before, after)\n", "prefixes": [ "libcamera-devel", "06/14" ] }