Deciphering
Glyph
( )
Announcement! Epsilon Strikes Back

Wed 02 November 2005

There's a new release of Epsilon today.

As it seems to happen every release, we added some new features in the course of doing the release itself. This release's showcased new feature: setuphelper.autosetup().

A normal project's setup.py might look like this:

from distutils.core import setup
setup(name="MySpiffyProject", version="1.2.3",
packages=['mypackage', 'otherpackage'],
package_data=dict(
mypackage=['data/static.png', 'data/static.html'],
otherpackage=['templates/*.kid']))

Now, this is somewhat fragile and error-prone. You can easily forget code which is supposed to be installed. Each new release requires the release manager to scour the directory tree for new files which might be required.

Twisted has a fairly baroque setup.py which deals with this problem, among other things. However, Twisted's setup.py (and other projects' as well) are rarely designed for re-use. Twisted has, in fact, entirely given up on setup.py sdist for generating releases.

Enter Epsilon's autosetup() - that same setup.py with Epsilon would look like this:

from epsilon.setuphelper import autosetup
from myproject import version

autosetup(name="MySpiffyProject", version=version.short())


These helpers make release maintenance a lot easier. You no longer need to:

  • update your setup.py with each release: just the project's version number.

  • manually identify what files are required for the project to run: if it's in a Python package directory, the assumption is that it's there for a good reason

  • update your setup.py when you add new files

  • regenerate Twisted plugins caches post-installation


I need to look at setuptools and see if these concepts can be re-applied. If we're lucky they'll be unnecessary there, but just a little bit of automation has gone a long way so far.