Thursday Sep 18, 2008

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-AT-0.5.11-0-DOT-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
/usr/bin/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
/usr/bin/rst2html.py

And now I can start experimenting with restructured text.

[ T: ]

About

sch

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
External blogs