2008.next: Easy install for docutils

It’s been a busy summer, mostly trying to manage conflicting schedules at home while staying loyal to the six month release schedule for OpenSolaris at work. Schedules everywhere, it seems.

I’ve been probing deeper into the ecosystem around Python, and have been trying to determine whether restructured text might have some value in the workflow around OpenSolaris development: it can output to a variety of formats, including XML, LaTeX, and HTML, and doesn’t have an onerous list of dependencies.

I’ve scars from building AsciiDoc 8.

docutils isn’t available via image packaging yet, but it’s easily retrievable using easy_install. That means the question is: how do I get easy_install? I’m running Build 98, so I’ll restrict my search to packages on the development branch for that build:

$ pkg search -r easy_install | grep 0.98
basename  file  usr/bin/easy_install pkg:/SUNWpython-setuptools@0.5.11-0.98

Okay, easy_install is part of setuptools—you probably knew that already. Let’s install the appropriate package using pkg(1):

$ pfexec pkg install SUNWpython-setuptools
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       81/81     0.30/0.30
PHASE                                        ACTIONS
Install Phase                                  93/93
PHASE                                          ITEMS
Reading Existing Index                           9/9
Indexing Packages                                1/1
$ which easy_install

Having setuptools in place, we can now attempt installs of any Python module available in the Python Package Index (pypi), via the easy_install command. (easy_install --help will display a usage message for easy_install.) Let’s install the docutils package:

$ pfexec easy_install docutils
Searching for docutils
Reading http://pypi.python.org/simple/docutils/
Reading http://docutils.sourceforge.net/
Best match: docutils 0.5
Downloading http://prdownloads.sourceforge.net/docutils/docutils-0.5.tar.gz?download
Processing docutils-0.5.tar.gz
Running docutils-0.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-57yD32/docutils-0.5/egg-dist-tmp-Ip1xgp
"optparse" module already present; ignoring extras/optparse.py.
"textwrap" module already present; ignoring extras/textwrap.py.
zip_safe flag not set; analyzing archive contents...
docutils.parsers.rst.directives.misc: module references file
docutils.writers.html4css1.init: module references file
docutils.writers.pep_html.init: module references file
docutils.writers.s5_html.init: module references file
docutils.writers.newlatex2e.init: module references file
Adding docutils 0.5 to easy-install.pth file
Installing rst2xml.py script to /usr/bin
Installing rst2pseudoxml.py script to /usr/bin
Installing rst2html.py script to /usr/bin
Installing rst2s5.py script to /usr/bin
Installing rst2latex.py script to /usr/bin
Installing rstpep2html.py script to /usr/bin
Installing rst2newlatex.py script to /usr/bin
Installed /usr/lib/python2.4/site-packages/docutils-0.5-py2.4.egg
Processing dependencies for docutils
Finished processing dependencies for docutils
$ which rst2html.py

And now I can start experimenting with restructured text.

[ T: OpenSolaris Python pkg docutils setuptools ]