From patchwork Fri Mar 15 14:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 41011 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 C6BC0C54E58 for ; Fri, 15 Mar 2024 14:38:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.23984.1710513474606127146 for ; Fri, 15 Mar 2024 07:37:54 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); 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 F32DDC15 for ; Fri, 15 Mar 2024 07:38:28 -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 ESMTPA id 4E2EB3F73F for ; Fri, 15 Mar 2024 07:37:53 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/3] python3_pip517: just count wheels in the directory, not subdirectories Date: Fri, 15 Mar 2024 14:37:49 +0000 Message-Id: <20240315143751.1235135-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.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 ; Fri, 15 Mar 2024 14:38:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/197136 From: Ross Burton The install task uses a recursive find to check that it can only find one wheel, but then does a non-recursive glob to install. This can lead to false-failures if PEP517_WHEEL_PATH points at a directory with subdirectories. Solve this mismatch by making the find non-recusive. Signed-off-by: Ross Burton --- meta/classes-recipe/python_pep517.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/python_pep517.bbclass b/meta/classes-recipe/python_pep517.bbclass index a1659c5f628..c30674c8ec8 100644 --- a/meta/classes-recipe/python_pep517.bbclass +++ b/meta/classes-recipe/python_pep517.bbclass @@ -42,7 +42,7 @@ python_pep517_do_compile () { do_compile[cleandirs] += "${PEP517_WHEEL_PATH}" python_pep517_do_install () { - COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' | wc -l) + COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' -maxdepth 1 | wc -l) if test $COUNT -eq 0; then bbfatal No wheels found in ${PEP517_WHEEL_PATH} elif test $COUNT -gt 1; then From patchwork Fri Mar 15 14:37:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 41012 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 C6DFDC54E68 for ; Fri, 15 Mar 2024 14:38:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.23985.1710513474978042443 for ; Fri, 15 Mar 2024 07:37:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); 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 EAD25DA7 for ; Fri, 15 Mar 2024 07:38:29 -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 ESMTPA id F37503F73F for ; Fri, 15 Mar 2024 07:37:53 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/3] python-*: don't set PYPI_ARCHIVE_NAME and S when PYPI_PACKAGE is sufficient Date: Fri, 15 Mar 2024 14:37:50 +0000 Message-Id: <20240315143751.1235135-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240315143751.1235135-1-ross.burton@arm.com> References: <20240315143751.1235135-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 ; Fri, 15 Mar 2024 14:38:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/197137 From: Ross Burton There's no need to explicitly set PYPI_ARCHIVE_NAME and S when PYPI_PACKAGE is set correctly. Signed-off-by: Ross Burton --- .../python/python3-jsonschema-specifications_2023.12.1.bb | 6 ++---- meta/recipes-devtools/python/python3-poetry-core_1.9.0.bb | 4 ++-- meta/recipes-devtools/python/python3-rpds-py_0.18.0.bb | 4 +--- .../python/python3-sphinxcontrib-applehelp_1.0.8.bb | 5 ++--- .../python/python3-sphinxcontrib-devhelp_1.0.6.bb | 5 +---- .../python/python3-sphinxcontrib-htmlhelp_2.0.5.bb | 5 +---- .../python/python3-sphinxcontrib-qthelp_1.0.7.bb | 5 +---- .../python/python3-sphinxcontrib-serializinghtml_1.1.10.bb | 5 +---- 8 files changed, 11 insertions(+), 28 deletions(-) diff --git a/meta/recipes-devtools/python/python3-jsonschema-specifications_2023.12.1.bb b/meta/recipes-devtools/python/python3-jsonschema-specifications_2023.12.1.bb index bffd59a719e..eb63509fce4 100644 --- a/meta/recipes-devtools/python/python3-jsonschema-specifications_2023.12.1.bb +++ b/meta/recipes-devtools/python/python3-jsonschema-specifications_2023.12.1.bb @@ -9,10 +9,8 @@ SRC_URI[sha256sum] = "48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d168267 inherit pypi python_hatchling -DEPENDS += "${PYTHON_PN}-hatch-vcs-native" - -S = "${WORKDIR}/jsonschema_specifications-${PV}" +PYPI_PACKAGE = "jsonschema_specifications" -PYPI_ARCHIVE_NAME = "jsonschema_specifications-${PV}.${PYPI_PACKAGE_EXT}" +DEPENDS += "${PYTHON_PN}-hatch-vcs-native" BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-poetry-core_1.9.0.bb b/meta/recipes-devtools/python/python3-poetry-core_1.9.0.bb index dfb29c4b863..540fdffaeda 100644 --- a/meta/recipes-devtools/python/python3-poetry-core_1.9.0.bb +++ b/meta/recipes-devtools/python/python3-poetry-core_1.9.0.bb @@ -18,8 +18,8 @@ LIC_FILES_CHKSUM = "\ SRC_URI[sha256sum] = "fa7a4001eae8aa572ee84f35feb510b321bd652e5cf9293249d62853e1f935a2" inherit python_poetry_core pypi -PYPI_ARCHIVE_NAME = "poetry_core-${PV}.${PYPI_PACKAGE_EXT}" -S = "${WORKDIR}/poetry_core-${PV}" + +PYPI_PACKAGE = "poetry_core" RDEPENDS:${PN}:append:class-target = "\ python3-compression \ diff --git a/meta/recipes-devtools/python/python3-rpds-py_0.18.0.bb b/meta/recipes-devtools/python/python3-rpds-py_0.18.0.bb index 01fb3d47ce7..cece2cb8ccd 100644 --- a/meta/recipes-devtools/python/python3-rpds-py_0.18.0.bb +++ b/meta/recipes-devtools/python/python3-rpds-py_0.18.0.bb @@ -10,8 +10,6 @@ require ${BPN}-crates.inc inherit pypi cargo-update-recipe-crates python_maturin -S = "${WORKDIR}/rpds_py-${PV}" - -PYPI_ARCHIVE_NAME = "rpds_py-${PV}.${PYPI_PACKAGE_EXT}" +PYPI_PACKAGE = "rpds_py" BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-sphinxcontrib-applehelp_1.0.8.bb b/meta/recipes-devtools/python/python3-sphinxcontrib-applehelp_1.0.8.bb index 6ea7c516d50..67dd299b72b 100644 --- a/meta/recipes-devtools/python/python3-sphinxcontrib-applehelp_1.0.8.bb +++ b/meta/recipes-devtools/python/python3-sphinxcontrib-applehelp_1.0.8.bb @@ -5,9 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=c7715857042d4c8c0105999ca0c072c5" SRC_URI[sha256sum] = "c40a4f96f3776c4393d933412053962fac2b84f4c99a7982ba42e09576a70619" -inherit pypi python_flit_core +PYPI_PACKAGE = "sphinxcontrib_applehelp" -PYPI_ARCHIVE_NAME = "sphinxcontrib_applehelp-${PV}.${PYPI_PACKAGE_EXT}" -S = "${WORKDIR}/sphinxcontrib_applehelp-${PV}" +inherit pypi python_flit_core BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-sphinxcontrib-devhelp_1.0.6.bb b/meta/recipes-devtools/python/python3-sphinxcontrib-devhelp_1.0.6.bb index dd7ba3dc956..31f77a0a141 100644 --- a/meta/recipes-devtools/python/python3-sphinxcontrib-devhelp_1.0.6.bb +++ b/meta/recipes-devtools/python/python3-sphinxcontrib-devhelp_1.0.6.bb @@ -5,11 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=fd30d9972a142c857a80c9f312e92b93" SRC_URI[sha256sum] = "9893fd3f90506bc4b97bdb977ceb8fbd823989f4316b28c3841ec128544372d3" -PYPI_PACKAGE = "sphinxcontrib-devhelp" +PYPI_PACKAGE = "sphinxcontrib_devhelp" inherit pypi python_flit_core -PYPI_ARCHIVE_NAME = "sphinxcontrib_devhelp-${PV}.${PYPI_PACKAGE_EXT}" -S = "${WORKDIR}/sphinxcontrib_devhelp-${PV}" - BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-sphinxcontrib-htmlhelp_2.0.5.bb b/meta/recipes-devtools/python/python3-sphinxcontrib-htmlhelp_2.0.5.bb index 532d1fc22aa..e30c61c3980 100644 --- a/meta/recipes-devtools/python/python3-sphinxcontrib-htmlhelp_2.0.5.bb +++ b/meta/recipes-devtools/python/python3-sphinxcontrib-htmlhelp_2.0.5.bb @@ -5,11 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=24dce5ef6a13563241c24bc366f48886" SRC_URI[sha256sum] = "0dc87637d5de53dd5eec3a6a01753b1ccf99494bd756aafecd74b4fa9e729015" -PYPI_PACKAGE = "sphinxcontrib-htmlhelp" +PYPI_PACKAGE = "sphinxcontrib_htmlhelp" inherit pypi python_flit_core -PYPI_ARCHIVE_NAME = "sphinxcontrib_htmlhelp-${PV}.${PYPI_PACKAGE_EXT}" -S = "${WORKDIR}/sphinxcontrib_htmlhelp-${PV}" - BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-sphinxcontrib-qthelp_1.0.7.bb b/meta/recipes-devtools/python/python3-sphinxcontrib-qthelp_1.0.7.bb index b24f7f8e6fe..2225ec521e7 100644 --- a/meta/recipes-devtools/python/python3-sphinxcontrib-qthelp_1.0.7.bb +++ b/meta/recipes-devtools/python/python3-sphinxcontrib-qthelp_1.0.7.bb @@ -5,11 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=f7a83b72ea86d04827575ec0b63430eb" SRC_URI[sha256sum] = "053dedc38823a80a7209a80860b16b722e9e0209e32fea98c90e4e6624588ed6" -PYPI_PACKAGE = "sphinxcontrib-qthelp" +PYPI_PACKAGE = "sphinxcontrib_qthelp" inherit pypi python_flit_core -PYPI_ARCHIVE_NAME = "sphinxcontrib_qthelp-${PV}.${PYPI_PACKAGE_EXT}" -S = "${WORKDIR}/sphinxcontrib_qthelp-${PV}" - BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-sphinxcontrib-serializinghtml_1.1.10.bb b/meta/recipes-devtools/python/python3-sphinxcontrib-serializinghtml_1.1.10.bb index b13bc829775..49be5200f0f 100644 --- a/meta/recipes-devtools/python/python3-sphinxcontrib-serializinghtml_1.1.10.bb +++ b/meta/recipes-devtools/python/python3-sphinxcontrib-serializinghtml_1.1.10.bb @@ -5,11 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=32a84ac5cd3bbd10c4d479233ad588b6" SRC_URI[sha256sum] = "93f3f5dc458b91b192fe10c397e324f262cf163d79f3282c158e8436a2c4511f" -PYPI_PACKAGE = "sphinxcontrib-serializinghtml" +PYPI_PACKAGE = "sphinxcontrib_serializinghtml" inherit pypi python_flit_core -PYPI_ARCHIVE_NAME = "sphinxcontrib_serializinghtml-${PV}.${PYPI_PACKAGE_EXT}" -S = "${WORKDIR}/sphinxcontrib_serializinghtml-${PV}" - BBCLASSEXTEND = "native nativesdk" From patchwork Fri Mar 15 14:37:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 41013 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 D3A57C54E6E for ; Fri, 15 Mar 2024 14:38:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.23986.1710513475294091928 for ; Fri, 15 Mar 2024 07:37:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); 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 41E2EC15 for ; Fri, 15 Mar 2024 07:38:30 -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 ESMTPA id 9A9EB3F8A4 for ; Fri, 15 Mar 2024 07:37:54 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/3] classes/pypi: don't expose PYPI_ARCHIVE_NAME Date: Fri, 15 Mar 2024 14:37:51 +0000 Message-Id: <20240315143751.1235135-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240315143751.1235135-1-ross.burton@arm.com> References: <20240315143751.1235135-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 ; Fri, 15 Mar 2024 14:38:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/197138 From: Ross Burton This variable is only used when constructing a SRC_URI and some recipes think that it's the correct value to assign if the PyPi package name isn't the same as the recipe name, when PYPI_PACKAGE is actually all that needs to be set. Also document the variables we expect the recipe to assign if needed, and where the PyPi URL structure is documented. Signed-off-by: Ross Burton --- meta/classes-recipe/pypi.bbclass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/pypi.bbclass b/meta/classes-recipe/pypi.bbclass index b8c18ccf395..c6bbe8119a6 100644 --- a/meta/classes-recipe/pypi.bbclass +++ b/meta/classes-recipe/pypi.bbclass @@ -12,14 +12,19 @@ def pypi_package(d): return bpn[8:] return bpn +# The PyPi package name (defaults to PN without the python3- prefix) PYPI_PACKAGE ?= "${@pypi_package(d)}" +# The file extension of the source archive PYPI_PACKAGE_EXT ?= "tar.gz" -PYPI_ARCHIVE_NAME ?= "${PYPI_PACKAGE}-${PV}.${PYPI_PACKAGE_EXT}" +# An optional prefix for the download file in the case of name collisions PYPI_ARCHIVE_NAME_PREFIX ?= "" def pypi_src_uri(d): + """ + Construct a source URL as per https://warehouse.pypa.io/api-reference/integration-guide.html#predictable-urls. + """ package = d.getVar('PYPI_PACKAGE') - archive_name = d.getVar('PYPI_ARCHIVE_NAME') + archive_name = d.expand('${PYPI_PACKAGE}-${PV}.${PYPI_PACKAGE_EXT}') archive_downloadname = d.getVar('PYPI_ARCHIVE_NAME_PREFIX') + archive_name return 'https://files.pythonhosted.org/packages/source/%s/%s/%s;downloadfilename=%s' % (package[0], package, archive_name, archive_downloadname)