[yocto] How to add a module to python-native

Burton, Ross ross.burton at intel.com
Mon Mar 26 13:47:11 PDT 2018


You'll need to run $bindir_native/python/python, we isolate the native
Python from the host python so you need to invoke the native one
explicitly.  In a recipe you can just do inherit pythonnative, but
don't do that in a class which every recipe is inheriting!

Ross

On 26 March 2018 at 21:01, Ulf Samuelsson <yocto at emagii.com> wrote:
> Need some advice on how to extend python-native with a python-2.7 module.
>
> I am planning to upload the result of cve-check to our JIRA server.
> I wrote a python application which reads the CVE manifest,
> downloads the contents of a JIRA project and if a CVE issue
> is not present in the database, it will create new issues.
>
> The python application is using the python-restkit module, which has all the
> functionality I need, so I can call <script> -f <manifest>
> and the JIRA will be updated.
>
> Would like to integrate this with bitbake using a bbclass.
>
> The class will be inherited in local.conf, and will check
> if the recipe is an image, and if so, it will call a task
> which executes right after the manifest is created and calls
> the python script.
>
> do_cve_update_jira () {
>     <call python scripts>
> }
>
> python-native does not build python-restkit, so I have
> created a recipe python-restkit which bbextends native.
>
> do_cve_update_jira[depends] = "python-restkit-native"
>
> This seems to ensure that the python-restkit is built and
> in the x86 sysroot I have /usr/lib/python-2.7/sitepackages/restkit.
>
> Still, when the python script is called, "import restkit" fails.
>
> Would like to understand how to make sure that python-restkit-native
> is always available to a recipe.
>
>
> I guess, I could make each image somehow depend on python-restkit native,
> but it would be better if it was always available to a recipe.
>
> Would appreciate some advice here.
>
> python-restkit is unfortunately only available for python2, not for python3.
> Any advice on a good replacement?
>
>
> Best Regards.
> Ulf Samuelsson
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list