forked from virantha/pypdfocr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
44 lines (36 loc) · 1.4 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
from fabric.api import *
import os
def build_windows_dist():
if os.name == 'nt':
# Call the pyinstaller
local("python ../pyinstaller/pyinstaller.py pypdfocr_windows.spec --onefile")
def run_tests():
test_dir = "test"
with lcd(test_dir):
# Regenerate the test script
local("py.test --genscript=runtests.py")
t = local("py.test --cov-config .coveragerc --cov=pypdfocr --cov-report=term --cov-report=html", capture=False)
t = local("coveralls")
#with open("test/COVERAGE.rst", "w") as f:
#f.write(t)
def push_docs():
""" Build the sphinx docs from develop
And push it to gh-pages
"""
githubpages = "/Users/virantha/dev/githubdocs/pypdfocr"
# Convert markdown readme to rst
#local("pandoc README.md -f markdown -t rst -o README.rst")
with lcd(githubpages):
local("git checkout gh-pages")
local("git pull origin gh-pages")
local("head CHANGES.rst > CHANGES_RECENT.rst")
local("tail -n 1 CHANGES.rst >> CHANGES_RECENT.rst")
with lcd("docs"):
print("Running sphinx in docs/ and building to ~/dev/githubpages/pypdfocr")
local("make clean")
local("make html")
local("cp -R ../test/htmlcov %s/html/testing" % githubpages)
with lcd(githubpages):
local("git add .")
local('git commit -am "doc update"')
local('git push origin gh-pages')