WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Best approach to include a Python package?  (Read 2102 times)

Offline gpulido

  • Jr. Member
  • **
  • Posts: 57
Best approach to include a Python package?
« on: February 09, 2015, 12:52:06 PM »
Hello,
I'm using piCore with the python tze extension.
However my python program needs more dependencies than those that are included on the basic package, for example "cherrypi".
My "program" is hanging on the "home/tc" folder so it is already persisted with a filebot.sh -b
In order to make available cherrypi, I have downloaded the cherrypi package and install it manually through its setup.py
That setup installs the package on the "/usr/local/lib/python2.7/site-packages/cherrypi" folder.
So I'm now facing the best approach to "persist" that installation. This are my options:

1) Add "/usr/local/lib/python2.7/site-packages/cherrypi" to the filelist file
2) Create a local tze package using squash with all the data from the previous folder and put it on the optional folder
3) Persist the "cherrypi original" package and just call the setup.py on each initialization of the piCore
4) Create a tze package with the the cherrypi original package and "call setup" on each run.

is any of the previous options better than the others?, is there another way to do it?

Thank you in advance

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Best approach to include a Python package?
« Reply #1 on: February 09, 2015, 12:54:15 PM »
Since it is static, unchanging data, 2) is fastest and takes least space. 1) and 3) would slow your boot and shutdown, while 3) and 4) would slow your boot.
The only barriers that can stop you are the ones you create yourself.

Offline gpulido

  • Jr. Member
  • **
  • Posts: 57
Re: Best approach to include a Python package?
« Reply #2 on: February 09, 2015, 01:09:20 PM »
Thank you!

That is what I though.
I will generate a tze wrapper around each of the python packages that I need to install.