summaryrefslogtreecommitdiff
path: root/fabfile.py
diff options
context:
space:
mode:
authorErik Rose <erik@mozilla.com>2011-11-18 17:34:29 -0800
committerErik Rose <erik@mozilla.com>2011-11-18 17:34:29 -0800
commit5963fd875707193349af6b77ec9dff280b46811f (patch)
tree88e4887a26f8860b280004d91152c385c9d1f05f /fabfile.py
parent6c84202286e55eb3e4e86541a61fef668f091689 (diff)
downloadblessings-5963fd875707193349af6b77ec9dff280b46811f.tar.gz
Bootstrap Sphinx docs.
* Clean up docstrings' Sphinx formatting. * Put a version SPOT in __init__.
Diffstat (limited to 'fabfile.py')
-rw-r--r--fabfile.py41
1 files changed, 41 insertions, 0 deletions
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')