Packaging of Python Programs (was Re: PISI 0.4 released)

2009-08-19 Thread Michael Pilgermann
Hi all,

since I am getting a bit confused about this topic, I thought I start a small 
discussion on it.

Background was our sync app PISI (written in Python), which we now tried to 
include in distributions (here SHR) using BB files.

Martin was kind enough to prepare a first draft of the bb file (and all the 
other stuff required) in order to get a running package for PISI (thx again) ...

Last night, I was then trying to take these avaialbe files and wanted to modify 
in order to suit our needs appropriately. I started with changing the files ... 
was looking around on setuptools documents, changed more files - and then came 
back to the following question:

*** Should we really install a Python application as a site-package?? ***

Setuptools (and whatever similar stuff is out there for Python packaging) is a 
very good tool to assemble and distribute Python site-packages (so to say 
Python libraries) - stuff, that extends Python by some additional functionality.
A program, however, does not extend the functionaility of the language - it is 
just an application itself.

So, my question is, whether we should distinguish between libraries and 
applications when talking about packaging Python programs. libraries 
would go into site-packages; applications into some corresponding folder 
(e.g. /opt/$PROGRAMNAME) ...

That is just a suggestion - I am really not sure, which is the way to go. How 
are other Python applications handling this issue? For me it looks somehow 
artificial to put an application under site-packages for Python.

Comments are very welcome ... :D

Michael



 Original-Nachricht 
 Datum: Tue, 18 Aug 2009 12:54:28 +0200
 Von: Martin Jansa martin.ja...@gmail.com
 An: List for Openmoko community discussion community@lists.openmoko.org
 Betreff: Re: PISI 0.4 released

 Hi,
 on Friday I uploaded patch for OE repository to shr trac:
 http://trac.shr-project.org/trac/ticket/592
 http://trac.shr-project.org/trac/ticket/592Patch contains support for
 setuptools (http://pypi.python.org/pypi/setuptools), which seems like
 standard tool for managing python packages, that's files ez_setup.py,
 setup.py and setup.cfg. It would be nice if you include those 3 files in
 your source distribution package.
 
 I also found few files missing from
 http://projects.openmoko.org/frs/download.php/888/pisi-src-0.4.4.tar.gz,
 which were available in subversion repository, so I made only bbfile for
 live subversion version of pisi, I can found which files were missing if
 you can include them to pisi-src too.
 
 As last modification of your source distribution I created pisi python
 module and moved all pisi stuff and subdirs there, because this bbfile
 installs pisi directly in /usr/lib/python*/site-packages/pisi not to
 /opt/pisi and having lots of files and directories only for pisi directly
 in
 site-packages seemed wrong for me.
 
 So i rearranged source files like this:
 mkdir pisi
 mv pisi*.py pisi
 touch pisi/__init__.py
 mv contacts/ modules/ events/ tests/ thirdparty/ pisi
 
 As I said before, I'm not python programer so setuptools and python
 packages
 are new for me, so it would be nice if someone could confirm, that this
 structure is sane and you could rearrange files in subversion to simplyfi
 building process.
 
 I'll try to prepare bbfiles for new development version dependencies as
 you
 wrote in second thread.
 
 JaMa
 
 
 On Fri, Aug 14, 2009 at 7:35 PM, Michael Pilgermann
 kichka...@gmx.dewrote:
 
  JaMa,
 
  thx for this offer. I don't really know, what in detail you are talking
  about ... i was quite happy, that I managed to assemble ipkg - this is
  all done automatically using a Makefile:
 
 
 https://projects.openmoko.org/plugins/scmsvn/viewcvs.php/*checkout*/trunk/Makefile?rev=135root=pisi
 
  But integrating all this in feeds of repositories of course sounds good
  to me ... just let me know, what exactly I can do for you - I am sure we
  can sort that out 
 
  (till now I have always just copied the files into my ipkgs)
 
  Michael
 
 
  Martin Jansa wrote:
  
  
   On Thu, Aug 13, 2009 at 11:49 AM, Martin Jansa martin.ja...@gmail.com
   mailto:martin.ja...@gmail.com wrote:
  
   I have no experience with python, but I can try to prepare
 setup.py
  for
   setuptools next week, if you have no time or interest in it and
 then
   send you patch.
  
  
   I had some spare time.. so before going for vacation, here is
 something
   which works for me, at least seems like working for me :).
  
   Maybe something could be integrated upstream so simplify bbfile for
 next
   version.
  
   Regards,
  
   JaMa
  
  
  
 
  
   ___
   Openmoko community mailing list
   community@lists.openmoko.org
   http://lists.openmoko.org/mailman/listinfo/community
 
 
  ___
  Openmoko community mailing list
  

Re: Packaging of Python Programs (was Re: PISI 0.4 released)

2009-08-19 Thread Adolph J. Vogel

 *** Should we really install a Python application as a site-package?? ***

 Setuptools (and whatever similar stuff is out there for Python packaging)
 is a very good tool to assemble and distribute Python site-packages (so to
 say Python libraries) - stuff, that extends Python by some additional
 functionality. A program, however, does not extend the functionaility of
 the language - it is just an application itself.

I agree, installing applications in site-packages just feels *wrong*. That 
being said, A number of applications still do it. :(

Im not sure, but perhaps setuptools, can be told to install to an alternative 
location?

Adolph

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community