From patchwork Wed Mar 16 18:32:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5350 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 3DADBC433F5 for ; Wed, 16 Mar 2022 18:32:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.436.1647455567104115387 for ; Wed, 16 Mar 2022 11:32:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 E69521476 for ; Wed, 16 Mar 2022 11:32:45 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id 8D0E23F766 for ; Wed, 16 Mar 2022 11:32:45 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/8] python3-packaging: remove duplicate python3-setuptools-native DEPENDS Date: Wed, 16 Mar 2022 18:32:36 +0000 Message-Id: <20220316183243.876234-1-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163347 setuptools_build_meta.bbclass already sets this dependency. Signed-off-by: Ross Burton --- meta/recipes-devtools/python/python3-packaging_21.3.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/recipes-devtools/python/python3-packaging_21.3.bb b/meta/recipes-devtools/python/python3-packaging_21.3.bb index c7d0cb7ef7..a81fd94d37 100644 --- a/meta/recipes-devtools/python/python3-packaging_21.3.bb +++ b/meta/recipes-devtools/python/python3-packaging_21.3.bb @@ -9,5 +9,4 @@ inherit pypi setuptools_build_meta BBCLASSEXTEND = "native nativesdk" -DEPENDS += "${PYTHON_PN}-setuptools-native" RDEPENDS:${PN} += "${PYTHON_PN}-pyparsing" From patchwork Wed Mar 16 18:32:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5349 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 517ABC433EF for ; Wed, 16 Mar 2022 18:32:48 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.423.1647455567509534059 for ; Wed, 16 Mar 2022 11:32:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 2301E1515 for ; Wed, 16 Mar 2022 11:32:47 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id C74AF3F766 for ; Wed, 16 Mar 2022 11:32:46 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/8] classes/python_pep517: implement a standard do_compile Date: Wed, 16 Mar 2022 18:32:37 +0000 Message-Id: <20220316183243.876234-2-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163348 As all PEP517-compliant build systems have a universal API, we can ask that users of this class set PEP517_BUILD_API to the class that implements this API and call it ourselves, instead of users needing to implement near-identical do_compile tasks themselves. Signed-off-by: Ross Burton --- meta/classes/python_pep517.bbclass | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meta/classes/python_pep517.bbclass b/meta/classes/python_pep517.bbclass index ac7c1e44c6..83c6dcb5c7 100644 --- a/meta/classes/python_pep517.bbclass +++ b/meta/classes/python_pep517.bbclass @@ -6,6 +6,9 @@ DEPENDS:append = " python3-installer-native" # Where to execute the build process from PEP517_SOURCE_PATH ?= "${S}" +# The PEP517 build API entry point +PEP517_BUILD_API ?= "unset" + # The directory where wheels should be written too. Build classes # will ideally [cleandirs] this but we don't do that here in case # a recipe wants to install prebuilt wheels. @@ -16,6 +19,14 @@ PEP517_INSTALL_PYTHON:class-native = "nativepython3" INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" +# When we have Python 3.11 we can parse pyproject.toml to determine the build +# API entry point directly +python_pep517_do_compile () { + cd ${PEP517_SOURCE_PATH} + nativepython3 -c "import ${PEP517_BUILD_API} as api; api.build_wheel('${PEP517_WHEEL_PATH}')" +} +do_compile[cleandirs] += "${PEP517_WHEEL_PATH}" + python_pep517_do_install () { COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' | wc -l) if test $COUNT -eq 0; then @@ -33,4 +44,4 @@ python_pep517_do_bootstrap_install () { unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PEP517_WHEEL_PATH}/*.whl } -EXPORT_FUNCTIONS do_install +EXPORT_FUNCTIONS do_compile do_install From patchwork Wed Mar 16 18:32:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5351 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 3A9B0C43217 for ; Wed, 16 Mar 2022 18:32:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.424.1647455568050268594 for ; Wed, 16 Mar 2022 11:32:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 A9F291476 for ; Wed, 16 Mar 2022 11:32:47 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id 5A1A23F766 for ; Wed, 16 Mar 2022 11:32:47 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/8] classes/flit_core: use python_pep517_do_compile Date: Wed, 16 Mar 2022 18:32:38 +0000 Message-Id: <20220316183243.876234-3-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163349 Instead of implementing our own do_compile, set PEP517_BUILD_API and use the generic do_compile. Signed-off-by: Ross Burton --- meta/classes/flit_core.bbclass | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/meta/classes/flit_core.bbclass b/meta/classes/flit_core.bbclass index 5a602f54ab..81fdf93e47 100644 --- a/meta/classes/flit_core.bbclass +++ b/meta/classes/flit_core.bbclass @@ -2,15 +2,10 @@ inherit python_pep517 python3native python3-dir setuptools3-base DEPENDS += "python3 python3-flit-core-native" +PEP517_BUILD_API = "flit_core.buildapi" + flit_core_do_configure () { : } -# TODO: ideally this uses pypa/build -flit_core_do_compile () { - cd ${PEP517_SOURCE_PATH} - nativepython3 -mflit_core.wheel --outdir ${PEP517_WHEEL_PATH} -} -do_compile[cleandirs] += "${PEP517_WHEEL_PATH}" - -EXPORT_FUNCTIONS do_configure do_compile +EXPORT_FUNCTIONS do_configure From patchwork Wed Mar 16 18:32:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5352 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 3814FC433FE for ; Wed, 16 Mar 2022 18:32:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.438.1647455568638149023 for ; Wed, 16 Mar 2022 11:32:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 3C8001515 for ; Wed, 16 Mar 2022 11:32:48 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id E0C803F766 for ; Wed, 16 Mar 2022 11:32:47 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/8] classes/python_poetry_core: use python_pep517_do_compile Date: Wed, 16 Mar 2022 18:32:39 +0000 Message-Id: <20220316183243.876234-4-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163350 Instead of implementing our own do_compile, set PEP517_BUILD_API and use the generic do_compile. Signed-off-by: Ross Burton --- meta/classes/python_poetry_core.bbclass | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/meta/classes/python_poetry_core.bbclass b/meta/classes/python_poetry_core.bbclass index 47b2fe46d5..3fecb6c6bb 100644 --- a/meta/classes/python_poetry_core.bbclass +++ b/meta/classes/python_poetry_core.bbclass @@ -2,14 +2,10 @@ inherit python_pep517 python3native setuptools3-base DEPENDS += "python3-poetry-core-native" +PEP517_BUILD_API = "poetry.core.masonry.api" + python_poetry_core_do_configure () { : } -# TODO: ideally this uses pypa/build -python_poetry_core_do_compile () { - nativepython3 -c "from poetry.core.masonry import api; api.build_wheel('${PEP517_WHEEL_PATH}')" -} -do_compile[cleandirs] += "${PEP517_WHEEL_PATH}" - -EXPORT_FUNCTIONS do_configure do_compile +EXPORT_FUNCTIONS do_configure From patchwork Wed Mar 16 18:32:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5353 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 25189C4332F for ; Wed, 16 Mar 2022 18:32:50 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.424.1647455568050268594 for ; Wed, 16 Mar 2022 11:32:49 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 C33C41476 for ; Wed, 16 Mar 2022 11:32:48 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id 736EE3F766 for ; Wed, 16 Mar 2022 11:32:48 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 5/8] classes/setuptools_build_meta: use python_pep517_do_compile Date: Wed, 16 Mar 2022 18:32:40 +0000 Message-Id: <20220316183243.876234-5-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163351 Instead of implementing our own do_compile, set PEP517_BUILD_API and use the generic do_compile. Signed-off-by: Ross Burton --- meta/classes/setuptools_build_meta.bbclass | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/meta/classes/setuptools_build_meta.bbclass b/meta/classes/setuptools_build_meta.bbclass index 8791a2965f..62b037363d 100644 --- a/meta/classes/setuptools_build_meta.bbclass +++ b/meta/classes/setuptools_build_meta.bbclass @@ -2,15 +2,10 @@ inherit setuptools3-base python_pep517 DEPENDS += "python3-setuptools-native python3-wheel-native" +PEP517_BUILD_API = "setuptools.build_meta" + setuptools_build_meta_do_configure () { : } -# TODO: ideally this uses pypa/build -setuptools_build_meta_do_compile () { - cd ${PEP517_SOURCE_PATH} - nativepython3 -c "from setuptools import build_meta; build_meta.build_wheel('${PEP517_WHEEL_PATH}')" -} -do_compile[cleandirs] += "${PEP517_WHEEL_PATH}" - -EXPORT_FUNCTIONS do_configure do_compile +EXPORT_FUNCTIONS do_configure From patchwork Wed Mar 16 18:32:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5354 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 29687C43219 for ; Wed, 16 Mar 2022 18:32:50 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.438.1647455568638149023 for ; Wed, 16 Mar 2022 11:32:49 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 55CF11515 for ; Wed, 16 Mar 2022 11:32:49 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id 0625B3F766 for ; Wed, 16 Mar 2022 11:32:48 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 6/8] classes/python_pep517: add more comments Date: Wed, 16 Mar 2022 18:32:41 +0000 Message-Id: <20220316183243.876234-6-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163352 Remove mention of prebuilt wheels, this is for the full PEP517 build process and recipes that want to install prebuilt wheels can use pypa/installer directly. Signed-off-by: Ross Burton --- meta/classes/python_pep517.bbclass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/classes/python_pep517.bbclass b/meta/classes/python_pep517.bbclass index 83c6dcb5c7..73bcf9ba07 100644 --- a/meta/classes/python_pep517.bbclass +++ b/meta/classes/python_pep517.bbclass @@ -1,5 +1,8 @@ # Common infrastructure for Python packages that use PEP-517 compliant packaging. # https://www.python.org/dev/peps/pep-0517/ +# +# This class will build a wheel in do_compile, and use pypa/installer to install +# it in do_install. DEPENDS:append = " python3-installer-native" @@ -9,14 +12,14 @@ PEP517_SOURCE_PATH ?= "${S}" # The PEP517 build API entry point PEP517_BUILD_API ?= "unset" -# The directory where wheels should be written too. Build classes -# will ideally [cleandirs] this but we don't do that here in case -# a recipe wants to install prebuilt wheels. +# The directory where wheels will be written PEP517_WHEEL_PATH ?= "${WORKDIR}/dist" +# The interpreter to use for installed scripts PEP517_INSTALL_PYTHON = "python3" PEP517_INSTALL_PYTHON:class-native = "nativepython3" +# pypa/installer option to control the bytecode compilation INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" # When we have Python 3.11 we can parse pyproject.toml to determine the build From patchwork Wed Mar 16 18:32:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5355 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 2A93EC433EF for ; Wed, 16 Mar 2022 18:32:51 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.379.1647455570203925795 for ; Wed, 16 Mar 2022 11:32:50 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 DC8D21476 for ; Wed, 16 Mar 2022 11:32:49 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id 8CD2F3F766 for ; Wed, 16 Mar 2022 11:32:49 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 7/8] classes/flit_core: rename to python_flit_core Date: Wed, 16 Mar 2022 18:32:42 +0000 Message-Id: <20220316183243.876234-7-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163353 To be more uniform with the other new Python classes, rename this to python_flit_core and update the recipes that use it. Signed-off-by: Ross Burton --- meta/classes/{flit_core.bbclass => python_flit_core.bbclass} | 2 +- meta/recipes-devtools/python/python3-flit-core_3.7.1.bb | 2 +- meta/recipes-devtools/python/python3-installer_0.5.1.bb | 2 +- meta/recipes-devtools/python/python3-tomli_2.0.1.bb | 2 +- meta/recipes-devtools/python/python3-wheel_0.37.1.bb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename meta/classes/{flit_core.bbclass => python_flit_core.bbclass} (84%) diff --git a/meta/classes/flit_core.bbclass b/meta/classes/python_flit_core.bbclass similarity index 84% rename from meta/classes/flit_core.bbclass rename to meta/classes/python_flit_core.bbclass index 81fdf93e47..eef361bb1b 100644 --- a/meta/classes/flit_core.bbclass +++ b/meta/classes/python_flit_core.bbclass @@ -4,7 +4,7 @@ DEPENDS += "python3 python3-flit-core-native" PEP517_BUILD_API = "flit_core.buildapi" -flit_core_do_configure () { +python_flit_core_do_configure () { : } diff --git a/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb b/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb index dc815acf08..8d107384a6 100644 --- a/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb +++ b/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb @@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=41eb78fa8a872983a882c694a8305f08" SRC_URI[sha256sum] = "3c9bd9c140515bfe62dd938c6610d10d6efb9e35cc647fc614fe5fb3a5036682" -inherit pypi flit_core +inherit pypi python_flit_core # Need to install by hand as there's a dependency loop DEPENDS:remove:class-native = " python3-installer-native" diff --git a/meta/recipes-devtools/python/python3-installer_0.5.1.bb b/meta/recipes-devtools/python/python3-installer_0.5.1.bb index 12d9fce249..f4f9e1bde6 100644 --- a/meta/recipes-devtools/python/python3-installer_0.5.1.bb +++ b/meta/recipes-devtools/python/python3-installer_0.5.1.bb @@ -10,7 +10,7 @@ SRC_URI += "file://interpreter.patch" SRC_URI[sha256sum] = "f970995ec2bb815e2fdaf7977b26b2091e1e386f0f42eafd5ac811953dc5d445" -inherit pypi flit_core +inherit pypi python_flit_core DEPENDS:remove:class-native = "python3-installer-native" DEPENDS:append:class-native = " unzip-native" diff --git a/meta/recipes-devtools/python/python3-tomli_2.0.1.bb b/meta/recipes-devtools/python/python3-tomli_2.0.1.bb index f8b423bbef..6118a6a9c3 100644 --- a/meta/recipes-devtools/python/python3-tomli_2.0.1.bb +++ b/meta/recipes-devtools/python/python3-tomli_2.0.1.bb @@ -6,7 +6,7 @@ BUGTRACKER = "https://github.com/hukkin/tomli/issues" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=aaaaf0879d17df0110d1aa8c8c9f46f5" -inherit pypi flit_core +inherit pypi python_flit_core SRC_URI[sha256sum] = "de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" diff --git a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb index efd6c2f968..2f7dd122ba 100644 --- a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb +++ b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=10;endline=10;md5=8227180126797a01 SRC_URI[sha256sum] = "e9a504e793efbca1b8e0e9cb979a249cf4a0a7b5b8c9e8b65a5e39d49529c1c4" -inherit flit_core pypi +inherit python_flit_core pypi SRC_URI += " file://0001-Backport-pyproject.toml-from-flit-backend-branch.patch" From patchwork Wed Mar 16 18:32:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 5356 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 2656DC433F5 for ; Wed, 16 Mar 2022 18:32:52 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.439.1647455571597451941 for ; Wed, 16 Mar 2022 11:32:51 -0700 Authentication-Results: mx.groups.io; dkim=missing; 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 6F3EF1515 for ; Wed, 16 Mar 2022 11:32:50 -0700 (PDT) Received: from oss-tx204.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 ESMTPSA id 1F83A3F766 for ; Wed, 16 Mar 2022 11:32:50 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 8/8] classes/python_pep517: consolidate stub do_configure Date: Wed, 16 Mar 2022 18:32:43 +0000 Message-Id: <20220316183243.876234-8-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316183243.876234-1-ross.burton@arm.com> References: <20220316183243.876234-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Mar 2022 18:32:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163354 As PEP517 doesn't have an explicit configure step, we can stub out the do_configure task once instead of the calling classes doing it. Signed-off-by: Ross Burton --- meta/classes/python_flit_core.bbclass | 6 ------ meta/classes/python_pep517.bbclass | 8 +++++++- meta/classes/python_poetry_core.bbclass | 6 ------ meta/classes/setuptools_build_meta.bbclass | 6 ------ 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/meta/classes/python_flit_core.bbclass b/meta/classes/python_flit_core.bbclass index eef361bb1b..96652aa204 100644 --- a/meta/classes/python_flit_core.bbclass +++ b/meta/classes/python_flit_core.bbclass @@ -3,9 +3,3 @@ inherit python_pep517 python3native python3-dir setuptools3-base DEPENDS += "python3 python3-flit-core-native" PEP517_BUILD_API = "flit_core.buildapi" - -python_flit_core_do_configure () { - : -} - -EXPORT_FUNCTIONS do_configure diff --git a/meta/classes/python_pep517.bbclass b/meta/classes/python_pep517.bbclass index 73bcf9ba07..34ffdc9c0d 100644 --- a/meta/classes/python_pep517.bbclass +++ b/meta/classes/python_pep517.bbclass @@ -22,6 +22,12 @@ PEP517_INSTALL_PYTHON:class-native = "nativepython3" # pypa/installer option to control the bytecode compilation INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" +# PEP517 doesn't have a specific configure step, so set an empty do_configure to avoid +# running base_do_configure. +python_pep517_do_configure () { + : +} + # When we have Python 3.11 we can parse pyproject.toml to determine the build # API entry point directly python_pep517_do_compile () { @@ -47,4 +53,4 @@ python_pep517_do_bootstrap_install () { unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PEP517_WHEEL_PATH}/*.whl } -EXPORT_FUNCTIONS do_compile do_install +EXPORT_FUNCTIONS do_configure do_compile do_install diff --git a/meta/classes/python_poetry_core.bbclass b/meta/classes/python_poetry_core.bbclass index 3fecb6c6bb..577663b8f1 100644 --- a/meta/classes/python_poetry_core.bbclass +++ b/meta/classes/python_poetry_core.bbclass @@ -3,9 +3,3 @@ inherit python_pep517 python3native setuptools3-base DEPENDS += "python3-poetry-core-native" PEP517_BUILD_API = "poetry.core.masonry.api" - -python_poetry_core_do_configure () { - : -} - -EXPORT_FUNCTIONS do_configure diff --git a/meta/classes/setuptools_build_meta.bbclass b/meta/classes/setuptools_build_meta.bbclass index 62b037363d..b2bba35a0b 100644 --- a/meta/classes/setuptools_build_meta.bbclass +++ b/meta/classes/setuptools_build_meta.bbclass @@ -3,9 +3,3 @@ inherit setuptools3-base python_pep517 DEPENDS += "python3-setuptools-native python3-wheel-native" PEP517_BUILD_API = "setuptools.build_meta" - -setuptools_build_meta_do_configure () { - : -} - -EXPORT_FUNCTIONS do_configure