Re: Writing a simple python recipe to add pydevd support to a personnal layer #yocto #zeus #make python recipe #yocto #zeus #make

Maciej Pijanowski

On 04.12.2020 11:37, anthony.marchand@... wrote:
Hello everyone,

I have to add a python module named "pydevd" in my personnal image machine.
Pydevd is a python module that can be used for remote debbuging with the Ecipse IDE.

So normally, I used to go to the site: to see what are the recipes available for the yocto version I use (zeus version), and then, I add the name of the recipe to my image in:


As the recipe for the python 3 module: "pydevd" does not exists in zeus branch, I decided to create one by observing their structures and how python recipes are made.
So there is my recipe for the latest version of pydevd I got from

------------------------------------ -------------------------------------------------------
SUMMARY = "Pydevd, a python module for eclipse remote debugging"
LIC_FILES_CHKSUM = "file://LICENSE;md5=30b3836521b3d65bef598bbc358a3afa"

SRC_URI = ""
SRC_URI[md5sum] = "74f4336ce09c5fab228a8ff4285e519a"
SRC_URI[sha256sum] = "9f76aa4f82e43faba7c243d4c9678eb93e96848ba1e5dba61054bec2794e994b"

RDEPENDS_${PN}_class-target += "\
    ${PYTHON_PN}-threading \

inherit pypi setuptools3 ptest
BBCLASSEXTEND = "native nativesdk"

RDEPENDS_${PN}-ptest += " \
        ${PYTHON_PN}-pytest \

fakeroot do_install_test() {

        install -d ${D}${PTEST_PATH}/pydevd/tests
        cp -rf ${S}/pydevd/* ${D}/pydevd/
        cp -f ${S}/README.rst ${D}${PTEST_PATH}/

So I'm sure about md5 checksum, Licence and SRC_URI, but from the line: "RDEPENDS_${PN}_class-target" to the end, I'm not sure about what I'm doing :-)
After a test of compilation with the command "bitbake pydevd", bitbake seems to parse and extract the tar.gz package well, but I have an error at the end when it tried to do install.
I suggest to start with recipetool rather than starting from scratch:

For most python modules it should **just work**.

Compare the output of recipetool with what you have done manually and start from there.

My goal is simply to extract the content of the pydevd.tar.gz and installed it on my target path: "/usr/lib/python3.7/site-packages"

When I do that manually on my target machine (by extracting the tar.gz in "/usr/lib/python3.7/site-packages" ), it works fine and python can import the module pydevd. I would like to do the same thing with a yocto recipe, but i've never made any recipes, I just know the basic theory about it.

Does someone know or have ideas about how can I do that? Maybe it's not as simple as that, but as I'm pretty new, I don't realize the level of difficulty it represents.

Thanks for all and best reguards.

Maciej Pijanowski
Embedded Firmware Team Leader
GPG: 9963C36AAC3B2B46 | @3mdeb_com

Join { to automatically receive all group messages.