[{"id":22994,"web_url":"https://patchwork.libcamera.org/comment/22994/","msgid":"<YoPIP6sjWYklPyYa@pendragon.ideasonboard.com>","date":"2022-05-17T16:07:27","subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Tue, May 17, 2022 at 05:33:14PM +0300, Tomi Valkeinen wrote:\n> Add a 'pystubs' build target for building the python stubs.\n> \n> For now this needs to be ran manually. I didn't figure out how to\n> generate the stubs after the libcamera bindings are built.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/py/libcamera/meson.build | 14 +++++++++++++-\n>  1 file changed, 13 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> index 38f619d0..32e74504 100644\n> --- a/src/py/libcamera/meson.build\n> +++ b/src/py/libcamera/meson.build\n> @@ -60,6 +60,18 @@ run_command('ln', '-fsT', '../../../../src/py/libcamera/__init__.py',\n>  \n>  install_data(['__init__.py'], install_dir : destdir)\n>  \n> -# \\todo Generate stubs when building. See https://peps.python.org/pep-0484/#stub-files\n> +# \\todo Generate stubs when building, and install them.\n> +# See https://peps.python.org/pep-0484/#stub-files\n>  # Note: Depends on pybind11-stubgen. To generate pylibcamera stubs:\n>  # $ PYTHONPATH=build/src/py pybind11-stubgen --no-setup-py -o build/src/py libcamera\n> +# The target below can be ran manually, but how to create a meson target that\n> +# is run if pycamera is built?\n> +\n> +stubgen = find_program('pybind11-stubgen', required : false)\n> +\n> +if stubgen.found()\n> +    run_target('pystubs',\n> +               depends: pycamera,\n> +               env: {'PYTHONPATH': meson.project_build_root() / 'src' / 'py'},\n> +               command: [stubgen, '--no-setup-py', '-o', meson.project_build_root() / 'src' / 'py', 'libcamera'])\n> +endif","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 2DDF7C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 16:07:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 50DC565659;\n\tTue, 17 May 2022 18:07:38 +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 90E286041D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 18:07:36 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B9618484;\n\tTue, 17 May 2022 18:07:35 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652803658;\n\tbh=tyoEQFlw4gusQ9QTDy4KUDsMAH8WQ2C1IRf40joonmU=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=xkDqOZnDTp7Mzvq6vJIRLftVxu/1TykCMpKOnKofS84BC+76/HVHfzP3t9Ofdi5VO\n\t5D+6AlT5bx9+ficT1JKsZ0VQtQEbJKqtomweCjbCeAhDpCfGz3Z24SyV1qRGJkDodf\n\tzSUybKKxFT+5cL7wx7Uf6RoSFoSBPW7dA5rhRGnWgvXLPFVuWR7AzlUpBWtoMXaijX\n\t1FNnBjXUchIcCgk/5w4RBFK5kHutOkrwgNquonHBHHbeUhOnpiajbSsmbO6vHE9zGn\n\tBqHsyCSYUezC8ouskmdi/BW+kSHx0XwlmrXK3HALVJyEXICTYaDYRBi6i8Nx29OHmH\n\tcc2OP0AtBLelw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652803656;\n\tbh=tyoEQFlw4gusQ9QTDy4KUDsMAH8WQ2C1IRf40joonmU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gcP1DDBMUzDgdegrfa7Dy5Uv8L1F0jOMDWDlN1ZG1QNE1jLcw9ja30FPCs28xxcRN\n\tkllrP9oprhT/BxnXCnLJ4kfAVSam5yH5V8t3sLfVc3Q7Fs+7Tcuj6lsBgRoOzDn3hF\n\tplwtREm3U/CdoFMmvvPrVHYlFbwqE2/9lPuIIU94="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"gcP1DDBM\"; dkim-atps=neutral","Date":"Tue, 17 May 2022 19:07:27 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YoPIP6sjWYklPyYa@pendragon.ideasonboard.com>","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23000,"web_url":"https://patchwork.libcamera.org/comment/23000/","msgid":"<165280447633.2416244.15693167713687974916@Monstersaurus>","date":"2022-05-17T16:21:16","subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Tomi Valkeinen (2022-05-17 15:33:14)\n> Add a 'pystubs' build target for building the python stubs.\n> \n> For now this needs to be ran manually. I didn't figure out how to\n> generate the stubs after the libcamera bindings are built.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nHrm ... It sounds like this wants to be some sort of post-build step.\n\nSearching quickly seems to find only things like:\n  https://github.com/mesonbuild/meson/issues/2957\n\nWhich seems to suggest a custom target (which is the full target, to\nbuild pycamera, and the stubs?) and have it depend on the pycamera\nshared_module().\n\nBut I'm not sure if that's a full understanding of what you're trying to\nachieve here.\n\nAnyway, having a target is better than expecting a user to execute a\nmanual command successfully - (but I fear at the moment, this won't get\nused directly?)\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/py/libcamera/meson.build | 14 +++++++++++++-\n>  1 file changed, 13 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> index 38f619d0..32e74504 100644\n> --- a/src/py/libcamera/meson.build\n> +++ b/src/py/libcamera/meson.build\n> @@ -60,6 +60,18 @@ run_command('ln', '-fsT', '../../../../src/py/libcamera/__init__.py',\n>  \n>  install_data(['__init__.py'], install_dir : destdir)\n>  \n> -# \\todo Generate stubs when building. See https://peps.python.org/pep-0484/#stub-files\n> +# \\todo Generate stubs when building, and install them.\n> +# See https://peps.python.org/pep-0484/#stub-files\n>  # Note: Depends on pybind11-stubgen. To generate pylibcamera stubs:\n>  # $ PYTHONPATH=build/src/py pybind11-stubgen --no-setup-py -o build/src/py libcamera\n> +# The target below can be ran manually, but how to create a meson target that\n> +# is run if pycamera is built?\n> +\n> +stubgen = find_program('pybind11-stubgen', required : false)\n> +\n> +if stubgen.found()\n> +    run_target('pystubs',\n> +               depends: pycamera,\n> +               env: {'PYTHONPATH': meson.project_build_root() / 'src' / 'py'},\n> +               command: [stubgen, '--no-setup-py', '-o', meson.project_build_root() / 'src' / 'py', 'libcamera'])\n> +endif\n> -- \n> 2.34.1\n>","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 6425BC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 16:21:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BFE0065656;\n\tTue, 17 May 2022 18:21:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 780AE6041D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 18:21:19 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0511948F;\n\tTue, 17 May 2022 18:21:18 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652804480;\n\tbh=vL3t4QdOj9al9Co3ZCBpPACLJiGq0hOxXyMhvggUrO0=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=IYl1My8EU/pQW097pFPoSMQ+vG2jfP5Zsjv6gEcCH/jgL8oIwPR9NqVGSEnbR6mJ7\n\tWG8a24KM4YJfqRZgRR7CtTs83mvuKBJ3uE10BpNVk7DTqmJ0RT/trW0OYJfSYZkvJc\n\taif0As1AkVNL4h3o8qizgRrPsTG+4UHx3aP95545I4Ner9DxYJpr8l2saYIsYV9zFv\n\tjE+NOIS7fvA6PaJwddRFbySc/whpZm6SyNwbKZW/5G9IMQ/RrKSeSqe9ov+HTFphhf\n\teysRo8jjColdv76ltywY5nugmcc42BuI3TBUOJL1wszkJowVOQ16KP62lkdEdAaHZR\n\tQVjZaPp9awIeg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652804479;\n\tbh=vL3t4QdOj9al9Co3ZCBpPACLJiGq0hOxXyMhvggUrO0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=sBCI4IxFOJDzvmMigWJmVD1aFwJtjZMicPNdKL+wa7iGI9va3CN4hdFhPG75MDwY+\n\tJJUM8Asnu0EeKwUzG2s7MK0lyIo3QGGu9MJThCfaAEgG2Om0xcFgLYN4oC8rxDmeO2\n\tlJBF4GvVeNaGSd/Vqsr27U7PyIkuxSj/vBQdHtig="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"sBCI4IxF\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tTomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 17 May 2022 17:21:16 +0100","Message-ID":"<165280447633.2416244.15693167713687974916@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23006,"web_url":"https://patchwork.libcamera.org/comment/23006/","msgid":"<YoPRRH688v8hUG7y@pendragon.ideasonboard.com>","date":"2022-05-17T16:45:56","subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, May 17, 2022 at 07:07:27PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> On Tue, May 17, 2022 at 05:33:14PM +0300, Tomi Valkeinen wrote:\n> > Add a 'pystubs' build target for building the python stubs.\n> > \n> > For now this needs to be ran manually. I didn't figure out how to\n> > generate the stubs after the libcamera bindings are built.\n> > \n> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> > ---\n> >  src/py/libcamera/meson.build | 14 +++++++++++++-\n> >  1 file changed, 13 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\n> > index 38f619d0..32e74504 100644\n> > --- a/src/py/libcamera/meson.build\n> > +++ b/src/py/libcamera/meson.build\n> > @@ -60,6 +60,18 @@ run_command('ln', '-fsT', '../../../../src/py/libcamera/__init__.py',\n> >  \n> >  install_data(['__init__.py'], install_dir : destdir)\n> >  \n> > -# \\todo Generate stubs when building. See https://peps.python.org/pep-0484/#stub-files\n> > +# \\todo Generate stubs when building, and install them.\n> > +# See https://peps.python.org/pep-0484/#stub-files\n> >  # Note: Depends on pybind11-stubgen. To generate pylibcamera stubs:\n> >  # $ PYTHONPATH=build/src/py pybind11-stubgen --no-setup-py -o build/src/py libcamera\n> > +# The target below can be ran manually, but how to create a meson target that\n> > +# is run if pycamera is built?\n> > +\n> > +stubgen = find_program('pybind11-stubgen', required : false)\n> > +\n> > +if stubgen.found()\n> > +    run_target('pystubs',\n> > +               depends: pycamera,\n> > +               env: {'PYTHONPATH': meson.project_build_root() / 'src' / 'py'},\n\nThis requires meson 0.57.\n\n> > +               command: [stubgen, '--no-setup-py', '-o', meson.project_build_root() / 'src' / 'py', 'libcamera'])\n> > +endif","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 D7675C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 16:46:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95EA665656;\n\tTue, 17 May 2022 18:46:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CEBF6041D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 18:46:05 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9D5FE4A8;\n\tTue, 17 May 2022 18:46:04 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652805966;\n\tbh=7oaLjO0zi3BWqubJVwaW+9TMfuu/nnMYI4vWV56JBxA=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=ey285Rk7xhy/hGHdFQe7YWxPMUpvjtkWEwryp/TwqTqt1y9sVWe7QIqHH0D4lQtEx\n\tK10d09U+Px5CFLeq/2P5P/T6Y8goy/dxBE9K6ChNC8sTtcJM8fz/LShaIN0lMf1E7H\n\t1HNZtEp3fBknwolvVE7/4u79VRQgl3iybcO/S0u/F8jo2I0+blNXqDf49/ZMLndxN1\n\t+mC2t66BPYeZA21fKqF8SVHV5FbCvPduQWq3cLPzTcyhoPl//gmx4FeeIMhYqbFv86\n\ta/Eh1ql7ewuNrnhbGl1UtaH9QzEtK5tGyZeV6zcsY4DVW4+XVR1AnjPFIPa73WCACi\n\togAo/gUJ1NDuQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652805964;\n\tbh=7oaLjO0zi3BWqubJVwaW+9TMfuu/nnMYI4vWV56JBxA=;\n\th=Date:From:To:Subject:References:In-Reply-To:From;\n\tb=O20DId4cG0K9z90WQsZb0sHJchZFZKMS4g7Ni1Ym76j1gWO/IQqy8NicSmLbU/WwH\n\taltD9QKzxSlwwsDvu7O2J3oDvWNZHzF0jom7h+u8WGlIpyzSpZfa26/crx9RR6BckK\n\tXl65h05/GL8TcqhpUhKgSG8A4vpVdb68lvb1Ep6M="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"O20DId4c\"; dkim-atps=neutral","Date":"Tue, 17 May 2022 19:45:56 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<YoPRRH688v8hUG7y@pendragon.ideasonboard.com>","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>\n\t<YoPIP6sjWYklPyYa@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YoPIP6sjWYklPyYa@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23027,"web_url":"https://patchwork.libcamera.org/comment/23027/","msgid":"<6735df10-b007-6c1f-e16d-588f7bc0d545@ideasonboard.com>","date":"2022-05-18T06:43:45","subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 17/05/2022 19:21, Kieran Bingham wrote:\n> Quoting Tomi Valkeinen (2022-05-17 15:33:14)\n>> Add a 'pystubs' build target for building the python stubs.\n>>\n>> For now this needs to be ran manually. I didn't figure out how to\n>> generate the stubs after the libcamera bindings are built.\n>>\n>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> \n> Hrm ... It sounds like this wants to be some sort of post-build step.\n> \n> Searching quickly seems to find only things like:\n>    https://github.com/mesonbuild/meson/issues/2957\n> \n> Which seems to suggest a custom target (which is the full target, to\n> build pycamera, and the stubs?) and have it depend on the pycamera\n> shared_module().\n> \n> But I'm not sure if that's a full understanding of what you're trying to\n> achieve here.\n> \n> Anyway, having a target is better than expecting a user to execute a\n> manual command successfully - (but I fear at the moment, this won't get\n> used directly?)\n\nI think custom_target doesn't work, as this can only be built when doing \na native build. You have to be able to use the produced bindings module \nto be able to run stubgen.\n\nI expect that the stubs would eventually be something that are committed \nto the repository, and updated when needed.\n\nAs we also have the meson 0.57 requirement... Maybe I'll just leave this \nout for now.\n\n  Tomi","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 36678C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 06:43:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4B87265656;\n\tWed, 18 May 2022 08:43:49 +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 2552660422\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 08:43:48 +0200 (CEST)","from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F02748F;\n\tWed, 18 May 2022 08:43:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652856229;\n\tbh=8gOYsHBZyJyptXWtNGWCXP4GRgxs1WVsFxT2ZR2ZIzc=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=0W0Ao7a/d+v/vSb1qC6r2CG0maQmg161LcLYEteRavPwbVDt49u/ywsRVR7VxUpVM\n\txakAayGQLEkJGU2RFopZsd0GjX9zgkVIBftyPXAFq09DQoJz6XjVmTPgzvUUFMMjmQ\n\t1DZSxsA1zwPAo/+Oa2mL9BAHd1SY5sLRHU6yOiJgSfscrre2bkspbJb8n2JTqjGHq4\n\tIuJtnH+Aji/gt+GIFNByKRt0xEzTmKxs2G9O24QhpSwlT4HhR4IDhxsEM4tWd8vIGB\n\tA0pa5WrmZL7mWwieRM/PGrYGE8mftFY57JVtjK1Ui0zjr4urPUWpEmsFIgPW0XxiGT\n\tmFScoURYVwtcg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652856227;\n\tbh=8gOYsHBZyJyptXWtNGWCXP4GRgxs1WVsFxT2ZR2ZIzc=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Pc90q4oAC6EbUchRMOTrKNbzzElCm7QataOCykSQFrSMCDOabg7z6zp3H+9XxJR3l\n\trvvHW/+yaE4JL26HsKJ5DPxDfuNTKVwaEEscfjscHgEFbE1khvuHST3TY0rgkF0gy3\n\tJ1j4DpSZhcK169pxpuWICg5OIYIvd0L80EF7lUjU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Pc90q4oA\"; dkim-atps=neutral","Message-ID":"<6735df10-b007-6c1f-e16d-588f7bc0d545@ideasonboard.com>","Date":"Wed, 18 May 2022 09:43:45 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.8.0","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>\n\t<165280447633.2416244.15693167713687974916@Monstersaurus>","In-Reply-To":"<165280447633.2416244.15693167713687974916@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","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>"}},{"id":23045,"web_url":"https://patchwork.libcamera.org/comment/23045/","msgid":"<YoTPHyfljLMcA6mO@pendragon.ideasonboard.com>","date":"2022-05-18T10:49:03","subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nOn Wed, May 18, 2022 at 09:43:45AM +0300, Tomi Valkeinen wrote:\n> On 17/05/2022 19:21, Kieran Bingham wrote:\n> > Quoting Tomi Valkeinen (2022-05-17 15:33:14)\n> >> Add a 'pystubs' build target for building the python stubs.\n> >>\n> >> For now this needs to be ran manually. I didn't figure out how to\n> >> generate the stubs after the libcamera bindings are built.\n> >>\n> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> > \n> > Hrm ... It sounds like this wants to be some sort of post-build step.\n> > \n> > Searching quickly seems to find only things like:\n> >    https://github.com/mesonbuild/meson/issues/2957\n> > \n> > Which seems to suggest a custom target (which is the full target, to\n> > build pycamera, and the stubs?) and have it depend on the pycamera\n> > shared_module().\n> > \n> > But I'm not sure if that's a full understanding of what you're trying to\n> > achieve here.\n> > \n> > Anyway, having a target is better than expecting a user to execute a\n> > manual command successfully - (but I fear at the moment, this won't get\n> > used directly?)\n> \n> I think custom_target doesn't work, as this can only be built when doing \n> a native build. You have to be able to use the produced bindings module \n> to be able to run stubgen.\n\nWe could possibly disable it for cross-builds, using\nmeson.is_cross_build() or meson.can_run_host_binaries() (see\nhttps://mesonbuild.com/Cross-compilation.html#introspection-and-system-checks).\n\n> I expect that the stubs would eventually be something that are committed \n> to the repository, and updated when needed.\n> \n> As we also have the meson 0.57 requirement... Maybe I'll just leave this \n> out for now.\n\nThat's fine with me.","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 CDE09C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 10:49:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 78DA36565A;\n\tWed, 18 May 2022 12:49:11 +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 0A67765656\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 12:49:10 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D9199C4;\n\tWed, 18 May 2022 12:49:09 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652870951;\n\tbh=QmHW1B2oERHxgZ8slnit0Bb3Os1lQ8a98fxmuq9kNPQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=b275zrCaN6ToJq0tNt/XtTQtMc/wwYTLvO6z3imSvAGnFXKR6HlSfDirTsYyVqSJY\n\tqH4YI3298Un7wgM+GVj1t8hGMGQX4GLZPOMnwZXnv1Xr4Jc+qUUYuDithvZFGmufmn\n\tANpeNtzbPVoX4JCAIcLINl0EDnY2d/Z73WHLyD9UehYZ7TYcDKMQ7cGKmSEmVvLzFD\n\tuZGv6dJBCxtx1jkBESfMsX0OZ2sAyzNG+xb0ogJhxaTDOj6ztit9aRTwKA33tv1NB0\n\t5IM1s7GGHVTlrG6bmrA6Ten2aRBY26AgawjzzMlcXIgrR5FVmue/kvUrCMcXNjbcCy\n\tOTTG61WM4JqAA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652870949;\n\tbh=QmHW1B2oERHxgZ8slnit0Bb3Os1lQ8a98fxmuq9kNPQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ZIUWykYjiNwA7WZzvjL0cv0De1lE4tfMbzRqkmR7IhKdBAe6Fp95CiBfZTpEF6X1b\n\tbameEYxpwvJ5RgYLD0QyprK9ozCyp9jNIQvFUhTpo2SuwJPMe37aeCN86cr3/G10jR\n\ty0lGlf/EhyN24KP+wrPwsnKuZQ+JCrpKRcwTvOVU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZIUWykYj\"; dkim-atps=neutral","Date":"Wed, 18 May 2022 13:49:03 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YoTPHyfljLMcA6mO@pendragon.ideasonboard.com>","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-3-tomi.valkeinen@ideasonboard.com>\n\t<165280447633.2416244.15693167713687974916@Monstersaurus>\n\t<6735df10-b007-6c1f-e16d-588f7bc0d545@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<6735df10-b007-6c1f-e16d-588f7bc0d545@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 02/13] py: meson: add pystubs build\n\ttarget","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]