GSoC - Done

Yesterday was the official pencils-down date, so GSoC 2010 has finally finished. It was a very interesting and productive summer, as we added plenty of new features to distutils2. I would like to thank my mentor Michael Mulich, the fellow students and all other developers that took part in the development of distutils2 this summer, either directly or undirectly. I think that we did make some progress, and to get a better idea of what has been done you can take a look at their final reports: Mouad, Alexis, Zubin, Konrad. My task consisted of three parts (the official wiki entry)


Implement pkgutil APIs described in PEP 376

All the functionalities proposed in PEP-376 are now supported in distutils2. In addition, we also decided to add back-support to be able to read .egg distributions as well. This is turned off by default and can be turned on by setting the use_egg_info parameter to True in any of the functions. Also, a cache a has been added to seed things up in case of multiple queries for the distribution database. To get a better idea, I suggest you to take a look at the latest  documentation.

Implement a dependency-graph builder

As described in a previous post, this tool is able to create graphs from the dependency among the distributions on the system. The best introduction is the
official documentation.


Add basic PEP 376 support in Distribute

Distribute has now .dist-info read support, meaning that it can also use PEP 376-style packages completely transparent to the user.


In addition to these tasks, I also did some extra work as I finished a bit early.

First, I added distutils2 support to extensions. The use is very simple, as can be seen from this adapted snippet from the actual documentation

# The procedure is similiar to the one for `distutils`,
# just the name of the module has to be changed,
# i.e. the `setup.py` file will look like::      

from distutils2.core import setup
from myapp import plugins

# registers the plugins
setup(name='myapp', version='1.0',
         packages=['myapp'])

# What is different, is where the `PLUGINS` file with all
# the entry points is located. In this case, it is placed in
# the `.dist-info` directory of the distribution which is created
# in accordance with :pep:`376`.

Also, and more importantly (at least to me), I wrote the install_distinfo command that creates the .dist-info directory for the distribution, and got rid of all
the egg-relted code. To use it you don't have to do anything, just run the install command and then it in turn calls install_distinfo. To get a better feel, an example installation looks like this

(josip@laptop) example % sudo python setup.py install
running install
running build
running build_py
running install_lib
running install_distinfo
Creating /usr/lib/python2.6/site-packages/Hello_World-0.1.dist-info
Creating /usr/lib/python2.6/site-packages/Hello_World-0.1.dist-info/METADATA
Creating /usr/lib/python2.6/site-packages/Hello_World-0.1.dist-info/INSTALLER
Creating /usr/lib/python2.6/site-packages/Hello_World-0.1.dist-info/REQUESTED
Creating /usr/lib/python2.6/site-packages/Hello_World-0.1.dist-info/RECORD
Creating /usr/lib/python2.6/site-packages/Hello_World-0.1.dist-info/PLUGINS