lpe wrote:

http://www.pycode.com

I was kinda suprised when I could not find any good sites with 3rd
party modules (other than the Vaults of Parnassus, where you must host
files elsewhere), so I decided to write one myself :)
It is brand new and might still be buggy, but hopefully it will be
usefull to some people.  Feel free to join and upload any of your code.
thanks


Hi,

Just yesterday, I was frustrated waiting for replies from Catelog-SIG about the possibilities of a package management system that works like Fink (fink.sf.net). Basically, the problems I see is that C extension modules aren't portable across major Python revisions and there is no easy way to maintain the installed packages in site-packages directory. My scenario is that a system admin has to maintain 50 different libraries and their dependencies...

So I've decided to write something myself... and call it 'centipyde'.

Modelled against Fink and Darwinports (darwinports.opendarwin.org) (obviously I'm a Mac user), information (in text file) are in a folder (centipyde/pkginfo/) as .info files. Each package will have a .info file which tells the system (centipyde) where to download the source tar (or zip) and how to install the package, as well as the dependecies, maintaining the installed packages etc etc. No difference from other package managers (a goal)...

It is still very rough at this moment, so please bear with me. Basically, the user will have to cvs checkout the system and just run it.

I've checked it into Sourceforge, under IB-DWB project (which is abandoned) as 'centipyde'. But for some reason, I still can't view it in ViewCVS yet. Anyway, the directory layout is

../centipyde
../centipyde/centipyde.py
../centipyde/pgkinfo
../centipyde/pgkinfo/ply15.info


ply15.info contains the following text (pretty much modelled against Fink):

package=ply15
maintainer=.
dependencies=.
downloadurl=http://systems.cs.uchicago.edu/ply/ply-1.5.tar.gz
prebuildscript=tar zxvf ply-1.5.tar.gz
sourcedir=ply-1.5
buildscript=python setup.py build
installscript=sudo python setup.py install


centipyde.py is the following: =====================================================

"""
Author: Maurice H.T. Ling <[EMAIL PROTECTED]>
Copyright (c) 2005 Maurice H.T. Ling
Date created : 28th April 2005
"""

PKGINFOPATH = 'pkginfo'
INSTALL_LOG = 'install.log'

import os
import string
import sys

def install_package(package_name):
f = open(os.getcwd() + os.sep + PKGINFOPATH + os.sep + package_name + '.info', 'r')
install_info = {}
for line in f.readlines():
line = string.split(line, '=')
if line[1][-1] == os.linesep:
install_info[line[0]] = string.strip(line[1][:-1])
else: install_info[line[0]] = string.strip(line[1])
f.close()
print "Package Installation Information: " + str(install_info)


    os.system('curl -O ' + str(install_info['downloadurl']))

    preinstall = []
    preinstall = string.split(install_info['prebuildscript'], ';')
    for cmd in preinstall: os.system(cmd)

    cwd = os.getcwd()
    print cwd
    os.chdir(os.path.join(os.getcwd(), install_info['sourcedir']))
    print os.getcwd()

    buildscript = []
    buildscript = string.split(install_info['buildscript'], ';')
    for cmd in buildscript: os.system(cmd)

    installscript = []
    installscript = string.split(install_info['installscript'], ';')
    for cmd in installscript: os.system(cmd)


if sys.argv[1] == 'install': install_package(sys.argv[2])

=====================================================

When I run "python centipyde.py install ply15", PLY1.5 gets downloaded from David Beazley's website, uncompressed and installed into the site-package as shown here:


znichols-maurice:~/MyProjects/ib-dwb/centipyde mauriceling$ ls -alltotal 8
drwxr-xr-x 5 mauricel mauricel 170 28 Apr 17:37 .
drwxr-xr-x 10 mauricel mauricel 340 28 Apr 16:21 ..
drwxr-xr-x 5 mauricel mauricel 170 28 Apr 17:33 CVS
-rw-r--r-- 1 mauricel mauricel 1385 28 Apr 23:47 centipyde.py
drwxr-xr-x 4 mauricel mauricel 136 28 Apr 17:36 pkginfo
znichols-maurice:~/MyProjects/ib-dwb/centipyde mauriceling$ sudo python centipyde.py install ply15
Package Installation Information: {'maintainer': '.', 'sourcedir': 'ply-1.5', 'package': 'ply15', 'downloadurl': 'http://systems.cs.uchicago.edu/ply/ply-1.5.tar.gz', 'installscript': 'sudo python setup.py install', 'dependencies': '.', 'buildscript': 'python setup.py build', 'prebuildscript': 'tar zxvf ply-1.5.tar.gz'}
% Total % Received % Xferd Average Speed Time Curr.
Dload Upload Total Current Left Speed
100 69278 100 69278 0 0 7746 0 0:00:08 0:00:08 0:00:00 31811
ply-1.5/
ply-1.5/doc/
ply-1.5/doc/ply.html
ply-1.5/CHANGES
ply-1.5/COPYING


..... [snipped] .....

ply-1.5/test/yacc_uprec.exp
ply-1.5/test/yacc_uprec.py
/sw/lib/python2.3/distutils/dist.py:213: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running build
running build_py
creating build
creating build/lib
copying lex.py -> build/lib
copying yacc.py -> build/lib
/sw/lib/python2.3/distutils/dist.py:213: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running install
running build
running build_py
running install_lib
znichols-maurice:~/MyProjects/ib-dwb/centipyde mauriceling$
================================


I think there are some obvious ways that we might work together...

Cheers
Maurice
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to