Ian Bicking: the old part of his blog

Sprint Day 2

Well, it was a couple days ago, but I thought I'd follow up a little on Sprint Day 1.

A couple new people came in -- Rick and Karl from axiomfire (where Tracy works). They were both new hires and new to Webware (though not Python). Also Aaron Lav came in for the second half of the day.

We (Tracy and Eric really) got the to-do application mostly working. I'm afraid I left Tracy and Eric to struggle with configuration issues for a while; they seemed to be working together well, and I thought I'd let them go at it, but they were working on some things that I could have answered more quickly for them, to let them move on to more interesting problems. They found a bug in WSGIUtils on the way, where it didn't close the application iterator, and wsgikit.session really depends on that. wsgikit.lint actually caught this, but I didn't pay attention to the error -- because lint checks if it's been closed in __del__, it can't raise a real error (errors in __del__ methods are ignored, though a somewhat vague warning message is printed). lint now prints a better error message. One thing I should advertise better is that lint is really the best WSGI compliance test out there right now, but it only tests things as they go by; something else has to be used to excersize the functionality. wsgikit.tests.echotest excersizes the application a little, but it's limited.

Aaron and Karl got the login middleware working (wsgikit.login), which handles authentication/identification but not authorization. I hate that authentication and authorization both start with "auth", because I realize I match words on their first four letters. I think this naming convention alone is probably a big part of why Zope 2 and Apache have bad authentication layers that are mixed with authorization -- if the terminology was better people wouldn't accidentally fold together the two ideas.

Rick worked on some documentation, but unfortunately didn't get it checked in -- I hope that'll come through at some point, even if it isn't complete. I think it's important to get everything checked in, regardless of state, because it's easy to lose things on people's hard drives when the sprint is done.

I worked on a couple things. I started testing wsgikit.urlparser, and using TDD for the new features. That went really well. I also built up a bit of a test fixture for WSGI (wsgikit.test_fixture -- which is kind of a dumping ground, but a lot of pieces will probably go away -- fake_request is what I really used). WSGI worked really well for testing, because I could test only URLParser, by creating an "incomplete" stack that didn't include any other components. I had to create little WSGI applications, but I wrote them as plainly as I could -- the app files don't even import anything.

I also started working on configuration (wsgikit.pyconfig and wsgikit.configmiddleware), though I haven't made use of it yet. And I put together a startup script (server.py) that makes it easy to run an app and load configuration. And I put together the generic reloader (wsgikit.reloader), for Webware-style reloading; server.py actually handles the whole restart portion, so that there's no shell or batch files involved -- a minor point, but it's one less thing to think about. I haven't tested it with twisted -- maybe twisted wouldn't like me killing it quite so crudely; probably reloader should be extended with custom ways to terminate the process (though really the process should terminate fine so long as you use atexit properly).

Anyway, a lot more to talk about for Day 1, and my WSGIKit presentation, but that will wait for another post.

Created 24 Mar '05