Sunday 2 August 2009

easy_install (mis)behaviour

Version 0.7 of netaddr, a major milestone release went out recently. It marked the library's status moving from beta to production/stable as I'm fairly happy now with its interface and implementation.

There was a lot of change involved in this release due to some major refactoring work. I thought it best to put together a series of pre-release snapshot tarballs to give interested users an early look at the upcoming changes and a chance to hopefully squash any bugs before the main release.

The download page on the Google code hosting site seemed like a fairly safe bet for publishing these files. I purposefully didn't post them on PyPI in an attempt to limit the audience to which they would be made available.

BIG mistake!

A kind user raised the following bug report - http://code.google.com/p/netaddr/issues/detail?id=41

They used easy_install to install netaddr and, unbeknown to me, in the background it was going off to the code hosting site, picking up the release candidate packages, and trying to dynamically build eggs based on them to provide to users!

The question is "why would you choose to do this"?! Hey, I'm all for software being clever and helpful, but this choice of behaviour seems a bit clever for its own good. It wantonly broke a seemingly sane way of releasing code and really seems to try hard to break the Rule of Least Surprise. This kind of thing is actually the opposite of helpful.

OK, so the easy fix would probably be to remove or change the explicit link between PyPI and the code hosting download page by editing the Download URL parameter in the PKG_INFO file, but the fact remains that this functionality seems to be trying a little too hard to be useful.

It seems that my misgivings on supporting setuptools are not entirely without justification ;-)

No comments: