Guidance For Packaging Software


Recommended Posts

I was thinking about adding some features to my python script for ripping and encoding mp3s. Maybe even getting it hosted at sourceforge. I am very unknowledable in this whole area. I guess I am invisioning an installer that would install the script in /usr/local. My script is dependent on these python modules CDDB and DiscID. To keep it simple for the user is it ok to group these two modules with my script all in one tarball. Then just have the user type a single command to do the install. In all honestly I am not even sure what it takes to properly install python modules. Do I need to get the permission of the author of the modules to include them in my tarball, I know they are licenced under the GPL? I realize this is a pretty vague question. I am just looking for any general direction to get this together. Any advice would be appreciated. Thanks.

Link to post
Share on other sites
I guess I am invisioning an installer that would install the script in /usr/local.

Distutils seems to be standard framework for distributing and installing modules.

To keep it simple for the user is it ok to group these two modules with my script all in one tarball.

Probably not. You don't want to force people to use specific versions of third-party modules and you probably don't want your module tied to specific versions of modules if you can avoid it. Of course if you have a good reason it's no problem as long as you make sure there won't be conflict with other installed modules.

Do I need to get the permission of the author of the modules to include them in my tarball, I know they are licenced under the GPL?

The GPL gives you permission to distribute the modules. It's not likely that you would violate the terms of the license by accident, but you can look it over if you're concerned.

Link to post
Share on other sites

I did this search

shane@mainbox shane $ find /usr/lib/python2.3/ | grep "DiscID"
/usr/lib/python2.3/site-packages/mmpython/disc/DiscID.py
/usr/lib/python2.3/site-packages/mmpython/disc/DiscID.pyc
/usr/lib/python2.3/site-packages/mmpython/disc/DiscID.pyo
/usr/lib/python2.3/site-packages/DiscID.py
/usr/lib/python2.3/site-packages/DiscID.pyc

I noticed DiscID is installed with mmpython. Reading the source code for that particular module, it said it had some bug fixes that differed from the originalv DiscID. I need to get to the basics, I am not even sure which version gets imported. My gut says the version with mmpython must get imported other then just 'import DiscID'.

Link to post
Share on other sites

I was suggested to do it this way. It is kind of easy but seems effective. Make an install script that will copy a directory containing both my script and python modules all to a directory location /usr/local/share/pythonrip. Then the install script would also install a script called pythonrip to /usr/local/bin. this script would contain the following

#!/bin/sh
export PYTHONPATH=$PYTHONPATH:/usr/local/share/pythonrip
/usr/local/share/pythonrip/pythonrip.py  #this command runs my pythonscript

from the python.org docs

6.1.1 The Module Search Path

When a module named spam is imported, the interpreter searches for a file named spam.py in the current directory, and then in the list of directories specified by the environment variable PYTHONPATH. This has the same syntax as the shell variable PATH, that is, a list of directory names. When PYTHONPATH is not set, or when the file is not found there, the search continues in an installation-dependent default path; on Unix, this is usually .:/usr/local/lib/python.

I would like to learn to use distutils, it seems to have lots of cool features and the standard way of doing it. It seems to do stuff in a way which keeps your code portable. I want to definaely take the time to learn it.

but:

I can't see any real negatives to doing it the above way. concdering it is just being run on *nix systems

Edited by shanenin
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...