All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: Tim Orling <ticotimo@gmail.com>
Cc: Konrad Weihmann <kweihmann@outlook.com>,
	openembedded-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH v3] pip_install_wheel: improve wheel handling
Date: Tue, 1 Mar 2022 10:48:22 -0800	[thread overview]
Message-ID: <CAMKF1spMpkHH4-LpH6Fe=tcg+WM30x3_+0-ZHiDRnvCUqGOquw@mail.gmail.com> (raw)
In-Reply-To: <CANx9H-BhZVaYekYpoqT3P9Nbvd-bWiXixXkfhEmtg_FWXtr8nA@mail.gmail.com>

I am seeing this

| Created temporary directory: /tmp/pip-install-33iiigxv
| WARNING: Requirement
'/mnt/b/yoe/master/build/tmp/work/x86_64-linux/python3-pytest-runner-native/5.3.1-r0/pytest-runner-5.3.1/dist/pytest-runner-*-*.whl'
looks like a filename, but the file does not exist
| ERROR: pytest-runner-*-*.whl is not a valid wheel filename.
| Exception information:
| Traceback (most recent call last):
|   File "/mnt/b/yoe/master/build/tmp/work/x86_64-linux/python3-pytest-runner-native/5.3.1-r0/recipe-sysroot-native/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py",
line 167, in exc_logging_wrapper

where the wheel file is called
pytest_runner-5.3.1-py3-none-any.whl

On Tue, Mar 1, 2022 at 7:22 AM Tim Orling <ticotimo@gmail.com> wrote:
>
>
>
> On Tue, Mar 1, 2022 at 1:42 AM Konrad Weihmann <kweihmann@outlook.com> wrote:
>>
>> - replace python3 prefix when guessing the wheel name
>>   as there are still plenty of recipes out there that do use
>>   python3 prefixes
>> - remove all previously generated wheels matching the glob
>>   to avoid installing any outdated blob
>> - don't use PV in glob, as PV doesn't necessarily align with the
>>   version used inside of the setuptools configuration.
>>   this will avoid having the user set PYPA_WHEEL in a lot
>>   of recipes
>> - respect SETUPTOOLS_SETUP_PATH in PIP_INSTALL_DIST_PATH
>>   and use B as a fallback only (in case this class is inherited
>>   without setuptools3 class being there as well).
>>   recipes like python3-smbus run in a subfolder of the
>>   workspace and were failing in before this adjustment
>>
> Thank you. These are patterns that were never seen during development, but are painfully obvious now.
> The wheel spec (PEP-427) allows for, for instance, dev/pre-release wheels which we see with the
> python3-dtc recipe from meta-virtualization.
>
>>
>> Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
>
> Reviewed-by: Tim Orling <tim.orling@konsulko.com>
>>
>>
>>
>> ---
>> v3: remove in prepend to compile, not in install for obvious reasons
>> v2: fix python3 prefix string
>>
>>  meta/classes/pip_install_wheel.bbclass | 12 +++++++++---
>>  1 file changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/meta/classes/pip_install_wheel.bbclass b/meta/classes/pip_install_wheel.bbclass
>> index 5b7e5cd706..789c25b68c 100644
>> --- a/meta/classes/pip_install_wheel.bbclass
>> +++ b/meta/classes/pip_install_wheel.bbclass
>> @@ -1,12 +1,13 @@
>>  DEPENDS:append = " python3-pip-native"
>>
>>  def guess_pip_install_package_name(d):
>> +    import re
>>      '''https://www.python.org/dev/peps/pep-0491/#escaping-and-unicode'''
>> -    return (d.getVar('PYPI_PACKAGE') or d.getVar('BPN')).replace('-', '_')
>> +    return (d.getVar('PYPI_PACKAGE') or re.sub(r"^python3-", "", d.getVar('BPN')).replace('-', '_'))
>>
>>  PIP_INSTALL_PACKAGE ?= "${@guess_pip_install_package_name(d)}"
>> -PIP_INSTALL_DIST_PATH ?= "${B}/dist"
>> -PYPA_WHEEL ??= "${PIP_INSTALL_DIST_PATH}/${PIP_INSTALL_PACKAGE}-${PV}-*.whl"
>> +PIP_INSTALL_DIST_PATH ?= "${@d.getVar('SETUPTOOLS_SETUP_PATH') or d.getVar('B')}/dist"
>> +PYPA_WHEEL ??= "${PIP_INSTALL_DIST_PATH}/${PIP_INSTALL_PACKAGE}-*-*.whl"
>>
>>  PIP_INSTALL_ARGS ?= "\
>>      -vvvv \
>> @@ -45,4 +46,9 @@ pip_install_wheel_do_install () {
>>      done
>>  }
>>
>> +do_compile:prepend() {
>> +    # cleanup previously generated files
>> +    rm -f ${PYPA_WHEEL}
>> +}
>> +
>>  EXPORT_FUNCTIONS do_install
>> --
>> 2.25.1
>>
>>
>>
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#162559): https://lists.openembedded.org/g/openembedded-core/message/162559
> Mute This Topic: https://lists.openembedded.org/mt/89472354/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


  reply	other threads:[~2022-03-01 18:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  9:42 [PATCH v3] pip_install_wheel: improve wheel handling Konrad Weihmann
2022-03-01 15:22 ` [OE-core] " Tim Orling
2022-03-01 18:48   ` Khem Raj [this message]
2022-03-01 20:14     ` Ross Burton
2022-03-02  5:20       ` Khem Raj
2022-03-02  8:06         ` Konrad Weihmann
     [not found]         ` <16D881D0D78DCA29.25756@lists.openembedded.org>
2022-03-02  9:21           ` Konrad Weihmann
2022-03-02 18:45             ` Khem Raj
2022-03-02 19:01               ` Konrad Weihmann
2022-03-02 19:04                 ` Khem Raj
2022-03-02 19:09                   ` Konrad Weihmann

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='CAMKF1spMpkHH4-LpH6Fe=tcg+WM30x3_+0-ZHiDRnvCUqGOquw@mail.gmail.com' \
    --to=raj.khem@gmail.com \
    --cc=kweihmann@outlook.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ticotimo@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.