Re: Installing only python .pyc files onto the image #yocto

Mike Looijmans

Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: mike.looijmans@...

Please consider the environment before printing this e-mail
On 18-01-2022 06:29, Sam via wrote:
Was wondering if there was a way to edit the distitils3.bbclass or a similar file to only install the python .pyc files onto a yocto image?
I saw something about editing the distutils-common-base.bbclass online, however, it was only mentioned and not elaborated on.
I am currently working with a setup that installs .py files, then generates the .pyc files and removes the .py files. I am now looking for a method that will only install the .pyc files.
Any help would be appreciated.
What works well in many recipes is to just move the source files into their own packages, e.g.

PACKAGES =+ "${PN}-src"
FILES_${PN}-src = "${mypythondir}/*.py"

That removes the py files from the package, but still allows you to install the sources to target if you need them...

If you don't want a "src" package, adding them to the "dbg" package also works okay.

Join to automatically receive all group messages.