At 01:00 PM 5/15/2009 +0200, Brian Sutherland wrote:
Hi,
It may seem like a backwards way of doing things, but I have a need for a utility that can maintain a python package index mirror of a Debian repository.
The basic idea is to extract the tarballs of Python packages from the Debian repository and rename them to the original setuptools name. It should also create a buildout-compatible versions file of the versions in the repository.
My current implementation idea is to unpack the tarball and use the egg-metadata to figure out what the "egg" name of the tarball should be.
Running "setup.py --name --version" will dump out the name and version, whether you use distutils or setuptools. If you want a setuptools-compatible name and version, you'll need to postprocess those strings with pkg_resources.safe_name() and safe_version(), then escape them with to_filename() if you're using them as components of a sdist or egg filename.