From patchwork Tue Jun 16 21:31:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B37E5CD98F5 for ; Tue, 16 Jun 2026 21:31:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1849.1781645505827108296 for ; Tue, 16 Jun 2026 14:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=g353fVqC; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVjSr290773 for ; Tue, 16 Jun 2026 14:31:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=HEge4qrUzNScL/ouTtbg/1ISDrfsIW7VBV5kPsT6xwY=; b= g353fVqCdg06n0/xBusMTkDHD6DdWYcJYSvTtx6mFnwwWbwcFg5w4d6QU4grl3xx f2+vLs0/qUNO/KiAHL6nMenmd49tpCYF7JTT96SC42w0nAvrt5/tI4O67Pc/uRxS qUyJw5po2kkxqFck5fg/VQuCzTNmCrs10FEQQhrREV17tmjN99icphduXZ4t5nEN rOCJDDmhSZuYdn3MT0BuIm7iMwwWh8PTNvnxTFklE41+HNTTZLMTDMpXs+6P19Eh NoyRmy7DdzfOK3Z/CP1UGLhup9CVpXks+qZ1a2fZ8l1iJAArsCxLWzAJwtyFCThF s8rWccuCUUn3rgxN2SR83g== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4euefbr03v-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:45 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:44 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:44 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:21 -0700 Subject: [PATCH v3 01/10] bitbake-setup: Resolve unused loop control variables MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-1-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-GUID: L67LyQosCydTx6z_lpiLer7CM6rFKJat X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX9tc50Gs7JeHk lwKswl4y1H1h/ctOksxEbOn2lK6J24nFpurxlXa4ON7zho62ziWzPdNVBelXXZ3F8vjYlWD+HGK U503EsjUPo5M/fTXg6n0si4NSAxnjj8m3hdm5Y1E5DLgtYKKDdIfwDdxibqTGiP4Ra+GkcFELio A7T0BEzz8EIldPBDm78c/iVFsS6epI/Fn+i5Fgsm41P0i9dzLGIEE5CLVQ6X6ZfszSfVPF4PFxK s+1GjrZ5wram+uZ7tjHN/Ou2Yv5mw6uk2Uei17CWyRn1YMOSHIPmUkRC9q4u05QvDCIcAYUJKDH +WQK1ed81pL/ZiJyOZmcOAzBT1W6Vnr0CjpX6I35QelQCDZ8rot3NtWfae7QcS1O3bTo/Q2H1wv yEozgy265QUyB2kv9NFBZWc8MI1nFg== X-Authority-Analysis: v=2.4 cv=B4qJFutM c=1 sm=1 tr=0 ts=6a31c0c1 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=HK-ge7EqtdluswH-FwHe:22 a=t7CeM3EgAAAA:8 a=sUOjBdtlMpAVF4UGVlkA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: L67LyQosCydTx6z_lpiLer7CM6rFKJat X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX6Y9LuprxMgjU Qs8lmjgHAbRAzGWoeAXwya4BwI6zzoADjvLeMXtJz+wznf/dw6fA2930NPNM2PXISquj7nSJGLw NkCpSP8m7Dlw4o2QKwrpIriJofLyhBkTDI0phGXgMwJRf7GBKvUj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19717 The ruff lint tool reported loop control variables that were not being used: B007 Loop control variable `dirs` not used within loop body Replace dirs with an underscore to indicate that the value is being discarded. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 2829e753..508d141f 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -134,7 +134,7 @@ def commit_config(config_dir): def _write_layer_list(dest, repodirs): layers = [] for r in repodirs: - for root, dirs, files in os.walk(os.path.join(dest,r)): + for root, _, files in os.walk(os.path.join(dest,r)): if os.path.basename(root) == 'conf' and 'layer.conf' in files: layers.append(os.path.relpath(os.path.dirname(root), dest)) layers_f = os.path.join(dest, ".oe-layers.json") @@ -449,7 +449,7 @@ The bitbake configuration files (local.conf, bblayers.conf and more) can be foun configure_vscode(setupdir, layerdir, bitbake_builddir, init_script) def get_registry_config(registry_path, id): - for root, dirs, files in os.walk(registry_path): + for root, _, files in os.walk(registry_path): for f in files: if f.endswith('.conf.json') and id == get_config_name(f): return os.path.join(root, f) @@ -1000,7 +1000,7 @@ def has_expired(expiry_date): def list_registry(registry_path, with_expired): json_data = {} - for root, dirs, files in os.walk(registry_path): + for root, _, files in os.walk(registry_path): for f in files: if f.endswith('.conf.json'): config_name = get_config_name(f) From patchwork Tue Jun 16 21:31:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42FC2CD98F0 for ; Tue, 16 Jun 2026 21:31:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1851.1781645506349787486 for ; Tue, 16 Jun 2026 14:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=UJ0mh8d3; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0b495812 for ; Tue, 16 Jun 2026 14:31:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=EZOpwPLCPjCphqfLDR/hN1GnkBpuifbGBuiJFz4lKEk=; b= UJ0mh8d3cv4QajoFmk/p+wCrgT2lDDDxSGqv97pkynQkz+yQseZJRTLmv3v/RMQl 9acuxB8KX+XVt2Th8tbQn198x2L3oQX23HdWaYNlAB4XDC54TAKKsPkJU46PAnUX idz+dL3yzlalrdKgJrgcDqwYal37IynyVhg0H6uxaA28Pr8mkgE53+xLLhH19jFv fTRCTsQi2q/tKiU1YG+cTLX0wT13HNEdh0jZ9p+eN2jWq7nmdPvAjmK/m9WUxrw5 mDrzD7xIUA9lFy0IfKZ8Cf/dQa72UUVHwxQNCINefdCQ1aKtUYYefsfjbL15CE74 CkTba8m/D8jIMYqshe263A== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:45 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:45 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:45 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:22 -0700 Subject: [PATCH v3 02/10] bitbake-setup: Fix ambiguous variable names MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-2-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: VvuqkzOGTwwmAKBjWm04RdO03uCb5tt6 X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c1 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=Aatwvv_jfEF2aNKkGsIA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: VvuqkzOGTwwmAKBjWm04RdO03uCb5tt6 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX5fl5pIooR02v DwpRVXPI+qI+RmAI8sUdLHqSZ980mOC/igDF7ZzRAklXtvtxtTzE07nBVMUXIDnbrLcu4TM3rOI SmjSuxr4bdLHVFbZszERDMyFLGviGfDc1rLNvdKFJ/TYdQAFCXP4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX4JdXIOmVICMp 6oglZO830ylNr4+jJmKqxSxEwnUxyGZ2eLYi2hqdLKS5+MGOIYK0RSpPiXUsf/+DNjcw51v8INp Cjo0/ZzZ6pwZawhKG8nP3o73P9R3s8zXqDOIg74jPi5Hl4OzVeu3S072EolMreUh6ue20qlUYIv rP+1BRqzBDW83h4pZsjkW81bWlMIwMbPPcwtDMXGzBed3alsoW8sYcoIyu0FsEFJ/UDtWRXPxBg jE+Gbuk7RW5XhgkAwBKmTkwg/f4NmVj03jiXDCYLOp+mLN+3x+QnD1iza5NjuNdwUltLyd3dfeS 6uu4EpOSUJDPtXiP0W8cvKdiT+DV7n4W6YNJmYHc0MLC4YVX1R8DIdl9ncN8iw9zWJI8vCP/yao DyaLKUQMfkRqT4Ol/VGSTlY4sHVrQu5MVDF82hIS4hU/fNv2MC6gt4vKlJ2pXCjPDjLmMpGjDvV jrQrLor2Go5n9HsBUgg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19715 The ruff lint tool detected use of ambiguous variables that were named with a single letter: E741 Ambiguous variable name: `l` E741 Ambiguous variable name: `f` This replaces the variables with a descriptive variable to add clarity. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 508d141f..664bffee 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -248,11 +248,11 @@ bitbake-setup init -L {} /path/to/repo/checkout""".format( if oesetupbuild: links = {'setup-build': oesetupbuild, 'oe-scripts': os.path.dirname(oesetupbuild), 'oe-init-build-env-dir': oeinitbuildenvdir} - for l,t in links.items(): - symlink = os.path.join(layerdir, l) + for link,item in links.items(): + symlink = os.path.join(layerdir, link) if os.path.lexists(symlink): os.remove(symlink) - os.symlink(os.path.relpath(t,layerdir),symlink) + os.symlink(os.path.relpath(item,layerdir),symlink) return layers_fixed_revisions @@ -261,19 +261,19 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c os.makedirs(build_conf_dir) layers_s = [] - for l in layers: - l = os.path.join(layerdir, l) - layers_s.append(" {} \\".format(l)) + for layer in layers: + layer = os.path.join(layerdir, layer) + layers_s.append(" {} \\".format(layer)) - for l in filerelative_layers: + for layer in filerelative_layers: if thisdir: - l = os.path.join(thisdir, l) + layer = os.path.join(thisdir, layer) else: raise Exception("Configuration is using bb-layers-file-relative to specify " \ "a layer path relative to itself. This can be done only " \ "when the configuration is specified by its path on local " \ "disk, not when it's in a registry or is fetched over http.") - layers_s.append(" {} \\".format(l)) + layers_s.append(" {} \\".format(layer)) layers_s = "\n".join(layers_s) bblayers_conf = """BBLAYERS ?= " \\ @@ -450,9 +450,9 @@ The bitbake configuration files (local.conf, bblayers.conf and more) can be foun def get_registry_config(registry_path, id): for root, _, files in os.walk(registry_path): - for f in files: - if f.endswith('.conf.json') and id == get_config_name(f): - return os.path.join(root, f) + for file in files: + if file.endswith('.conf.json') and id == get_config_name(file): + return os.path.join(root, file) raise Exception("Unable to find {} in available configurations; use 'list' sub-command to see what is available".format(id)) def merge_overrides_into_sources(sources, overrides): @@ -1001,10 +1001,10 @@ def list_registry(registry_path, with_expired): json_data = {} for root, _, files in os.walk(registry_path): - for f in files: - if f.endswith('.conf.json'): - config_name = get_config_name(f) - config_data = json.load(open(os.path.join(root, f))) + for file in files: + if file.endswith('.conf.json'): + config_name = get_config_name(file) + config_data = json.load(open(os.path.join(root, file))) config_desc = config_data["description"] expiry_date = config_data.get("expires", None) if expiry_date: From patchwork Tue Jun 16 21:31:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE1ECD98F2 for ; Tue, 16 Jun 2026 21:31:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1852.1781645506802785077 for ; Tue, 16 Jun 2026 14:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=f/03QdJk; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0c495812 for ; Tue, 16 Jun 2026 14:31:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=/P9l0UZAoehUJtn6+jkWXhFf8pVNmgOPA/7kWBuoaRA=; b= f/03QdJkokTgt2u6En0xd/629EwbB7AvqkBSfJseSieGxt3yDeo2TgJis2EEZ87g 23AZhc8s4r4kak4CfViLJsHWy4g0prWKW4AvupRp5me5DUOqjxL5aboh549qkRHX ICjTlbg/gvqBug4lGXrupuhbzSettqUcxiSpvSZLVli/t+ApXhw240T/8AYXu0cy uqj2e/azddUWLKeKhRSG/EbiVa2Nk8w7Yrxq2fHFIPHKsday4MqhaG97A60OcQv7 l+BTNHUL2Y2SjkhF5CkHOtcJzBlO1UZ6j7Czl8oVQzsyLDVu+pJtvr0N6dTqj1qn KiPj9NcRPjCJSHvzJELwPg== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:46 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:45 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:45 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:23 -0700 Subject: [PATCH v3 03/10] bitbake-setup: Add checks for version information MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-3-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: 35x31McTRYAny2X9nCLqnQWny2GaClkU X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c2 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=vUYKkVZVldypNouynCYA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: 35x31McTRYAny2X9nCLqnQWny2GaClkU X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX4T0JFYv14Fgt NMb01BECF4wvAHKwf38UnKRCulXyDaeJ5f+5gaG4x7g/oI1e4al811N+hXGf4Mfu8+wnvigWkp6 bgNIgxYoL+NCVQYv6mjPYuXVXyW7OWDGMzBK4xnjXpN7cnWH2AIR X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfXz41ltEFtWwgq rbAHnM1Z0g8iy4ClCIFvhMcRn0Fz7lJoaxquk0KUPbD4DiwIvOPr3FFj9Y3o8MGXngvqteCKsIh 14+Xt9VwLXHBcP1SwQ8mE9qLfO38s9alTWdFE0t4Wk+WK/DolkEgcbk3OhiRZemqAOOGaHCYUDH xv6ycu0rNc0xSo64cAfpUs9at5aaR9/afpUGTLSib/Yhx/66+Ew3FuCag3cY5BPbAMY2NUpV4hP g0iExJYy7YvaaliQGTFgkmvxGxlw2+aZhHZQD1Ahw25ooVBNcg20DkaxhafFS/mSQ1zzC3weXeD YgJ5GZXW41PRGpFYs5m158gqQkDtWvFuX0NCmq+rfzMUBKVp22SyxYjn52wxoYOC8oP99D5rCwi KBadWVQSmqzTxf5O3NoXNpIUmcnpT0gyy+7NLkI7oGUMszTfTbMno/WP50XMY2a/8vKplSI3J8n jcxx6JLcKXNzJ+XdPpA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19716 The __version__ has been present since bbmake to ensure that the Python script uses the appropriate bb module. Other bitbake-* scripts do not check the version. When executed in place, the bitbake-* scripts manipulate sys.path to find the bb module in ../lib. This path is inserted to the beginning of sys.path and it cannot be overridden by any other modules named bb. This commit adds a check for ../lib/bb/__init__.py before making changes to sys.path. It falls back to importing the bitbake_setup module using a custom bitbake_setup package. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 664bffee..ed9b0947 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -23,10 +23,33 @@ import time bindir = os.path.abspath(os.path.dirname(__file__)) -sys.path[0:0] = [os.path.join(os.path.dirname(bindir), 'lib')] +libdir = os.path.join(os.path.dirname(bindir), 'lib') +bbfile = os.path.join(libdir, 'bb', '__init__.py') -import bb.msg # noqa: E402 -import bb.process # noqa: E402 +# Obtain __version__ and import bb +if os.path.exists(bbfile): + # Execute bitbake-setup in git repository + try: + sys.path[0:0] = [libdir] + import bb.msg # noqa: E402 + import bb.process # noqa: E402 + from bb import __version__ # noqa: E402 + except ImportError as e: + print(f"Could not import bb from lib: {e}") +else: + # Execute bitbake-setup installed with packages + try: + from importlib.metadata import version, PackageNotFoundError # noqa:E402 + try: + import bb.msg # noqa: E402 + import bb.process # noqa: E402 + __version__ = version("bitbake_setup") + except ImportError as e: + print(f"Could not import bb: {e}") + except PackageNotFoundError as e: + print(f"Could not find package bb: {e}") + except ImportError as e: + print(f"Could not import bb from package: {e}") logger = bb.msg.logger_create('bitbake-setup', sys.stdout) From patchwork Tue Jun 16 21:31:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E18DCD98EC for ; Tue, 16 Jun 2026 21:31:49 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1755.1781645507085556707 for ; Tue, 16 Jun 2026 14:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=HldqHRPl; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0d495812 for ; Tue, 16 Jun 2026 14:31:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=rruTfr2PyUMiN4KrGgwauqabR3iINi+UDhbs6HKTTrA=; b= HldqHRPlujtl6Vvk8I2XBnn265mqtOxhu/BJf6+3MaKUcVOJf41DsItVGSBg449O Mn57z0hvFyTlSRtzF/WPze+PYG8Zq18KPnRJbFuH38fgsYj6EG0DEOJOM2IKv54U MQI5+/EMzTlEnYe6fnMwQ1hVW4TbWGow2L5mj3vQHpeMzATBTNgdNLHtpN0V5on6 pXkP7Ur0TlSJ7I9APmY1eRaFb9xti+H/QX45FN3z60yrlnX+tCg85u1tlyTDeg9b j5U89xhRrqjh5/hLzR0pGKXI1oP4xDJueSjq3AVmn8w7ApwUjr7coljbdCHM7axe dWYSXTdvcT3CbXRJeZROEA== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:46 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:45 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:45 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:24 -0700 Subject: [PATCH v3 04/10] bitbake-setup: Add version option MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-4-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: rOlAknSjZni1LYJhSCpLp8NlQM14kjM3 X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c2 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=3MZ2cW2_6ngPcrpQ0mEA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: rOlAknSjZni1LYJhSCpLp8NlQM14kjM3 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX/S9hgMcPQdpY FOI1G0DyABL+8DtGTIl8ewn7LGoadm/KZRnXp3y2A6SmK+BWvRrOXORP/KRhpgYLgo66spv0RPL 4Yby3u0Bhe8BGdivhFyawLg6W2TpXA1PqD86Q034lvF5RbRe59EL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX2DPmSG5nnQsP CU/9fl68fVCVX/ZaWGeLvToPCXIBI/oQCSava4JpRWU4O5+UFX6jJVNXvUyIsGbV59cQbDJ3jJY Sz0LIPC8CIcruWOx3REt9FtYWUN0Jv3Bsl4SfpNdx2OmzDUVogvIMhOeX5/TwJg7yzzsQnkhpxH WkdWfvgO+D8QFv44ESHblEEy+y/Nbwt4oD2Lc5HEXIa2cnZ4aSRwPEYXI25gJbfsJHVSvIY6ES0 4ck7bQaaEPpSFsNBBuZ97EhAZBpeBuiM1REdBn4ETDmC4sCRFI/2CBDVUk9sZV7C1MhzYs1zEFG YoM65Bkmznp9wQ+9cuHZKVkUvmwHXLakwgBLBa8hAseg3z/8GZZmL0IamOd9gazGxDR8X2JG5DK WQckFM/sO4wLW3fJi/RnC9DgYv4eewVzzIm98WYqitRKiYCkPJIxXeNchQREhnIoa9Y9iqZhl0V vKuLsRP28H+7BAar90w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19714 This adds the long-form version option to match bitbake. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index ed9b0947..8218a500 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -1267,6 +1267,7 @@ def main(): ) parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') + parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') parser.add_argument('--no-network', action='store_true', help='Do not check whether configuration repositories and layer repositories have been updated; use only the local cache.') parser.add_argument('--global-settings', action='store', metavar='PATH', help='Path to the global settings file.') From patchwork Tue Jun 16 21:31:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDB5ECD98F1 for ; Tue, 16 Jun 2026 21:31:49 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1853.1781645507433149826 for ; Tue, 16 Jun 2026 14:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=r01HiSvr; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0e495812 for ; Tue, 16 Jun 2026 14:31:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=RNJj7MsXb0gMdxwiqLzb11JhauFrQZdxjJ+wsTBuen4=; b= r01HiSvrgV7B+rayK9ApBejOh6S/0/BdT4vTGPANyEg81UUYVhMkt2gQjljtUNZL jwqdcPXHHGUo79NKLfUf7h9l511pVAdxZdnoRl8Unraj8fqDIadnl68+iB1oguwC eHEYx/xpIscdGpKadzg2rgiqlV53FlBWx3jsRBIITRydX/eQnYOYuCF+rSrcizBf 3pMlBFY01GP+i3kVsxDYiRoN0BCBoJkmJrPGWj9ik1ddODabTOmPJdgCHWJUNyTf oaxkCjnK5p9Vmf9s9mYCWfImrldfwyX9VSG8sKGhU70DRYC5dVakb6cl2s9NvVoL Nld2VF423STU9k6tuDQdIQ== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:46 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:45 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:45 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:25 -0700 Subject: [PATCH v3 05/10] bitbake-setup: Add version check and catch exceptions MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-5-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: GR7KJ9zaO03B4RtRBEtucJBuIbvmxs4A X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c2 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=W72ytIibgHKM_pL8n_YA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: GR7KJ9zaO03B4RtRBEtucJBuIbvmxs4A X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfXyF1VTW85D0Yy zDRSmGnPuP4azjYwehWMce/iPw+Z3Ygkk+sh8VVatbq0SAjsxdtj9c0QtUXddT3yla8zbJWnU90 HqiTdhkb0jQjSlHVnaB+f5c/xPjM3Mej9CqNRAcSav7tbh8ucDCQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX2JE3Q+PGJNgG 9HReT8SGYFI3i4OqEPB3BWnNO2Oeb3bknp8CBCeF1oz28l9z1cvWWg/mJu+kULIpB2gVVcgymCC Ug1PiZ4CCX0oWmhWTSdj9rnJrWi+j/YXssl7fR9davpYaQUs4udkDezUulmyZ5Wrr9uVBSkevmt PaaiuKCIx85ZwtwxilVstYt+rnKHx9sbNifMr9Jc5wf4+7B48NaKPVyD6H8brl2jsPOwjB5Jt5d wAwUWhdZ0KYkIILV4VgL9O0OXDp7y98+ndEsYCsHZa395oEQ8ZrGmjs5ZgmhuhlJv7n8+blk+OK cIONdV65i6Zr4mjqYTdD9onzu1CatFGvFCYezUi9jxFT+jwFqEDPkAW5E7bCn6gi3ZQ9WUZeUwB nwHJ9OhXXK264FMVPeGbfdp3nGvbxsUltaQSAQf0UcuJMH4IuxisDf76r/L3zsZmjRECLq/vP7/ rFoqZzyfrPI5b5juTwQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19718 This modifies the conditional script stanza to match bitbake. It adds a version check to ensure that the correct bb module version has been found. It also catches any exceptions thrown during execution. Signed-off-by: Rob Woolley --- bin/bitbake-setup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 8218a500..af70d0cd 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -1408,4 +1408,11 @@ def main(): parser.print_help() if __name__ == '__main__': - main() + if __version__ != bb.__version__: + sys.exit("Bitbake core version and program version mismatch!") + try: + sys.exit(main()) + except Exception: + import traceback + traceback.print_exc() + sys.exit(1) From patchwork Tue Jun 16 21:31:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69E25CD98EF for ; Tue, 16 Jun 2026 21:31:49 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1854.1781645507888085761 for ; Tue, 16 Jun 2026 14:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=sbyYlu7/; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0f495812 for ; Tue, 16 Jun 2026 14:31:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=fFczLCRY/R8Q3U7cIms2RnJ/3UvUkzOIBq2lR9RiRkw=; b= sbyYlu7/KQ7PmTK5i47mOkl7qOOBEzcL+F2R0QPwBdS99/2DQjwbSGpjZ5I9HOHs jwypoc5RUpE7BdKBtHAzeNt+QJ6dYerA5wywy4cnl7GhcggppLl/im5G6PEVGRps b6qqv8/wj/887ioJdZ1gvf8ZG4ITsyhS+acSYnzzOSzgV8gUQFQHeyT34+t3Zdwl LPsutaKYe2NpMtdoq9E3NIyPyRjbjGQIgWQX3JiDgs6ycWTxoG0bcFbZYGCZ+W4P idS9CZYUqxO5PZOE9jT9SpXX5tHH87kiHqDN+J6MQHqsDG9LG534hj22y8vjezKy Tv4/H3BzN98/HQKeGcSS/g== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:47 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:45 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:45 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:26 -0700 Subject: [PATCH v3 06/10] bitbake: Add checks for importing bb module MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-6-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: 9c0WLOXyXvaPhr8Wd7qokJ6KOM4dvFW0 X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c3 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=vUYKkVZVldypNouynCYA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: 9c0WLOXyXvaPhr8Wd7qokJ6KOM4dvFW0 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX8DWOd4PwJdhJ lIa8VW+6VLH7NlI6FPNfuzkCoRg6s+pL7D2g1xJIewVD/h5+Ea/8SKoZPI9uAg/WAfT1l8Ugmet f3zTyg/08tnjN3BfdqHedAT12UqtMsqAa+cvb1t5sh9G+VC15BeX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX0jKhWexPWX4l zmbJD6CEj4E9Ujg04DL8/hCpyrweFdsw08+vlcvS4k+q6JEmjIxEvdgTz2DJXfoQtsrvOf7c31f t3IfyzNKMUbmO2Qc4pQk4SsEH86Pvcmr/PmXfaRMPMwUIdNzGrPzZU9zY4mps4Fh6/8R9Mz0B8q hLyPX5BP0qtcXfqlVAlukTWCg7WDk54nJYoT0L/zGqvf1/b7B0mdxBym82B3Cnlz/DeYCIf27Pk va267LtNbvFLp+igel3hadPrOw/+eH8hUVggYfX10V9iHnEBKEduS/wjKPzO1WreHzqI92Du5Mo 78Y9SVGbqrk4lQkfvrlQko6gydwtPSC6OPh/mSnorA+d3Vu6w+OH2X5T64LX4NUYfqPtlfgPG3y 7nc0mG/eHnHbmwBFFO/jePyRLiD54+jv+9kYQOp8d25g+zDOGS1Kx6tBnKQy2l66ufi9Jk5p8ex KnC90KSfwrSDSGvqh3g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19719 The __version__ has been present since bbmake to ensure that the Python script uses the appropriate bb module. This was necessary when bbmake had functional code that had to match the bb module. The code has since been moved into bb/main.py. The skeleton code left in bin/bitbake rarely changes save for bumping the version. When executed in place, the bitbake script manipulates sys.path to find the bb module in ../lib. This path is inserted to the beginning of sys.path and it cannot be overridden. This path is inserted regardless of whether the bb module is present in the lib directory. This adds a check for the existence of the lib/bb/__init__.py file before inserting the directory to the beginning of sys.path. This supports bitbake to be executed from inside the git repository. It deliberately fails in the situation where lib/bb/__init__.py is missing, but the bb package exists inside a site-package directory. This situation was previously possible. Signed-off-by: Rob Woolley --- bin/bitbake | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/bin/bitbake b/bin/bitbake index fd5511c6..76ec80d9 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -15,23 +15,27 @@ import sys import warnings warnings.simplefilter("default") -sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), - 'lib')) -try: - import bb -except RuntimeError as exc: - sys.exit(str(exc)) +bindir = os.path.abspath(os.path.dirname(__file__)) +libdir = os.path.join(os.path.dirname(bindir), 'lib') +bbfile = os.path.join(libdir, 'bb', '__init__.py') + +if os.path.exists(bbfile): + # Execute bitbake in git repository + try: + sys.path[0:0] = [libdir] + import bb + except ImportError as e: + print(f"Could not import bb from lib: {e}", file=sys.stderr) +else: + print(f"Could not find bb module", file=sys.stderr) + sys.exit(1) from bb import cookerdata from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException bb.utils.check_system_locale() -__version__ = "2.19.0" - if __name__ == "__main__": - if __version__ != bb.__version__: - sys.exit("Bitbake core version and program version mismatch!") try: sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv), cookerdata.CookerConfiguration())) From patchwork Tue Jun 16 21:31:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E100CD98E1 for ; Tue, 16 Jun 2026 21:31:49 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1757.1781645508322369257 for ; Tue, 16 Jun 2026 14:31:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=nEPSxMGY; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0g495812 for ; Tue, 16 Jun 2026 14:31:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=vpxZUbeJoAza9OmpH6PHZhPwNC6iQS5vy3lUMGEfBzs=; b= nEPSxMGYXr2a4gAtD58TxpVoWN2JIzfGKwjY1Ruz5iDbg7x1bW1pYJPFmi5y9B4p J9944GfNPr04tJ4PefK9Wbt+XwYyF0gDx/98jVgyyHTwK+aTGxijPfBrgb9RrNgc /zLRVIGMFyoGu4TxFRj6uXdwfGBBSfJahhvy8ifF891WgcADXvDJodwzmi4Wrqqj BtGWYdz0uJ9ZuQfkZXqDdh2BRRjXDe6YR/KlTd/6Q6+c6Drg/r8J8R/UfQFZi86o PoHFQeoZ7+7Qjp2cbUbwq9rbAq22i3VRTKPTs4acCpGt8+oxNCFvAnDN5BAtehlZ KdMbcXciX8HoHslZN3ZuzA== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:47 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:45 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:45 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:27 -0700 Subject: [PATCH v3 07/10] pypi: Add PyPI packaging for bitbake-setup MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-7-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: MAt9F8U5HKXyAFiLRP6gbetmDhqLosxz X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c3 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=24AZYWMyAAAA:8 a=iGHA9ds3AAAA:8 a=Q4-j1AaZAAAA:8 a=t7CeM3EgAAAA:8 a=qV09NasGAAAA:8 a=V5MqrhjLj9XmrIPkEmEA:9 a=QEXdDO2ut3YA:10 a=bG88sKzkDEFeXWNnvthB:22 a=nM-MV4yxpKKO9kiQg6Ot:22 a=9H3Qd4_ONW2Ztcrla5EB:22 a=FdTzh2GWekK77mhwV6Dw:22 a=GlicbclHOgpI_Rq0ze_Y:22 X-Proofpoint-GUID: MAt9F8U5HKXyAFiLRP6gbetmDhqLosxz X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX4b2K0e6XEd6i BGxBrrj2fymSYp1Q5Ez1A9n+ZC8tdbtBiHVTTw9jHqROpqUp7hH4JxdK0tmUXFDoVZnihGUjdXr sR8dO0WDRcAwgO+Om6hjd6DVW/TqD9IWjpRPDF9WwSLagrxPzCsb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfXx8PDzHD3L8Hp ec0P0EH0VukkFXlrgZYiu19WVKnmtL4hqkL18eEU9cKo/H4g7JQ1eRNABHE+a5IF9yl0c5rwFDR fEkjkKEhcWR2OBaeEi7kh0N8G1jOtRSQQtQSIJR9d9ernLBMkvXbXbSNj55kXWEkuAzrJ+/ymQa jLDkIq+rqZMKyx94Wdvv1SqAm2L21OO2cEpfCdIR+V1ElZAdsyId94obogfBOqVujpSXfaDkYNZ vxlMff0mVW0HSK6If3Wjr5t00dooUIOblohf8c2ADZQ2hL3XE7C1u2tzsA4I8Xn6OfpfgT7ht53 U3/d28p8IEZXik1RExNMgOGMRE3r3orfY++SeghqoBQMcoTeuXcvsQiaF0F3tgQLjU6m3Q/P/4t 3jfER2N5X/Ip9gM2SxSg2UEpzKSJF88a8eQBdNvFeMBW6Ovr5kDqAZ8f+SQt1RZkwpXXeH+1wOb pgoouTGImEdXK+AhGnQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19720 We wish to publish bitbake-setup to PyPI to improve the workflow for new users that are familiar with pip install. In order to publish bitbake-setup as a standalone package, we must create a staging directory for Python to build the package. The package-bitbake-setup.py automates the staging of the necessary files. You may supply your desired directory as the first argument, but packaging_workspace in the root of the git repository is chosen by default. The packaging process and related tests have also been included as part of bitbake-selftest and lib/bb/tests/setup.py. These tests use package-bitbake-setup.py. The tests include: * Verify bitbake-setup --help runs successfully. * Verify bitbake-setup list runs successfully. * Verify console script entry points are correctly defined. * Verify all expected modules can be imported from installed package. * Verify package metadata is correctly set. * Verify vendored dependencies (bs4, ply, progressbar, simplediff) are not bundled in package. * Verify version is set correctly (not fallback 0.0.0 unless expected). * Verify wheel METADATA file contains required fields. The pyproject.toml, LICENSE, and README.md files are used to create the package and provide information for PyPI. Assisted-by: Claude:claude-4.6-opus Signed-off-by: Rob Woolley --- bin/bitbake-selftest | 2 + contrib/pypi/LICENSE | 9 ++ contrib/pypi/README.md | 42 +++++ contrib/pypi/package-bitbake-setup.py | 79 ++++++++++ contrib/pypi/pyproject.toml | 92 +++++++++++ lib/bb/tests/setup.py | 289 +++++++++++++++++++++++++++++++++- 6 files changed, 512 insertions(+), 1 deletion(-) diff --git a/bin/bitbake-selftest b/bin/bitbake-selftest index fb7c57dd..7b5d68ff 100755 --- a/bin/bitbake-selftest +++ b/bin/bitbake-selftest @@ -67,6 +67,8 @@ ENV_HELP = """\ Environment variables: BB_SKIP_NETTESTS set to 'yes' in order to skip tests using network connection + BB_SKIP_PYPI_TESTS set to 'no' to run PyPI packaging tests + (default: yes/skip) BB_TMPDIR_NOCLEAN set to 'yes' to preserve test tmp directories """ diff --git a/contrib/pypi/LICENSE b/contrib/pypi/LICENSE new file mode 100644 index 00000000..f9b44182 --- /dev/null +++ b/contrib/pypi/LICENSE @@ -0,0 +1,9 @@ +bitbake-setup is licensed under the GNU General Public License version 2.0. See +LICENSE.GPL-2.0-only for further details. + +Individual files contain the following style tags instead of the full license text: + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/contrib/pypi/README.md b/contrib/pypi/README.md new file mode 100644 index 00000000..a6dd99e0 --- /dev/null +++ b/contrib/pypi/README.md @@ -0,0 +1,42 @@ +# bitbake-setup + +This package provides the `bitbake-setup` command and the Python modules +required to support BitBake setup and configuration. + +## Usage + +Instructions on uses of bitbake-setup can be found in +[Setting Up the Environment With bitbake-setup](https://docs.yoctoproject.org/bitbake/dev/bitbake-user-manual/bitbake-user-manual-environment-setup.html) from the Yocto Project manual. + +List the available configurations; +```bash +bitbake-setup list +``` + +Show the help for the bitbake-setup init subcommand: +```bash +bitbake-setup init --help +usage: bitbake-setup init [-h] [--non-interactive] [--source-overrides SOURCE_OVERRIDES] [--setup-dir-name SETUP_DIR_NAME] [--skip-selection SKIP_SELECTION] [-L SOURCE_NAME PATH] + [config ...] + +positional arguments: + config path/URL/id to a configuration file (use 'list' command to get available ids), followed by configuration options. Bitbake-setup will ask to choose from available + choices if command line doesn't completely specify them. + +options: + -h, --help show this help message and exit + --non-interactive Do not ask to interactively choose from available options; if bitbake-setup cannot make a decision it will stop with a failure. + --source-overrides SOURCE_OVERRIDES + Override sources information (repositories/revisions) with values from a local json file. + --setup-dir-name SETUP_DIR_NAME + A custom setup directory name under the top directory. + --skip-selection SKIP_SELECTION + Do not select and set an option/fragment from available choices; the resulting bitbake configuration may be incomplete. + -L SOURCE_NAME PATH, --use-local-source SOURCE_NAME PATH + Symlink local source into a build, instead of getting it as prescribed by a configuration (useful for local development). +``` + +To initialize a workspace for the Poky reference distro using the development branch (ie. "master") of OpenEmbedded: +```bash +bitbake-setup init poky-master +``` \ No newline at end of file diff --git a/contrib/pypi/package-bitbake-setup.py b/contrib/pypi/package-bitbake-setup.py new file mode 100755 index 00000000..60c503c4 --- /dev/null +++ b/contrib/pypi/package-bitbake-setup.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +import argparse +import logging +import shutil +from pathlib import Path + + +def create_packaging_workspace(directory): + # Create the directory for packaging workspace + if len(directory or "") > 0: + workspace_dir = Path(directory) + else: + # This script is located in contrib/pypi/package-bitbake-setup.py + workspace_dir = Path(__file__).parents[2] / "packaging_workspace" + + if not workspace_dir.exists(): + logging.debug(f"Created packaging workspace at: {workspace_dir}") + workspace_dir.mkdir(exist_ok=True) + else: + logging.debug(f"Packaging workspace already exists at: {workspace_dir}") + + # Copy packaging files to the workspace + files_to_copy = [ + "contrib/pypi/pyproject.toml", + "contrib/pypi/README.md", + "contrib/pypi/LICENSE", + "LICENSE.MIT", + "LICENSE.GPL-2.0-only" + ] + + for file in files_to_copy: + src_path = Path(__file__).parents[2] / file + dest_path = workspace_dir / Path(file).name + + if src_path.is_dir(): + shutil.copytree(src_path, dest_path, dirs_exist_ok=True) + logging.debug(f"Copied directory: {src_path} to {dest_path}") + else: + shutil.copy2(src_path, dest_path) + logging.debug(f"Copied file: {src_path} to {dest_path}") + + + # Copy necessary modules to the workspace + modules_to_bundle = [ + "lib/bb", + ] + + for module in modules_to_bundle: + src_path = Path(__file__).parents[2] / module + dest_path = workspace_dir / "src" / Path(module).name + + if src_path.is_dir(): + shutil.copytree(src_path, dest_path, dirs_exist_ok=True) + logging.debug(f"Bundled module directory: {src_path} to {dest_path}") + else: + shutil.copy2(src_path, dest_path) + logging.debug(f"Bundled module file: {src_path} to {dest_path}") + + # Create bitbake_setup module + bitbake_setup_dir = Path(workspace_dir / "src" / "bitbake_setup") + bitbake_setup_dir.mkdir(exist_ok=True) + Path(bitbake_setup_dir / "__init__.py").touch() + shutil.copy2(Path(__file__).parents[2] / "bin" / "bitbake-setup", str(bitbake_setup_dir / "__main__.py")) + + +if __name__ == "__main__": + logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + + parser = argparse.ArgumentParser(description='Package bitbake-setup for PyPI') + parser.add_argument('-v', '--verbose', action='store_true', help='increase output verbosity.') + parser.add_argument('-d', '--directory', type=str, help='specify the directory to create the packaging workspace in.') + + args = parser.parse_args() + + if args.verbose: + logging.getLogger().setLevel(logging.DEBUG) + + create_packaging_workspace(args.directory) diff --git a/contrib/pypi/pyproject.toml b/contrib/pypi/pyproject.toml new file mode 100644 index 00000000..69f34667 --- /dev/null +++ b/contrib/pypi/pyproject.toml @@ -0,0 +1,92 @@ +[build-system] +requires = [ + "setuptools>=64", +] +build-backend = "setuptools.build_meta" + +[project] +name = "bitbake-setup" +dynamic = ["version"] +description = "bitbake-setup" +readme = "README.md" +requires-python = ">=3.9" +license = "GPL-2.0-only AND MIT" +authors = [ + { name = "OpenEmbedded BitBake Developers", email = "bitbake-devel@lists.openembedded.org" } +] +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: POSIX :: Linux", +] + +dependencies = [ + # bitbake-setup is mostly self-contained +] + +[project.optional-dependencies] +test = [ + "pytest>=7", +] + +lint = [ + "ruff>=0.3", + "mypy>=1.8", +] + +dev = [ + "pytest>=7", + "ruff>=0.3", + "mypy>=1.8", + "build", + "twine", +] + +[project.scripts] +bitbake-setup = "bitbake_setup.__main__:main" + +[project.urls] +Homepage = "https://git.openembedded.org/bitbake/" +Documentation = "https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-environment-setup.html" +Repository = "https://git.openembedded.org/bitbake/" + +[tool.mypy] +python_version = "3.9" +warn_unused_configs = true +ignore_missing_imports = true +no_implicit_optional = true +check_untyped_defs = false + +[tool.ruff] +target-version = "py39" +line-length = 88 +src = ["src"] + +[tool.ruff.lint] +select = [ + "E", # pycodestyle + "F", # pyflakes + "B", # flake8-bugbear + "I", # import sorting +] +ignore = [ + "E501", # line length (handled by formatter) +] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" + +[tool.setuptools] +package-dir = { "" = "src" } +zip-safe = false +include-package-data = true + +[tool.setuptools.dynamic] +version = {attr = "bb.__version__"} + +[tool.setuptools.packages.find] +where = ["src"] +include = [ + "bb*", + "bitbake_setup" +] diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 5592e819..18039b72 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -11,7 +11,14 @@ import glob import hashlib import json import os +import shutil import stat +import subprocess +import sys +import tempfile +import unittest +import venv +import zipfile from bb.tests.support.httpserver import HTTPService class BitbakeSetupTest(FetcherTest): @@ -92,7 +99,11 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) def runbbsetup(self, cmd): bbsetup = os.path.abspath(os.path.dirname(__file__) + "/../../../bin/bitbake-setup") - return bb.process.run([bbsetup, '--global-settings', os.path.join(self.tempdir, 'global-config')] + cmd) + # Set PYTHONPATH so subprocess can find bb module instead of relying on the current directory + env = os.environ.copy() + libdir = os.path.abspath(os.path.dirname(__file__) + "/../..") + env["PYTHONPATH"] = libdir + ":" + env.get("PYTHONPATH", "") + return bb.process.run([bbsetup, '--global-settings', os.path.join(self.tempdir, 'global-config')] + cmd, env=env, cwd=self.tempdir) def _add_json_config_to_registry_helper(self, name, sources): @@ -735,3 +746,279 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.assertEqual(f.read(), 'conflicting-upstream\n', "re-cloned layer must contain the upstream content after conflict backup") del os.environ['BBPATH'] + +@unittest.skipIf(os.environ.get("BB_SKIP_PYPI_TESTS", "yes") != "no", + "PyPI packaging test (set BB_SKIP_PYPI_TESTS=no to run)") +class PyPIPackagingTest(unittest.TestCase): + """Tests for PyPI packaging of bitbake-setup. + + These tests build a wheel from source, install it in an isolated venv, + and verify the package works correctly. Skipped by default unless + BB_SKIP_PYPI_TESTS=no is set. + """ + + wheel_path = None + build_tempdir = None + workspace_dir = None + + @classmethod + def setUpClass(cls): + """Build wheel once for all tests in this class.""" + # Locate contrib/pypi directory + cls.pypi_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', '..', '..', 'contrib', 'pypi') + ) + + # Check for required build tools + cls._check_build_tools() + + # Create temporary directory for packaging workspace + cls.build_tempdir = tempfile.mkdtemp(prefix="bitbake-pypi-build-") + + # Run package-bitbake-setup.py to create packaging workspace + cls._create_packaging_workspace() + + # Build the wheel + cls._build_wheel() + + @classmethod + def _check_build_tools(cls): + """Verify build tools are available, skip if not.""" + try: + result = subprocess.run( + [sys.executable, "-m", "build", "--version"], + capture_output=True, check=True + ) + except (subprocess.CalledProcessError, FileNotFoundError): + raise unittest.SkipTest("'build' package not installed (pip install build)") + + @classmethod + def _create_packaging_workspace(cls): + """Create packaging workspace using package-bitbake-setup.py.""" + script = os.path.join(cls.pypi_dir, 'package-bitbake-setup.py') + cls.workspace_dir = os.path.join(cls.build_tempdir, 'workspace') + result = subprocess.run( + [sys.executable, script, '-d', cls.workspace_dir], + capture_output=True, text=True + ) + if result.returncode != 0: + raise unittest.SkipTest(f"Packaging workspace creation failed: {result.stderr}") + + @classmethod + def _build_wheel(cls): + """Build the wheel in the packaging workspace.""" + result = subprocess.run( + [sys.executable, "-m", "build", "--wheel"], + cwd=cls.workspace_dir, + capture_output=True, text=True + ) + if result.returncode != 0: + raise unittest.SkipTest(f"Wheel build failed: {result.stderr}") + + # Find the built wheel + dist_dir = os.path.join(cls.workspace_dir, 'dist') + wheels = glob.glob(os.path.join(dist_dir, '*.whl')) + if not wheels: + raise unittest.SkipTest("No wheel file found after build") + cls.wheel_path = wheels[0] + + @classmethod + def tearDownClass(cls): + """Clean up the shared wheel build artifacts.""" + if cls.build_tempdir and os.environ.get("BB_TMPDIR_NOCLEAN") != "yes": + shutil.rmtree(cls.build_tempdir, ignore_errors=True) + elif cls.build_tempdir: + print(f"Not cleaning up {cls.build_tempdir}. Please remove manually.") + + def setUp(self): + """Create isolated venv for testing the installed package.""" + self.venv_dir = tempfile.mkdtemp(prefix="bitbake-pypi-venv-") + + # Create venv without pip (faster, no network needed) + venv.create(self.venv_dir, with_pip=False, symlinks=True) + + # Get paths to venv python and bin directory + if sys.platform == 'win32': + self.venv_python = os.path.join(self.venv_dir, 'Scripts', 'python.exe') + self.venv_bin = os.path.join(self.venv_dir, 'Scripts') + else: + self.venv_python = os.path.join(self.venv_dir, 'bin', 'python') + self.venv_bin = os.path.join(self.venv_dir, 'bin') + + # Install wheel using pip from the outer environment (offline, no-deps) + site_packages = self._get_site_packages() + result = subprocess.run( + [sys.executable, "-m", "pip", "install", + "--target", site_packages, + "--no-deps", "--no-index", + self.wheel_path], + capture_output=True, text=True + ) + if result.returncode != 0: + self.fail(f"Failed to install wheel: {result.stderr}") + + # Install console script entry point manually + self._install_console_script() + + def _get_site_packages(self): + """Get the site-packages directory in the venv.""" + lib_dir = os.path.join(self.venv_dir, 'lib') + # Find python version directory + for d in os.listdir(lib_dir): + if d.startswith('python'): + return os.path.join(lib_dir, d, 'site-packages') + raise RuntimeError("Could not find site-packages in venv") + + def _install_console_script(self): + """Create console script wrapper in venv bin directory.""" + site_packages = self._get_site_packages() + script_path = os.path.join(self.venv_bin, 'bitbake-setup') + script_content = f'''#!{self.venv_python} +import sys +sys.path.insert(0, "{site_packages}") +from bitbake_setup.__main__ import main +sys.exit(main()) +''' + with open(script_path, 'w') as f: + f.write(script_content) + os.chmod(script_path, 0o755) + + def tearDown(self): + """Remove venv after test.""" + if os.environ.get("BB_TMPDIR_NOCLEAN") != "yes": + shutil.rmtree(self.venv_dir, ignore_errors=True) + else: + print(f"Not cleaning up {self.venv_dir}. Please remove manually.") + + def test_imports(self): + """Verify all expected modules can be imported from installed package.""" + + site_packages = self._get_site_packages() + imports = ['bb', 'bitbake_setup'] + for module in imports: + result = subprocess.run( + [self.venv_python, '-c', f'import sys; sys.path.insert(0, "{site_packages}"); import {module}'], + capture_output=True, text=True + ) + self.assertEqual(result.returncode, 0, + f"Failed to import {module}: {result.stderr}") + + def test_console_script_help(self): + """Verify bitbake-setup --help runs successfully.""" + script = os.path.join(self.venv_bin, 'bitbake-setup') + result = subprocess.run( + [script, '--help'], + capture_output=True, text=True + ) + self.assertEqual(result.returncode, 0, + f"bitbake-setup --help failed: {result.stderr}") + self.assertIn('usage:', result.stdout.lower()) + + def test_console_script_list(self): + """Verify bitbake-setup list runs successfully.""" + script = os.path.join(self.venv_bin, 'bitbake-setup') + result = subprocess.run( + [script, 'list'], + capture_output=True, text=True + ) + # List may return 0 even with no configurations + self.assertEqual(result.returncode, 0, + f"bitbake-setup list failed: {result.stderr}") + + def test_package_metadata(self): + """Verify package metadata is correctly set.""" + site_packages = self._get_site_packages() + code = ''' +import json +import sys +sys.path.insert(0, "{}") +from importlib.metadata import metadata +m = metadata("bitbake-setup") +print(json.dumps({{ + "name": m["Name"], + "version": m["Version"], + "requires_python": m.get("Requires-Python", ""), + "license": m.get("License", ""), +}})) +'''.format(site_packages) + result = subprocess.run( + [self.venv_python, '-c', code], + capture_output=True, text=True + ) + self.assertEqual(result.returncode, 0, + f"Failed to get metadata: {result.stderr}") + + meta = json.loads(result.stdout) + self.assertEqual(meta['name'], 'bitbake-setup') + self.assertIn('>=3.9', meta['requires_python']) + + def test_vendored_dependencies(self): + """Verify vendored dependencies (bs4, ply, progressbar, simplediff) are not bundled in package.""" + # Check that vendored packages do not exist in root of wheel + with zipfile.ZipFile(self.wheel_path, 'r') as whl: + names = whl.namelist() + + # Check for expected package directories + expected = ['bs4/', 'ply/', 'progressbar/', 'simplediff/'] + for pkg in expected: + found = any(n.startswith(pkg) for n in names) + self.assertFalse(found, + f"Unexpected vendored package '{pkg}' found in wheel") + + def test_version_from_wheel(self): + """Verify version is set correctly (not fallback 0.0.0 unless expected).""" + import re + # Extract version from wheel filename + wheel_name = os.path.basename(self.wheel_path) + # Wheel format: {name}-{version}(-{build})?-{python}-{abi}-{platform}.whl + parts = wheel_name.split('-') + version = parts[1] + + # Check version format (should be semver-like or contain git info) + version_pattern = r'^\d+\.\d+\.\d+.*$' + self.assertTrue(re.match(version_pattern, version), + f"Version '{version}' doesn't match expected pattern") + + print(f"Extracted version from wheel: {version}") + + self.assertNotEqual(version, '0.0.0', + "Version is fallback 0.0.0 - no git tags found") + + def test_wheel_metadata_file(self): + """Verify wheel METADATA file contains required fields.""" + with zipfile.ZipFile(self.wheel_path, 'r') as whl: + # Find METADATA file in dist-info + metadata_path = None + for name in whl.namelist(): + if name.endswith('.dist-info/METADATA'): + metadata_path = name + break + + self.assertIsNotNone(metadata_path, "METADATA file not found in wheel") + + # Parse metadata + metadata_content = whl.read(metadata_path).decode('utf-8') + + # Check required fields + self.assertIn('Metadata-Version:', metadata_content) + self.assertIn('Name: bitbake-setup', metadata_content) + self.assertIn('Version:', metadata_content) + self.assertIn('Requires-Python:', metadata_content) + + def test_entry_points(self): + """Verify console script entry points are correctly defined.""" + with zipfile.ZipFile(self.wheel_path, 'r') as whl: + # Find entry_points.txt in dist-info + entry_points_path = None + for name in whl.namelist(): + if name.endswith('.dist-info/entry_points.txt'): + entry_points_path = name + break + + self.assertIsNotNone(entry_points_path, + "entry_points.txt not found in wheel") + + content = whl.read(entry_points_path).decode('utf-8') + self.assertIn('[console_scripts]', content) + self.assertIn('bitbake-setup', content) + self.assertIn('bitbake_setup.__main__:main', content) From patchwork Tue Jun 16 21:31:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F6A2CD98D2 for ; Tue, 16 Jun 2026 21:31:49 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1855.1781645508705117995 for ; Tue, 16 Jun 2026 14:31:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=AZc/RJq4; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0h495812 for ; Tue, 16 Jun 2026 14:31:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=9XhUG96xPVVprIE6Q/aZgWeUnQlMzVjQRWNStQ4rdz8=; b= AZc/RJq4eUIpl3UXGzSp/XC/+mhKHWVM3ZHSYTU/gEsadr3jm52ZtM6/NE3gx+XQ 9SGQGIpA4gyHNosmm0Bdo5ZpUS36u5G8Ve5krPyAw8QnIinM3CDTH9HXC5Fqsi/S VuJKytCRFzYZP0/DqK654RvSVHIG3x4QB7EdBRv2rGFG3Mf0Vc2vh8ojBP5p5uru +1Vv3EkxVYYbBoeWsNCK3p5Q53IZ/AM+gYUXDFB0BKb9BWsZ6iUWOMKWNK2Yu96T ZwpWp2I3ZL82Fv1F5q7n+pS5xP3OxKxhiR7Kt3ubHonHddlCDgZKISY8Kogw2Ued p/qlhrw+MV15Vfnk449RQQ== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:48 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:46 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:46 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:28 -0700 Subject: [PATCH v3 08/10] pypi: Add packaging documentation for developers MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-8-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: QS4E9u1knP_bXWncD3RDkYUUTr9SEWrQ X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c4 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=SIW4pjiE_UkdO4QYDIoA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: QS4E9u1knP_bXWncD3RDkYUUTr9SEWrQ X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfXyPE7XkCxwLzR Z08KD0iT2mP++oTMGIQuKiLFw7plzXkLT/uHSAtqXL53Sunc4DcGJ698BxreWHtEJVqfGsE1ohm WH9yUFkT4YQtfDLvCLGPWRi03WxU2aSAVWMXrIlhTewS7AHhWi4X X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX3bs0bE4BZ+1Z aK5Sg3NhIlA76ev+Xpd4HVhdMxLa3VhPw8AQOZI8Oi0yLH7D9wtbzICKO2xeP65+yE21Ap5ZNs7 CUuMK2D1tQGb/ze8bpUq9v0e7FejWetKPu5FvtFyURl3+BxHBVRC5xdt0yQRUhGw93Yc2QrjTpB F1y64c9tCqHdsSoqFaHG90i7xcjbt8KQyEcg7/tG4V8aKoD975Cbuu6s8l0sVqrPsUWJPnV5FDN RFZ/UDj5lDo9GUc5J+gb24XFqQA0bDqmJoc3r2ySpUID4zfYIW11TuqH1JEsVfqFz0/+eucmVPX qkGFQRNYfPyXayTYdj+a/qqeqT2dtWIFV0VKrXRBU2hWakwvVoQjcYNGEToOdF9ivX3PJGuzO9+ GcvLUiCz/GtCJtOw6EGzvUEF/Xga5eWSRRtRkcOA9yi2W2UwWlfN9EdQWqL9LE1zKefBwhuSrq2 HCeeEdvSYmNM10VCDeg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19721 Signed-off-by: Rob Woolley --- contrib/pypi/BUILD.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/contrib/pypi/BUILD.md b/contrib/pypi/BUILD.md new file mode 100644 index 00000000..b12fc083 --- /dev/null +++ b/contrib/pypi/BUILD.md @@ -0,0 +1,50 @@ +# Development Instructions + +## Requirements + +- Python >= 3.9 +- pip >= 19 (for installation) + +## Testing + +To lint the `bitbake-setup` pypi packaging, run the ruff tool. +```bash +ruff check bin/bitbake-setup contrib/pypi +``` + +The steps to build and test the `bitbake-setup` pypi packaging have been automated with the `bitbake-selftest` tool. This tool automatically creates a Python virtual environment for you. + +Run the bitbake-selftest +```bash +BB_SKIP_PYPI_TESTS=no bin/bitbake-selftest -v bb.tests.setup.PyPIPackagingTest +``` + +## Packaging + +### Create the development sandbox + +To create the development sandbox run: +```bash +contrib/pypi/package-bitbake-setup.py +cd packaging_workshop +``` + +### Building the package + +To install the development tools manually run: +```bash +python3 -m pip install -e '.[dev]' +``` + +To build a wheel (.whl) then use: +```bash +python3 -m build +``` + +This produces a wheel (.whl) file in the dist directory. This may be installed using pip. + +### Installing the package + +```bash +python3 -m pip install dist/bitbake_setup-*-py3-none-any.whl +``` From patchwork Tue Jun 16 21:31:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D1A4CD98F6 for ; Tue, 16 Jun 2026 21:31:51 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1857.1781645509060659107 for ; Tue, 16 Jun 2026 14:31:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=V9oK/svE; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0i495812 for ; Tue, 16 Jun 2026 14:31:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=EJhKw9khQLxhdeV3g1Hl8SgJeOOaJ7HYOsjd25bZy20=; b= V9oK/svE5qaw9XWj8F2Hbjnux8iH2S3qZvNCbhO9WteX4ZHTTCf0iYh3nvbK5snf +x82DnwpmSmSeux10sp62Hnj3yVIzIhZhoHGAkDc2w2Ml0+gS9GunyA2bVtDlVrK 8LEr9jK9zGsJ5yclLafK6ljZACIrp1xf2KRQrdCGrvIYcyd3XDCJr0F1wWQzTbeh I5WlOlV8eY6YwgJnUxJkcnbDzFq7p5V+UnO2qxaUDrFk2gHCXEv3va/khBV1vcb4 byYdbR+k/6EftCNTRSiI9dNf+oNMkURSPlyNs1i1zjj+aQlGiMxwRfgSi3HbF1l7 gjCx0bXD4Pe3UXgaCi4M3Q== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:48 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:46 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:46 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:29 -0700 Subject: [PATCH v3 09/10] gitignore: Ignore temporary staging directory MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-9-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: YRQmnWBNh7r8cPgiEhxLpVgz-s9VJ10E X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c4 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=eOszy7m5RXGtjJtd4NEA:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: YRQmnWBNh7r8cPgiEhxLpVgz-s9VJ10E X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX5h4Oui6a3tsI tsFtRoj3nSQxgIJx7yHhdG+W810mL1FqVr7d7a+D5ngfqYPwTps7pIFVVxlOMKScQrpnLjhzcpu letDzLLxzCXWALx1TBVZiPG8x8BvQc0UspPgvul766OcubuaPFb9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX5ZzhAdE0Acxv eTNHn0MRsPP0zkhjPiOvHOCDcSRK49u+3Gd/w2ds8f6neO/ifw7sgfMEvFibbnyhQnvCUFIbsyi xa5P1iaUV/0ZhPJR6kNIQjK3GtoshYJj2XDpiFv+4V9P0A1+s1FWFJ75sSa/+MN4RYQfSY8ALCz NqMW9imd6kf2v6Kko7RrNHkz3f5jc1kzFPM6G+HJevsHU3QsgSDx9r9GuZShfKYPOt++v98I50F q5kh6Tsf5P9T5bztHJ4E0lMro5aaHlve7ZZJubvQuYafHcbo1/SFcB2cxA3n0yiebwpHrVVsNpb KM92Wl5FEpmIv+9uw3TwLQhse4QXFDuNERal+4doTZr1YvTp2WrtMbevEVIkWqgiu3dLanO2l5h DqleBVEiQllUvS+Zc25NiCvnr9Oq7sj9PmM6eqLvyweTE5JNY+OX3aY3SS7tw5VYR2zARoU16kO 4XmCjtsAlW/byXbufUw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19722 This directory gets created automatically by package-bitbake-setup.py when packaging bitbake-setup for PyPI. It is a temporary staging directory and should not be added to git. Signed-off-by: Rob Woolley --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a6a256b2..9a5c4ec4 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ lib/toaster/contrib/tts/backlog.txt lib/toaster/contrib/tts/log/* lib/toaster/contrib/tts/.cache/* lib/bb/tests/runqueue-tests/bitbake-cookerdaemon.log +packaging_workspace/ From patchwork Tue Jun 16 21:31:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Woolley X-Patchwork-Id: 90283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C108CD98F4 for ; Tue, 16 Jun 2026 21:31:51 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1858.1781645509506773435 for ; Tue, 16 Jun 2026 14:31:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=W0ewYZvU; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=062707f644=rob.woolley@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLVM0j495812 for ; Tue, 16 Jun 2026 14:31:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=cvJK7q071azKBF5668/h3x+Iuy1KK1OMgrFIXDWo6HQ=; b= W0ewYZvUp4mwiUebij4MTLmuFZLtxQT1XfHg6EURrVc6tWqu1P+pzhL1oGEqy8hD RUC1gIvJvD6iQlOFq+49QpjeYRvCbIWZ/cVfg2l6m8JlbMy2W2C41MOluM5yvCVH VaqyD/GSm0EzteLcj9vO9kR8GcSLt4R8rSupo/MwdNzsV1MCw/E9vmk3OqjsrTFS 3MiBy/plPbPbaO1vcUA+cBYVOUORXwPdG4eRbIfLOOKnfPa1slR7X8SGdauBLuJp NLVS/G6wXxMCVGytOmsSa+wNnZQ4QV0OG5ZozuVgwi+FNSGY0iaWFiMHVUx2h2v6 4Y2jdYSt3oCWjpFj0d566Q== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [128.224.246.36]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4eueft0012-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 14:31:48 -0700 (PDT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Tue, 16 Jun 2026 14:31:46 -0700 Received: from ala-lpggp3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 16 Jun 2026 14:31:46 -0700 From: Rob Woolley Date: Tue, 16 Jun 2026 14:31:30 -0700 Subject: [PATCH v3 10/10] lib: Vendorize bundled third-party libraries under bb._vendor MIME-Version: 1.0 Message-ID: <20260616-add-pypi-v7-v3-10-fe224e3ba878@windriver.com> References: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> In-Reply-To: <20260616-add-pypi-v7-v3-0-fe224e3ba878@windriver.com> To: CC: Rob Woolley X-Mailer: b4 0.15.2 X-Proofpoint-ORIG-GUID: dtaxxzD102AzK7h3tB8XDcjxaezenzXV X-Authority-Analysis: v=2.4 cv=B+2JFutM c=1 sm=1 tr=0 ts=6a31c0c5 cx=c_pps a=AbJuCvi4Y3V6hpbCNWx0WA==:117 a=AbJuCvi4Y3V6hpbCNWx0WA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=xcEyIbE_GHicMCtCog8A:9 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: dtaxxzD102AzK7h3tB8XDcjxaezenzXV X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX3xQ9kKCF8Dl5 JxLpan1bCq/Kwic0vuPVKdnGlN87nXUWnc2BLV9AlepEHFnhDqdR5m6PLAMyHJC9Q6bPtGTtM+v thqYIaV4KGcRoZWZxWNyTpvta/9ma+i2/+S0l+Vk99TNfsfp7XCn X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDIxOCBTYWx0ZWRfX3nsz/V3DPWTb n4yOROgXiHINCUqB5nzDvrwtlAxTBk8o3H563O/2581fNGqOOLtCmE4McP1G3OThGACvnUd4Jjx tcqLi4SY+woahRERisRSjR8PtlRFGbRhADSvRLnMhrhqvFw4i46kvvh5Je8Dzezc87GxW2qO1JX VdXz2aMM4dJ5ZbaqVmxmJNCks296Iu75HTRyJVps6NzDdGKl7Z5Rb96Qnf9uiZm0fQVTBI1zIxw /J4srZJySaTcJu7KEtcf1sOBA/1Egjy0mXENSOmd+2F3us6k21kdNrgN0l5AQWOCy9xSVEPZLBi Yl1MKwnB1ohbHLQisdwDU2HI+HZR9FtFkUa31oibXVxch0D4FSivrccENxOztgWXv4MN3C31pVg QCavi1x7inpx32k/cRGSy7zRJvx4n9iyWkbDKyB2Z9wsFi7Xap6M2qhY8p8CkjUO6iNZ/LR0ftn +oDbAgLuLeHPa5pEEjQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606160218 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Jun 2026 21:31:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19723 Move ply, progressbar, simplediff, and bs4 from lib/ into lib/bb/_vendor/ to avoid conflicts with system-installed versions and to support proper packaging. These libraries contain local modifications from their upstream versions. - Create lib/bb/_vendor/__init__.py - Move ply/, progressbar/, simplediff/, bs4/ into bb/_vendor/ - Convert absolute self-references to relative imports within ply (yacc.py) and bs4 (20 import sites across 8 files) - Update all external import sites to use bb._vendor prefix: bb/pysh/pyshlex.py, bb/pysh/pyshyacc.py, bb/ui/knotty.py, bb/siggen.py, bb/fetch2/wget.py, toaster/tests/views/test_views.py Assisted-by: Claude:claude-4.6-opus Signed-off-by: Rob Woolley --- lib/bb/_vendor/__init__.py | 18 ++++++++++++++++++ lib/{ => bb/_vendor}/bs4/AUTHORS | 0 lib/{ => bb/_vendor}/bs4/CHANGELOG | 0 lib/{ => bb/_vendor}/bs4/LICENSE | 0 lib/{ => bb/_vendor}/bs4/__init__.py | 0 lib/{ => bb/_vendor}/bs4/builder/__init__.py | 2 +- lib/{ => bb/_vendor}/bs4/builder/_html5lib.py | 12 ++++++------ lib/{ => bb/_vendor}/bs4/builder/_htmlparser.py | 6 +++--- lib/{ => bb/_vendor}/bs4/builder/_lxml.py | 6 +++--- lib/{ => bb/_vendor}/bs4/css.py | 2 +- lib/{ => bb/_vendor}/bs4/dammit.py | 0 lib/{ => bb/_vendor}/bs4/diagnose.py | 9 ++++----- lib/{ => bb/_vendor}/bs4/element.py | 6 +++--- lib/{ => bb/_vendor}/bs4/formatter.py | 2 +- lib/{ => bb/_vendor}/ply/__init__.py | 0 lib/{ => bb/_vendor}/ply/lex.py | 0 lib/{ => bb/_vendor}/ply/yacc.py | 6 +----- lib/{ => bb/_vendor}/progressbar/LICENSE.txt | 0 lib/{ => bb/_vendor}/progressbar/__init__.py | 0 lib/{ => bb/_vendor}/progressbar/compat.py | 0 lib/{ => bb/_vendor}/progressbar/progressbar.py | 0 lib/{ => bb/_vendor}/progressbar/widgets.py | 0 lib/{ => bb/_vendor}/simplediff/LICENSE | 0 lib/{ => bb/_vendor}/simplediff/__init__.py | 0 lib/bb/fetch2/wget.py | 4 ++-- lib/bb/pysh/pyshlex.py | 2 +- lib/bb/pysh/pyshyacc.py | 2 +- lib/bb/siggen.py | 2 +- lib/bb/ui/knotty.py | 2 +- lib/toaster/tests/views/test_views.py | 2 +- 30 files changed, 48 insertions(+), 35 deletions(-) diff --git a/lib/bb/_vendor/__init__.py b/lib/bb/_vendor/__init__.py new file mode 100644 index 00000000..3c054dc3 --- /dev/null +++ b/lib/bb/_vendor/__init__.py @@ -0,0 +1,18 @@ +# +# Copyright BitBake Contributors +# +# SPDX-License-Identifier: GPL-2.0-only +# + +""" +Vendored third-party libraries for BitBake. + +These libraries have been modified from their upstream versions and are +bundled here to avoid conflicts with system-installed packages. + +Vendored packages: + - bs4 (BeautifulSoup4) + - ply + - progressbar + - simplediff +""" diff --git a/lib/bs4/AUTHORS b/lib/bb/_vendor/bs4/AUTHORS similarity index 100% rename from lib/bs4/AUTHORS rename to lib/bb/_vendor/bs4/AUTHORS diff --git a/lib/bs4/CHANGELOG b/lib/bb/_vendor/bs4/CHANGELOG similarity index 100% rename from lib/bs4/CHANGELOG rename to lib/bb/_vendor/bs4/CHANGELOG diff --git a/lib/bs4/LICENSE b/lib/bb/_vendor/bs4/LICENSE similarity index 100% rename from lib/bs4/LICENSE rename to lib/bb/_vendor/bs4/LICENSE diff --git a/lib/bs4/__init__.py b/lib/bb/_vendor/bs4/__init__.py similarity index 100% rename from lib/bs4/__init__.py rename to lib/bb/_vendor/bs4/__init__.py diff --git a/lib/bs4/builder/__init__.py b/lib/bb/_vendor/bs4/builder/__init__.py similarity index 99% rename from lib/bs4/builder/__init__.py rename to lib/bb/_vendor/bs4/builder/__init__.py index ffb31fc2..d60a9a67 100644 --- a/lib/bs4/builder/__init__.py +++ b/lib/bb/_vendor/bs4/builder/__init__.py @@ -6,7 +6,7 @@ import itertools import re import warnings import sys -from bs4.element import ( +from ..element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, RubyParenthesisString, diff --git a/lib/bs4/builder/_html5lib.py b/lib/bb/_vendor/bs4/builder/_html5lib.py similarity index 98% rename from lib/bs4/builder/_html5lib.py rename to lib/bb/_vendor/bs4/builder/_html5lib.py index 7c46a851..8ca19fec 100644 --- a/lib/bs4/builder/_html5lib.py +++ b/lib/bb/_vendor/bs4/builder/_html5lib.py @@ -7,14 +7,14 @@ __all__ = [ import warnings import re -from bs4.builder import ( +from . import ( DetectsXMLParsedAsHTML, PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) -from bs4.element import ( +from ..element import ( NamespacedAttribute, nonwhitespace_re, ) @@ -23,7 +23,7 @@ from html5lib.constants import ( namespaces, prefixes, ) -from bs4.element import ( +from ..element import ( Comment, Doctype, NavigableString, @@ -134,7 +134,7 @@ class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder): if soup: self.soup = soup else: - from bs4 import BeautifulSoup + from .. import BeautifulSoup # TODO: Why is the parser 'html.parser' here? To avoid an # infinite loop? self.soup = BeautifulSoup( @@ -180,7 +180,7 @@ class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder): return TextNode(Comment(data), self.soup) def fragmentClass(self): - from bs4 import BeautifulSoup + from .. import BeautifulSoup # TODO: Why is the parser 'html.parser' here? To avoid an # infinite loop? self.soup = BeautifulSoup("", "html.parser") @@ -198,7 +198,7 @@ class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder): return treebuilder_base.TreeBuilder.getFragment(self).element def testSerializer(self, element): - from bs4 import BeautifulSoup + from .. import BeautifulSoup rv = [] doctype_re = re.compile(r'^(.*?)(?: PUBLIC "(.*?)"(?: "(.*?)")?| SYSTEM "(.*?)")?$') diff --git a/lib/bs4/builder/_htmlparser.py b/lib/bb/_vendor/bs4/builder/_htmlparser.py similarity index 99% rename from lib/bs4/builder/_htmlparser.py rename to lib/bb/_vendor/bs4/builder/_htmlparser.py index 3cc187f8..f55cbadf 100644 --- a/lib/bs4/builder/_htmlparser.py +++ b/lib/bb/_vendor/bs4/builder/_htmlparser.py @@ -13,16 +13,16 @@ from html.parser import HTMLParser import sys import warnings -from bs4.element import ( +from ..element import ( CData, Comment, Declaration, Doctype, ProcessingInstruction, ) -from bs4.dammit import EntitySubstitution, UnicodeDammit +from ..dammit import EntitySubstitution, UnicodeDammit -from bs4.builder import ( +from . import ( DetectsXMLParsedAsHTML, ParserRejectedMarkup, HTML, diff --git a/lib/bs4/builder/_lxml.py b/lib/bb/_vendor/bs4/builder/_lxml.py similarity index 99% rename from lib/bs4/builder/_lxml.py rename to lib/bb/_vendor/bs4/builder/_lxml.py index 4f7cf746..fc80133b 100644 --- a/lib/bs4/builder/_lxml.py +++ b/lib/bb/_vendor/bs4/builder/_lxml.py @@ -14,14 +14,14 @@ except ImportError as e: from io import BytesIO from io import StringIO from lxml import etree -from bs4.element import ( +from ..element import ( Comment, Doctype, NamespacedAttribute, ProcessingInstruction, XMLProcessingInstruction, ) -from bs4.builder import ( +from . import ( DetectsXMLParsedAsHTML, FAST, HTML, @@ -30,7 +30,7 @@ from bs4.builder import ( ParserRejectedMarkup, TreeBuilder, XML) -from bs4.dammit import EncodingDetector +from ..dammit import EncodingDetector LXML = 'lxml' diff --git a/lib/bs4/css.py b/lib/bb/_vendor/bs4/css.py similarity index 99% rename from lib/bs4/css.py rename to lib/bb/_vendor/bs4/css.py index cd1fd2df..7cbeb83c 100644 --- a/lib/bs4/css.py +++ b/lib/bb/_vendor/bs4/css.py @@ -68,7 +68,7 @@ class CSS(object): result (a common mistake). """ # Import here to avoid circular import - from bs4.element import ResultSet + from .element import ResultSet return ResultSet(None, results) def compile(self, select, namespaces=None, flags=0, **kwargs): diff --git a/lib/bs4/dammit.py b/lib/bb/_vendor/bs4/dammit.py similarity index 100% rename from lib/bs4/dammit.py rename to lib/bb/_vendor/bs4/dammit.py diff --git a/lib/bs4/diagnose.py b/lib/bb/_vendor/bs4/diagnose.py similarity index 96% rename from lib/bs4/diagnose.py rename to lib/bb/_vendor/bs4/diagnose.py index 46927953..76d0be8f 100644 --- a/lib/bs4/diagnose.py +++ b/lib/bb/_vendor/bs4/diagnose.py @@ -6,9 +6,8 @@ __license__ = "MIT" import cProfile from io import BytesIO from html.parser import HTMLParser -import bs4 -from bs4 import BeautifulSoup, __version__ -from bs4.builder import builder_registry +from . import BeautifulSoup, __version__ +from .builder import builder_registry import os import pstats @@ -219,8 +218,8 @@ def profile(num_elements=100000, parser="lxml"): filename = filehandle.name data = rdoc(num_elements) - vars = dict(bs4=bs4, data=data, parser=parser) - cProfile.runctx('bs4.BeautifulSoup(data, parser)' , vars, vars, filename) + vars = dict(BeautifulSoup=BeautifulSoup, data=data, parser=parser) + cProfile.runctx('BeautifulSoup(data, parser)' , vars, vars, filename) stats = pstats.Stats(filename) # stats.strip_dirs() diff --git a/lib/bs4/element.py b/lib/bb/_vendor/bs4/element.py similarity index 99% rename from lib/bs4/element.py rename to lib/bb/_vendor/bs4/element.py index 0aefe734..38ca2dc2 100644 --- a/lib/bs4/element.py +++ b/lib/bb/_vendor/bs4/element.py @@ -9,8 +9,8 @@ import re import sys import warnings -from bs4.css import CSS -from bs4.formatter import ( +from .css import CSS +from .formatter import ( Formatter, HTMLFormatter, XMLFormatter, @@ -420,7 +420,7 @@ class PageElement(object): and not isinstance(new_child, NavigableString)): new_child = NavigableString(new_child) - from bs4 import BeautifulSoup + from . import BeautifulSoup if isinstance(new_child, BeautifulSoup): # We don't want to end up with a situation where one BeautifulSoup # object contains another. Insert the children one at a time. diff --git a/lib/bs4/formatter.py b/lib/bb/_vendor/bs4/formatter.py similarity index 99% rename from lib/bs4/formatter.py rename to lib/bb/_vendor/bs4/formatter.py index 9fa1b57c..50f775ae 100644 --- a/lib/bs4/formatter.py +++ b/lib/bb/_vendor/bs4/formatter.py @@ -1,4 +1,4 @@ -from bs4.dammit import EntitySubstitution +from .dammit import EntitySubstitution class Formatter(EntitySubstitution): """Describes a strategy to use when outputting a parse tree to a string. diff --git a/lib/ply/__init__.py b/lib/bb/_vendor/ply/__init__.py similarity index 100% rename from lib/ply/__init__.py rename to lib/bb/_vendor/ply/__init__.py diff --git a/lib/ply/lex.py b/lib/bb/_vendor/ply/lex.py similarity index 100% rename from lib/ply/lex.py rename to lib/bb/_vendor/ply/lex.py diff --git a/lib/ply/yacc.py b/lib/bb/_vendor/ply/yacc.py similarity index 99% rename from lib/ply/yacc.py rename to lib/bb/_vendor/ply/yacc.py index 529f85b0..0cd9b522 100644 --- a/lib/ply/yacc.py +++ b/lib/bb/_vendor/ply/yacc.py @@ -100,12 +100,8 @@ try: except AttributeError: MAXINT = sys.maxsize -# Python 2.x/3.0 compatibility. def load_ply_lex(): - if sys.version_info[0] < 3: - import lex - else: - import ply.lex as lex + from . import lex return lex # This object is a stand-in for a logging object created by the diff --git a/lib/progressbar/LICENSE.txt b/lib/bb/_vendor/progressbar/LICENSE.txt similarity index 100% rename from lib/progressbar/LICENSE.txt rename to lib/bb/_vendor/progressbar/LICENSE.txt diff --git a/lib/progressbar/__init__.py b/lib/bb/_vendor/progressbar/__init__.py similarity index 100% rename from lib/progressbar/__init__.py rename to lib/bb/_vendor/progressbar/__init__.py diff --git a/lib/progressbar/compat.py b/lib/bb/_vendor/progressbar/compat.py similarity index 100% rename from lib/progressbar/compat.py rename to lib/bb/_vendor/progressbar/compat.py diff --git a/lib/progressbar/progressbar.py b/lib/bb/_vendor/progressbar/progressbar.py similarity index 100% rename from lib/progressbar/progressbar.py rename to lib/bb/_vendor/progressbar/progressbar.py diff --git a/lib/progressbar/widgets.py b/lib/bb/_vendor/progressbar/widgets.py similarity index 100% rename from lib/progressbar/widgets.py rename to lib/bb/_vendor/progressbar/widgets.py diff --git a/lib/simplediff/LICENSE b/lib/bb/_vendor/simplediff/LICENSE similarity index 100% rename from lib/simplediff/LICENSE rename to lib/bb/_vendor/simplediff/LICENSE diff --git a/lib/simplediff/__init__.py b/lib/bb/_vendor/simplediff/__init__.py similarity index 100% rename from lib/simplediff/__init__.py rename to lib/bb/_vendor/simplediff/__init__.py diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py index 11b57f2f..71667dd2 100644 --- a/lib/bb/fetch2/wget.py +++ b/lib/bb/fetch2/wget.py @@ -27,8 +27,8 @@ from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import logger from bb.fetch2 import runfetchcmd -from bs4 import BeautifulSoup -from bs4 import SoupStrainer +from bb._vendor.bs4 import BeautifulSoup +from bb._vendor.bs4 import SoupStrainer class WgetProgressHandler(bb.progress.LineFilterProgressHandler): """ diff --git a/lib/bb/pysh/pyshlex.py b/lib/bb/pysh/pyshlex.py index a42c2944..3f99cd1b 100644 --- a/lib/bb/pysh/pyshlex.py +++ b/lib/bb/pysh/pyshlex.py @@ -14,7 +14,7 @@ # that hard to enable pull mode. import re -from ply import lex +from bb._vendor.ply import lex from bb.pysh.sherrors import * class NeedMore(Exception): diff --git a/lib/bb/pysh/pyshyacc.py b/lib/bb/pysh/pyshyacc.py index 924860a6..67e22c96 100644 --- a/lib/bb/pysh/pyshyacc.py +++ b/lib/bb/pysh/pyshyacc.py @@ -13,7 +13,7 @@ import sys import bb.pysh.pyshlex as pyshlex tokens = pyshlex.tokens -from ply import yacc +from bb._vendor.ply import yacc import bb.pysh.sherrors as sherrors class IORedirect: diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py index 3a203676..a2ef38e1 100644 --- a/lib/bb/siggen.py +++ b/lib/bb/siggen.py @@ -12,7 +12,7 @@ import tempfile import pickle import bb.data import difflib -import simplediff +from bb._vendor import simplediff import json import types from contextlib import contextmanager diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py index 82531ef8..15025e8d 100644 --- a/lib/bb/ui/knotty.py +++ b/lib/bb/ui/knotty.py @@ -14,7 +14,7 @@ import io import os import sys import logging -import progressbar +from bb._vendor import progressbar import signal import bb.msg import time diff --git a/lib/toaster/tests/views/test_views.py b/lib/toaster/tests/views/test_views.py index e1adfcf8..5e64e819 100644 --- a/lib/toaster/tests/views/test_views.py +++ b/lib/toaster/tests/views/test_views.py @@ -27,7 +27,7 @@ import toastergui from toastergui.tables import SoftwareRecipesTable import json -from bs4 import BeautifulSoup +from bb._vendor.bs4 import BeautifulSoup import string PROJECT_NAME = "test project"