This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fabfile.py
92 lines (65 loc) · 2.53 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Deployment of appypi. """
# fabric
from fabric.api import env, execute, local
from appypi import __version__ as VERSION
from appypi.utils import remove_launchers
def fast_commit(capture=True):
""" Fast and dirty commit with common commit message. """
env.warn_only = True
local('git commit -am"fast commit through Fabric"')
def push():
""" Local git push. """
local("git push")
def deploy():
""" Commit and push to git servers. """
execute(fast_commit)
execute(push)
def reinstall():
""" Reinstall the project to local virtualenv. """
local('if [ $(pip freeze | grep appypi | wc -w ) -eq 1 ]; then '
'pip uninstall -q -y appypi ; fi')
local('python setup.py sdist')
local('pip install -q dist/appypi-' + VERSION + '.tar.gz')
local('rm -rf dist appypi.egg-info MANIFEST')
def install():
""" Install the project. """
local('python setup.py install')
local('rm -rf build')
def tests():
""" Launch tests. """
local("rm -rf /tmp/appypi_tmp")
remove_launchers()
local("nosetests -v --with-coverage --cover-package appypi tests."
"test_ApplicationController tests.test_models tests.test_utils")
local("echo 'y' | nosetests -v --with-coverage --cover-package appypi "
"tests.test_manual:test_remove")
local("echo 'n' | nosetests -v --with-coverage --cover-package appypi "
"tests.test_manual:test_remove_not_confirmed")
local("nosetests -v --with-coverage --cover-package appypi "
"tests.test_manual:test_requirement_file")
local("nosetests -v --with-coverage --cover-package appypi "
"tests.test_manual:test_requirement_erroneous_file")
local("coverage html -i -d /tmp/coverage-appypi --omit='appypi/docopt.py'")
local("coverage erase")
def build_doc():
""" Build the html documentation. """
local('cd docs/ && make html')
def clean():
""" Remove temporary files. """
local('rm -rf docs/_build/')
local('find . -name "*.pyc" | xargs rm')
def destroy():
""" Delete local appypi data. """
local("rm -rf ~/.appypi")
remove_launchers()
def upload():
""" Upload to Pypi. """
local("python setup.py sdist upload")
def md2rst(in_file, out_file, pipe):
""" Generate reStructuredText from Makrdown. """
local("pandoc -f markdown -t rst %s %s > %s" % (in_file, pipe, out_file))
def readme():
""" Convert Markdown README file to reStructuredText README file. """
md2rst('README.md', 'README.txt', '| head -n -7')