From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Mikko Rapeli <mikko.rapeli@linaro.org>,
openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] oeqa parselogs.py: load ignore files from sys.path
Date: Tue, 27 Feb 2024 14:34:41 +0000 [thread overview]
Message-ID: <e24a6dfe273fcf2e397c01c42ae1ac83de48524b.camel@linuxfoundation.org> (raw)
In-Reply-To: <20240110130322.4078930-1-mikko.rapeli@linaro.org>
On Wed, 2024-01-10 at 15:03 +0200, Mikko Rapeli wrote:
> python import.resources open_text() loads files from the module paths
> but this requires layers to set "addpylib ${LAYERDIR}/lib oeqa"
> which is not needed to find the plain .py test files to run the tests.
> Also an empty __init__.py file in a layer will break the resource file
> loading completely as only that path with __init__.py file will
> be used to search the resource files. Then open_text() is marked
> as deprecated from python 3.11 onwards
> https://docs.python.org/3/library/importlib.resources.html
>
> So replace open_text() by iterating over sys.path to find the ignore
> files. This works since paths like ${LAYERDIR}/lib/oeqa/runtime/cases are
> already in sys.path. Add debug prints for found and not found files
> while at it.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
> meta/lib/oeqa/runtime/cases/parselogs.py | 29 +++++++++++-------------
> 1 file changed, 13 insertions(+), 16 deletions(-)
For completeness for the archives, after some discussion we're
preferring layers use addpylib explicitly to include these. The older
way of handling things will likely get removed so this would break when
that happens.
Cheers,
Richard
prev parent reply other threads:[~2024-02-27 14:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 13:03 [PATCH] oeqa parselogs.py: load ignore files from sys.path Mikko Rapeli
2024-01-10 14:01 ` [OE-core] " Ross Burton
2024-01-10 14:23 ` Mikko Rapeli
[not found] ` <17A9026E670466F3.1780@lists.openembedded.org>
2024-01-19 7:27 ` Mikko Rapeli
2024-02-27 14:34 ` Richard Purdie [this message]
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=e24a6dfe273fcf2e397c01c42ae1ac83de48524b.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=mikko.rapeli@linaro.org \
--cc=openembedded-core@lists.openembedded.org \
/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