summaryrefslogtreecommitdiff
path: root/fabfile.py
blob: ebeeb6f07b46aa0c1ff9362d93e50b750bcf221b (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
"""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')