LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Packaging and distributing Python programs (https://www.linuxquestions.org/questions/linux-general-1/packaging-and-distributing-python-programs-471627/)

Saketh 08-07-2006 11:21 AM

Packaging and distributing Python programs
 
I've written an application using Python and wxPython in Linux. It requires several libraries (ElementTree, wxPython, and Reportlab) as well as the Python interpreter. Most distros come with the Python interpreter, so I'm not worried about that.

I am relatively new to Linux, so my skill at distributing applications under the platform is nonexistent. I have no idea how to distribute my application to Linux users.

As an analogy, I'm trying to create binaries under Linux similar to how py2exe creates binaries under MS Windows. I've heard of something called cxFreeze, but I'm not sure if that's the proper way to distribute binaries for Linux users. I was also looking at RPMs, but I wasn't sure if they were the proper way to distribute binaries either.

I have no idea how to create an "Installer" under Linux. I want to make the application show up under the "Applications::Office" menu item (if my memory serves me correctly). I've seen people use a "setup.py" that they've written to install the application, but I have no idea how to do this.

Also, is there any way that I can add my application to a repository so that users can install it from something like YaST or apt-get?

In summary, here are my three questions:
  1. How can I create binaries for users under Linux?
  2. How can I create an "installer" for Linux users (i.e. a setup.py)?
  3. How can I add my application to a repository?
I am sorry if my questions are vague, but my lack of knowledge in distributing Linux applications limits the specificity of my questions. I would appreciate it if someone could point me towards documentation that could teach me how to do any of the above three things.

EDIT: I just happened to find an example of a setup.py that uses distutils, but I have no idea how to actually use it under Linux. Is it python setup.py install?

Thanks for the help.

cs-cam 08-08-2006 03:45 AM

http://www.python.org/community/sigs...utils-sig/doc/

distutils is pretty much the standard way of doing it across platforms. It can generate RPMs and a few other formats as well as source distrobution files. Once you have written your setup.py it's pretty automatic from there. You don't need to include wxPython or anything but your app, the best way of doing it is to include a README that states wxPython is required to run the app. I have wxPython installed already, if I was to download your app what would be the point of installing it again? Leave that sort of stuff up to the end user.

Saketh 08-08-2006 10:27 AM

I have created a setup.py, as per the documentation.

If I want Linux users to install the application, would they have to execute python setup.py install? Or should I give them an RPM, instead?

Nylex 08-08-2006 10:31 AM

Don't know about setup.py files, but if you distribute in RPM format only people using RPM-based distros would be able to install those files. Of course, there are programs that can convert to other package formats, but I don't know how well these work. It might be a good idea to distribute programs in tarball format.

slantoflight 08-08-2006 02:47 PM

Make a deb, rpm, and tar.gz binary and a source tarball as well. That should cover you. If you want to add yourself to a repository. You might try to add yourself to third party or commonly used extensions first. Livna, Guru, Multiverse, freshmeat, etc.


All times are GMT -5. The time now is 08:50 AM.