From 5963fd875707193349af6b77ec9dff280b46811f Mon Sep 17 00:00:00 2001 From: Erik Rose Date: Fri, 18 Nov 2011 17:34:29 -0800 Subject: Bootstrap Sphinx docs. * Clean up docstrings' Sphinx formatting. * Put a version SPOT in __init__. --- fabfile.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 fabfile.py (limited to 'fabfile.py') diff --git a/fabfile.py b/fabfile.py new file mode 100644 index 0000000..cc556bc --- /dev/null +++ b/fabfile.py @@ -0,0 +1,41 @@ +"""Run this using ``fabric``. + +I can't remember any of this syntax on my own. + +""" +import functools +import os + +from fabric.api import local, cd + + +local = functools.partial(local, capture=False) + +NAME = os.path.basename(os.path.dirname(__file__)) +ROOT = os.path.abspath(os.path.dirname(__file__)) + +os.environ['PYTHONPATH'] = (((os.environ['PYTHONPATH'] + ':') if + os.environ.get('PYTHONPATH') else '') + ROOT) + + +def doc(kind='html'): + """Build Sphinx docs. + + Requires Sphinx to be installed. + + """ + with cd('docs'): + local('make clean %s' % kind) + +def test(): + # Just calling nosetests results in SUPPORTS_TRANSACTIONS KeyErrors. + local('nosetests') + +def updoc(): + """Build Sphinx docs and upload them to packages.python.org. + + Requires Sphinx-PyPI-upload to be installed. + + """ + doc('html') + local('python setup.py upload_sphinx --upload-dir=docs/_build/html') -- cgit v1.2.1