From patchwork Mon Nov 16 21:04:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 104536 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.3378.1794863081443763571 for ; Mon, 16 Nov 2026 13:04:41 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=eHj84nnl; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C33591A25 for ; Mon, 16 Nov 2026 13:04:37 -0800 (PST) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 695CE3F632 for ; Mon, 16 Nov 2026 13:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1794863080; bh=y3rA00Ps1b8ctsrHwkvM2F+mPfeE91ifVgLMWULPcbY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eHj84nnlDbDhDQa5kAH1DpnvfpBMYqTpL/cCoeF8RZuc+CQ1cBKMVENKUdtv+F4Xp 4aKgao7sLetUA+Q7iK6FlnG58jYyQZyIIfnQnV7WkP7hn/JqmfOsciYEioy026VJoL BUg3OvdQVaLe3bvvMMW92kiQTks5GCh2Wa7JqtCo= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/5] python3: add support for skipping dependencies when building the manifest Date: Mon, 16 Nov 2026 21:04:33 +0000 Message-ID: <20261116210435.4161338-3-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261116210435.4161338-1-ross.burton@arm.com> References: <20261116210435.4161338-1-ross.burton@arm.com> MIME-Version: 1.0 X-ARM-No-Footer: NoDisclaimer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 21:04:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250378 The manifest generation works by importing modules and seeing what other modules also get included. This means the manifest is maximal, for example shutil tries to import all of the compression modules to determine what compression types are available. Add a "skip_depends" element to the manifest so we can mark up specific dependencies that should be ignored when generating the manifest. Signed-off-by: Ross Burton --- .../python/python3/create_manifest3.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py index 6d3108e46f7..9ce04fdd2aa 100644 --- a/meta/recipes-devtools/python/python3/create_manifest3.py +++ b/meta/recipes-devtools/python/python3/create_manifest3.py @@ -93,6 +93,14 @@ def print_indent(msg, offset): msg = ' ' * offset + l print(msg) +def is_dependency_skipped(manifest, package, dependency): + """ + Check to see if this dependency should be ignored by matching substrings + from the optional skip_depends element in the manifest. + """ + skiplist = manifest.get('skip_depends', {}).get(package, []) + return any((skip in dependency for skip in skiplist)) + # Read existing JSON manifest with open('python3-manifest.json') as manifest: @@ -121,6 +129,8 @@ print_indent('Getting dependencies for package: core', 0) output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package', '%s' % debugFlag]).decode('utf8') for coredep in output.split(): + if is_dependency_skipped(old_manifest['core'], "core", coredep): + continue coredep = coredep.replace(pyversion,'${PYTHON_MAJMIN}') if isCached(coredep): if coredep not in old_manifest['core']['cached']: @@ -172,6 +182,8 @@ for filedep in old_manifest['core']['files']: for pymodule_dep in output.split(): + if is_dependency_skipped(old_manifest['core'], pymodule, pymodule_dep): + continue pymodule_dep = pymodule_dep.replace(pyversion,'${PYTHON_MAJMIN}') if isCached(pymodule_dep): @@ -221,6 +233,8 @@ for pypkg in old_manifest: new_manifest[pypkg] = {} new_manifest[pypkg]['summary'] = old_manifest[pypkg]['summary'] new_manifest[pypkg]['rdepends'] = [] + if "skip_depends" in old_manifest[pypkg]: + new_manifest[pypkg]['skip_depends'] = old_manifest[pypkg]['skip_depends'] new_manifest[pypkg]['files'] = [] new_manifest[pypkg]['cached'] = old_manifest[pypkg]['cached'] @@ -298,6 +312,8 @@ for pypkg in old_manifest: reportRDEPS = [] for pymodule_dep in output.split(): + if is_dependency_skipped(new_manifest[pypkg], pymodule, pymodule_dep): + continue # Warning: This first part is ugly # One of the dependencies that was found, could be inside of one of the folders included by another package