From: "Khem Raj" <raj.khem@gmail.com>
To: Paul Barker <paul@pbarker.dev>, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] pypi: Allow override of PyPI archive name
Date: Thu, 12 Aug 2021 17:58:14 -0700 [thread overview]
Message-ID: <fe659534-214a-0c7e-f407-2da6c3dfb59b@gmail.com> (raw)
In-Reply-To: <20210810110350.7078-1-paul@pbarker.dev>
On 8/10/21 4:03 AM, Paul Barker wrote:
> Some packages on PyPI don't follow the usual expectations for archive
> naming. For example, the archive for asyncio-mqtt 0.10.0 is named
> asyncio_mqtt-0.10.0.tar.gz (with an underscore instead of the dash used
> in the package name).
>
> To handle these edge cases a new PYPI_ARCHIVE_NAME variable is
> introduced. By default this is set to the expected archive name based on
> the PyPI package name, version and extension but it can be set to a
> different value if needed in a recipe which inherits the pypi class.
>
how many such packages are there roughly ? does it deserve to be
addressed via introducing another variable I wonder.
> Signed-off-by: Paul Barker <paul@pbarker.dev>
> ---
> meta/classes/pypi.bbclass | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/pypi.bbclass b/meta/classes/pypi.bbclass
> index 272c220bca..9405d58601 100644
> --- a/meta/classes/pypi.bbclass
> +++ b/meta/classes/pypi.bbclass
> @@ -8,12 +8,12 @@ def pypi_package(d):
>
> PYPI_PACKAGE ?= "${@pypi_package(d)}"
> PYPI_PACKAGE_EXT ?= "tar.gz"
> +PYPI_ARCHIVE_NAME ?= "${PYPI_PACKAGE}-${PV}.${PYPI_PACKAGE_EXT}"
>
> def pypi_src_uri(d):
> package = d.getVar('PYPI_PACKAGE')
> - package_ext = d.getVar('PYPI_PACKAGE_EXT')
> - pv = d.getVar('PV')
> - return 'https://files.pythonhosted.org/packages/source/%s/%s/%s-%s.%s' % (package[0], package, package, pv, package_ext)
> + archive_name = d.getVar('PYPI_ARCHIVE_NAME')
> + return 'https://files.pythonhosted.org/packages/source/%s/%s/%s' % (package[0], package, archive_name)
>
> PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
>
>
>
>
>
>
next prev parent reply other threads:[~2021-08-13 0:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 11:03 [PATCH] pypi: Allow override of PyPI archive name Paul Barker
2021-08-13 0:58 ` Khem Raj [this message]
2021-08-13 1:03 ` [OE-core] " Tim Orling
2021-08-13 1:20 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe659534-214a-0c7e-f407-2da6c3dfb59b@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul@pbarker.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox