[yocto] Installing Python app from source

Shantanoo Desai desai at uni-bremen.de
Thu Oct 4 01:13:10 PDT 2018


Hi Brian,

 

What you need in the .bb is a runtime-dependency. RDEPENDS_${PN} += “ ${PYTHON_PN}-flask ${PYTHON_PN}-jinja ${PYTHON_PN}-markdown” and so on. This will add these modules in the root-filesystem and will be available on the target. 

 

If you need some basic help with a python recipe, there is a git repository YoctoCookbook https://github.com/yoctocookbook/meta-custom/tree/master/recipes-python/python-helloworld to get you some idea.

 

Please not I am in no ways a Yocto expert on recipe creations but for the past few weeks this is what I have been able to discover. Due to lack of examples on custom recipes in python this is the best I can help you with.

 

 

Best Regards,

 

Shan

 

 

 

Von: yocto-bounces at yoctoproject.org <yocto-bounces at yoctoproject.org> Im Auftrag von Brian Zambrano
Gesendet: Donnerstag, 4. Oktober 2018 00:52
An: yocto at yoctoproject.org
Betreff: [yocto] Installing Python app from source

 

I'm trying to install my own Python application from source, and having a hard time finding resources on how to accomplish it. I'm new to this ecosystem and am probably missing something fundamental.

My recipe is structured like this...and my build is configure such that it does actually find it.

├── firmware-1.0
│   ├── saunders_backend
│   └── saunders_frontend

└── firmware_1.0.bb <http://firmware_1.0.bb> 

My application code which is for now just a "hello world" flask application, is in saunders_backend. The setup.py file in there works as expected when I use it in on my host machine.

├── firmware-1.0
│   ├── saunders_backend/
│   │   ├── bin/
│   │   │   └── server
│   │   ├── MANIFEST.in
│   │   ├── requirements.txt
│   │   ├── saunders_apollo/
│   │   │   ├── config.py
│   │   │   ├── __init__.py
│   │   │   ├── models.py
│   │   │   ├── static/
│   │   │   ├── templates/
│   │   │   └── views.py
│   │   └── setup.py

│   └── saunders_frontend/
└── firmware_1.0.bb <http://firmware_1.0.bb> 


I've been hacking on the .bb files to get it to install this into the resulting image. I do have IMAGE_INSTALL_append = " firmware" in the top-level local.conf.

 

My primary confusion is that I don't know what I should be using for the python application. do_install, do_install_append? What should SRC_UIR be? In effect is that I want the exact same behavior of "cd saunders_backend && pip install ." My setup.py file has install_requires with a list of all dependencies, which now is merely Flask.

 

Pointers would be appreciated.

BZ

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20181004/be021762/attachment-0001.html>


More information about the yocto mailing list