Saturday, January 10, 2009

The messy internals of python.org

This evening I've been trying to get the newly auto-generated PEP Index up and running on the website. At first, I thought I could just update the PEP Makefile. When that didn't work, I tried the website's Makefile. As it turns out, the Makefile is only used for testing purposes not in production. So, I began my journey into the caves of Python's web server.

When a somebody makes a change on the website, a post commit hook records the revision number in a special file. As simple as this sounds, it somehow has to involve invoking a C program that calls a Python script. Every 5 minutes a confusingly named binary, post-commit-svnup-binary (called "post-commit" because it used to run as a commit hook), wraps another Python script to build the website. Instead of using the website's Makefile, this program calls another series of Python programs which read a bit like Makefiles. I tried rewriting those to run my index generator, but I still must be missing something because the new PEP index doesn't seem to have gone live yet. *sigh*

python.org really needs an introduction to DRY.

2 comments:

Steve said...

That's not all that python.org needs. It seems to go in fits and starts. Sorry you are finding it a bit tedious - have you mailed the pydotorg group for help?

anatoly techtonik said...

The first thing to be done that comes into my mind is to find people who wrote this and present them with a book that about how to write clean code and DRY.