forked from openxc/openxc-python
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
45 lines (36 loc) · 1.03 KB
/
fabfile.py
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
44
45
from __future__ import with_statement
import os
from fabric.api import abort, local, task, lcd, puts
@task(default=True)
def docs(clean='no', browse_='no'):
with lcd('docs'):
local('make clean html')
temp_path = "/tmp/openxc-python-docs"
docs_path = "%s/docs/_build/html" % local("pwd", capture=True)
local('rm -rf %s' % temp_path)
os.makedirs(temp_path)
with lcd(temp_path):
local('cp -R %s %s' % (docs_path, temp_path))
local('git checkout gh-pages')
local('cp -R %s/html/* .' % temp_path)
local('touch .nojekyll')
local('git add -A')
local('git commit -m "Update Sphinx docs."')
local('git push')
local('git checkout master')
@task
def browse():
"""
Open the current dev docs in a browser tab.
"""
local("$BROWSER docs/_build/html/index.html")
@task(default=True)
def test(args=None):
local("tox")
@task
def upload():
"""
Build, register and upload to PyPI
"""
puts("Uploading to PyPI")
local('python setup.py sdist register upload')