Python needs a CPyAN

Eric S. Johansson esj at harvee.org
Wed Nov 3 07:05:15 EST 2004


Nick Craig-Wood wrote:
> Mike Meyer <mwm at mired.org> wrote:
> 
>> Actually, what people on systems with proper package management want
>> is packages that pull stuff from CPAN and install them as
>> packages.
> 
> 
> Absolutely!
> 
> For instance with Debian and Perl, dh-make-perl will turn a perl
> module (tar.gz or straight from CPAN) into a .deb which you then
> managage as normal.  When using Debian I never use CPAN and always
> dh-make-perl because I'd much rather have the package managed via
> dpkg/apt-get.
> 
> That said I haven't found many perl modules that I wanted that weren't
> already packaged for Debian.  The same with python modules too.
> 
> 
>> Doing this right is hard, because CPAN makes assumptions
>> about where things are liable to be installed.
> 
> 
> No idea how dh-make-perl works.  It does though!
> 
> 
>> For Python, what we want are packages that use distutils to install
>> them as packages. Doing this right is trivial, because distutils
>> gets all the relevant information from the environment.
> 
> 
> distutils already knows how to make .rpm files.
> 
> Eg choosing a package at the top of PyPI :-
> 
>     # Download
>     wget 'http://ftp.livinglogic.de/xist/ll-xist-2.6.1.tar.gz'
>     # Unpack
>     tar zxvf ll-xist-2.6.1.tar.gz 
>     cd ll-xist-2.6.1
>     # Make rpm
>     python setup.py bdist_rpm
>     # Make deb
>     cd dist/
>     fakeroot alien ll-xist-2.6.1-1.i386.rpm ll-xist-2.6.1-1.i386.deb
>     # Install with package manager
>     sudo dpkg -i ll-xist_2.6.1-2_i386.deb
> 
> This hasn't worked with every package I've tried it with though!
> 
> ...
> 
> To make PyPI into a CPAN replacement it needs to
> 1) make all the submitters use distutils, and automatically test the packaging
> 2) host the source tar balls
> 3) have a system of mirrors and provide this list for download
> 4) provide dependency information (maybe this should be in the distutils
>    information in the package)
> 5) Provide the list of packages, descriptions, and dependencies for
>    download
> 6) Some sort of review system (maintainers, peer review, rating etc)
>    for each package for quality assurance
> 
> Given all that the an automatically download package x + dependencies
> program would be easy.

I have provided a some of this functionality in raging dormouse. 
http://harvee.org/stamper/raging_dormouse/

can download from the sourceforge "click a link" maze or a regular web 
site.
Verifies checksum of package.
Can handle list of download sites to try (could be expanded to mirror 
list)

the build script in raging_dormouse is fairly application-specific.  It 
wouldn't be hard to redraft it as a configuration file driven process 
while rewriting it in Python vs. its current Bash incarnation.

you're welcome to it if you find useful.

---eric




More information about the Python-list mailing list