On 10 Jan 2024, at 13:03, Mikko Rapeli via lists.openembedded.org 
<[email protected]> 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

Deprecated but replaceable with files(package).joinpath(resource).open() (which 
is all open_text does internally).


> 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.

I’m confused why lib/oeqa/runtime/cases is on sys.path directly, that sounds… 
unusual.  Do you have any idea where that comes from?  I’m guessing oeqa is 
throwing it on the path whilst searching for test cases, but that sounds like 
bad behaviour that should be removed to me.

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#193511): 
https://lists.openembedded.org/g/openembedded-core/message/193511
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]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to