Python on Leopard

31 October 2007
00:33

As I haven't seen anyone writing much about the state of Python development on Mac OS X Leopard, here's a quick rundown. Leopard comes with Python 2.5.1 installed (OS X previously came with Python 2.3). And the interactive interpreter is now quite usable out of the box, as it includes the readline stuff you previously had to install by hand.

The setuptools/eggs infrastructure is also available by default, meaning that tons of third-party packages are just an easy_install incantation away. Quite a number of other packages come preinstalled (at least with the developer tools), such as numpy, wxPython, zope.interface and at least some parts of Twisted.

And then there's the whole PyObjC and BridgeSupport story, which should be great news for anyone interested in doing Mac OS X development with Python. Personally, I know nothing about this stuff, but being able to import WebKit gives me warm fuzzies (yeah, I'm weird).

For (potential) Trac users and developers, you should be delighted to learn that Leopard comes with SQLite 3.4, Subversion 1.4.4, and Apache HTTPD 2.2.6 (including mod_dav_svn) installed. The Python bindings for SQLite are part of Python 2.5, so there's nothing you need to do to use SQLite from Python. But also, Leopard includes the Python bindings for Subversion, so there's nothing needed in that area either.

When Trac 0.11 finally gets released (another story for another post), it'll be a simple matter of:

  easy_install Trac

to get Trac up and running, including the default SQLite database backend and Subversion integration. That command will automatically download and install Genshi for templating. About as easy as it gets. On the flip side, neither mod_wsgi nor mod_python are installed by default, but hey, you got to draw the line somewhere, I guess.

There's tons of other really nice things for developers, of course. A much better Terminal.app, Instruments, and updated versions of many (if not all) of those tools we depend upon every day, such as make and autoconf. Ruby got similar love as Python. Java, not so much, at least for now.