[Distutils] EasyInstall: installing non-distutil packages

Ian Bicking ianb at colorstudy.com
Mon May 30 00:17:49 CEST 2005


Looking at some of the packages I'm interested in, there's a couple ones 
that don't use distutils.  Of course, fixing this is best, but I'm 
wondering if those can be installed as well.  Typically you can install 
these packages just by copying them into place.

So... thinking about the best way to do this.  I think it should be 
possible to simply create a kind of generic set of attributes... maybe 
(very untested)...

def setup_args(package_dir):
     attrs = {}
     attrs['name'] = os.path.basename(package_dir)
     dirs = []
     os.path.walk(package_dir, (lambda arg, dirpath, names: 
pkgs.append(dirpath)), None)
     attrs['packages'] = [
         attrs['name'] + '.' + d.replace('/', '.')
         for d in dirs
         if os.path.exists(os.path.join(package_dir, d, '__init__.py'))]
     return attrs

Then somehow call distutils.core.setup(**attrs).  And somehow 
package_dir has to get passed in, but I haven't figured out how that 
happens yet.

-- 
Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org


More information about the Distutils-SIG mailing list