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 <[email protected]>
> ---
> 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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196274):
https://lists.openembedded.org/g/openembedded-core/message/196274
Mute This Topic: https://lists.openembedded.org/mt/103639917/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-