shanenin Posted August 7, 2005 Report Share Posted August 7, 2005 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. Quote Link to post Share on other sites
jcl Posted August 8, 2005 Report Share Posted August 8, 2005 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. Quote Link to post Share on other sites
shanenin Posted August 8, 2005 Author Report Share Posted August 8, 2005 I did this searchshane@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.pycI 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'. Quote Link to post Share on other sites
shanenin Posted August 8, 2005 Author Report Share Posted August 8, 2005 (edited) 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/shexport PYTHONPATH=$PYTHONPATH:/usr/local/share/pythonrip/usr/local/share/pythonrip/pythonrip.py #this command runs my pythonscriptfrom the python.org docs6.1.1 The Module Search PathWhen 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 August 8, 2005 by shanenin Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.