When I cut a release for WSGIKit, I want the experience to be pretty
easy -- you download the package, run a command, you got a server you
can play with. It's pretty close to that right now, you can run:
./server.py --webkit-dir=../examples/todo --server=wsgiutils \
--reload -v -D
To do that I have to ship some dependencies, like a server (WSGIUtils
is small, but now with TwistedWeb 2 it's pretty reasonable as well).
Maybe even a couple of servers. And if I want to make use of other
people's middleware or libraries, I don't want to import them into my
repository and namespace. I just want to distribute the files.
One option is to use a zip file, which Python can import from. You
just add the zip file to sys.path. For pure Python packages this
works okay -- and if it's not pure Python it's not a simple install
anyway and I don't mind leaving it out and forcing the user to install
it on their own. There are some problems, however -- Eggs try to
solve this, but there's still a little work to do there.
Then I realized I didn't really like zip files. Zip files nested in
zip files, what does that buy? And anyway, I want users to have
access to all the source unpacked, regardless of its origin -- this is
the transparency we like in an open source framework. They shouldn't
need to look at the source. But I actually want them to, since
then they are more likely to contribute, and to generally feel
comfortable with the infrastructure.
So, my plan is to put all the external packages in a 3rd-party
directory. I named it so it's an invalid Python package, and people
can't import from it directly. Instead for each package there's a
subdirectory that is added if we need to load the package, so
3rd-party/wsgiutils-files/ is added to sys.path if
wsgiutils can't be loaded the normal way. I'm 100% okay with
adding 100K to the download to make the experience more pleasant --
heck, I'm probably okay with something much larger than 100K, it's
only disk space and bandwidth, and both of those are cheap these days.
I made a little module to support this -- no magic, nothing very
fancy at all.