Jump to content


Photo

python-requests bitbake

python-requests bitbake

  • Please log in to reply
13 replies to this topic

#1 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 8 September 2013 - 13:21

Dear all,

 

 

I created a bitbake for python-requests, but the resulting ipk contains both py and pyo files.

 

In order only compiled files, i must remove them manually (on do_install_append) or there is a better way to create bitbake?

 

Thanks,


Edited by athoik, 8 September 2013 - 13:21.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: python-requests bitbake #2 MiLo

  • PLi® Core member
  • 14,042 posts

+298
Excellent

Posted 8 September 2013 - 14:00

Create an additional package, e.g blablah-src and add the .py files to that. That's what most of the other recipes do.

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

Edited by MiLo, 8 September 2013 - 14:01.

Real musicians never die - they just decompose

Re: python-requests bitbake #3 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 8 September 2013 - 15:08

Dear Milo,

 

 

Unfortunatelly src package is not created. :(

 

PACKAGES =+ "${PN}-src"
FILES_${PN}-src = "\
        /usr/lib/python2.7/site-packages/requests/*.py \
        /usr/lib/python2.7/site-packages/requests/*/*.py \
        /usr/lib/python2.7/site-packages/requests/*/*/*.py \
        /usr/lib/python2.7/site-packages/requests/*/*/*/*.py \
        "

 

Maybe the above doesn't work when inherit setuptools?

 

Adding  the following on do_install_append works. But i have the feeling that it's not the correct way.

 

do_install_append() {
  rm -f ${D}${libdir}/python*/site-packages/site.py*
+  find ${D}${libdir}/python*/site-packages/requests -name '*.py' -exec rm {} \;
}

 

Thanks for your valuable suggestions.


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: python-requests bitbake #4 MiLo

  • PLi® Core member
  • 14,042 posts

+298
Excellent

Posted 8 September 2013 - 18:57

Dear Milo,
 
 
Unfortunatelly src package is not created. :(
 

PACKAGES =+ "${PN}-src"
FILES_${PN}-src = "\
        /usr/lib/python2.7/site-packages/requests/*.py \
        /usr/lib/python2.7/site-packages/requests/*/*.py \
        /usr/lib/python2.7/site-packages/requests/*/*/*.py \
        /usr/lib/python2.7/site-packages/requests/*/*/*/*.py \
        "
 
Maybe the above doesn't work when inherit setuptools?


Could be the case yeah. Probably setuptools re-writes the PACKAGES variable. that'd take some digging...

Actually, just deleting them isn't such a bad thing, as long as the code is available somewhere.
Real musicians never die - they just decompose

Re: python-requests bitbake #5 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 8 September 2013 - 19:53

No it's not the case. I figure out what was the problem!

 

You must place PACKAGES and FILES_${PN}-src command after the inherit setuptools.

 

If you place them before they ignored.

 

This commit adds python-requests-src to my local bitbake.

 

Thank you once again Milo.


Edited by athoik, 8 September 2013 - 19:53.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: python-requests bitbake #6 Persian Prince

  • Senior Member
  • 1,982 posts

+247
Excellent

Posted 11 September 2013 - 00:49

you can use my version : https://github.com/O...devtools/python

 

;)


Open Vision sources: https://github.com/OpenVisionE2


Re: python-requests bitbake #7 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 11 September 2013 - 10:52

This is what i get with your version:

 

ERROR: ParseError at /opt/pli4/meta-local/recipes-local/python/python-requests_1.2.3.bbappend:3: Could not inherit file classes/openpli-distutils.bbclass

 

So how can i use openpli-distutils.bbclass on OpenPLi meta-local? (i prefer to make my changes on meta-local and go with original openpli git).

 

Also when it is good to use .bbappend, is there a rule when to use .bbappend?

 

Thanks,


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: python-requests bitbake #8 Persian Prince

  • Senior Member
  • 1,982 posts

+247
Excellent

Posted 11 September 2013 - 12:41

if you're using "recipes-local" inside "meta-openpli" it should be ok otherwise you're using "meta-local" outside and it's not "recipes-local"

 

create a new folder "classes" inside "meta-local" and put http://sourceforge.n...stutils.bbclass inside it , i think it will fix your problem

 

when you don't wanna edit original bb files it's good to use .bbappend and it's easy to use them

 

name.bb

name.bbappend

 

simply use "PRINC" in .bbappend to be sure about the build


Open Vision sources: https://github.com/OpenVisionE2


Re: python-requests bitbake #9 Persian Prince

  • Senior Member
  • 1,982 posts

+247
Excellent

Posted 11 September 2013 - 12:52

and about your other questions regarding bb files :

 

when you have .py sources + other things like png files you can use something like https://github.com/O...sions-aziptv.bb

 

and here are the sources for this bb file : https://github.com/OpenAZBox/AZIPTV

 

it's easy somehow , you just need to write your bb regarding your git structure

 

but when you have pyo files without any python sources you can use something like https://github.com/o...-cooltvguide.bb

 

as you can see in https://github.com/o...ons/CoolTVGuide we have compiled files and we just wanna copy them nothing more

 

there is a pro way with Makefile and advanced bb file that you can see in http://sourceforge.n...gma2-plugins.bb for multiple plugins

 

anyway we're using all these methods in PE and they're good ;)


Open Vision sources: https://github.com/OpenVisionE2


Re: python-requests bitbake #10 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 12 November 2013 - 21:05

Hello,

 

 

Is there any bitbake for python-librtmp? I tried to create one but fail...

 

https://github.com/c.../python-librtmp

https://pypi.python..../python-librtmp

 

Python librtmp required in order to be able to watch ustream.tv streams using Livestreamer library.


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: python-requests bitbake #11 Persian Prince

  • Senior Member
  • 1,982 posts

+247
Excellent

Posted 17 November 2013 - 13:35

i didn't see any bb for it but i think we can make it together

 

share your work here maybe i can fix it

 

(i'm busy with Golden Media HyperCube "ARM STB" and i wanna bring it to OE Core like what i did before for AZBox)


Open Vision sources: https://github.com/OpenVisionE2


Re: python-requests bitbake #12 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 18 November 2013 - 20:16

Hello @Persian Prince,


In order to build python-librtmp we depend on cffi and cffi depends on pycparser.

With pycparser and cffi all ok. With python-librtmp no success.
ERROR: Function failed: do_compile (log file is located at /opt/openpli4/build/tmp/work/mips32el-oe-linux/python-librtmp/0.1.2-r0/temp/log.do_compile.19056)
ERROR: Logfile of failure stored in: /opt/openpli4/build/tmp/work/mips32el-oe-linux/python-librtmp/0.1.2-r0/temp/log.do_compile.19056
Log data follows:
| DEBUG: Executing shell function do_compile
| Error: CFFI (required for setup) is not available.
| Please use 'pip install cffi', or equivalent.
| ERROR: python setup.py build_ext execution failed.
| ERROR: Function failed: do_compile (log file is located at /opt/openpli4/build/tmp/work/mips32el-oe-linux/python-librtmp/0.1.2-r0/temp/log.do_compile.19056)
ERROR: Task 6 (/opt/openpli4/meta-local/recipes-local/python/python-librtmp_0.1.2.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1199 tasks of which 1193 didn't need to be rerun and 1 failed.
No currently running tasks (1199 of 1208)

Summary: 1 task failed:
  /opt/openpli4/meta-local/recipes-local/python/python-librtmp_0.1.2.bb, do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Probably cffi must be available as cffi-native.

Thank you for willing to help.

Attached Files


Edited by athoik, 18 November 2013 - 20:16.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: python-requests bitbake #13 Persian Prince

  • Senior Member
  • 1,982 posts

+247
Excellent

Posted 24 November 2013 - 10:08

i think the correct recipes are these files but still no luck in python-librtmp

 

strange


Open Vision sources: https://github.com/OpenVisionE2


Re: python-requests bitbake #14 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 24 November 2013 - 10:29

From the error i undrestand what CFFI must be install also on the build environment and especially on the "native python" cause CFFI is install on the host.

So most probably in order to build python-librtmp we must build "native CFFI", i did try to use BBCLASSEXTEND = "native" but didn't succeed.

@MiLo, @pieterg any thoughts?


Maybe we should ask for help about this issue on openembedded lists/irc.

Edited by athoik, 24 November 2013 - 10:29.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916



Also tagged with one or more of these keywords: python-requests, bitbake

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users