-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
44 lines (36 loc) · 1.19 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
from fabric.api import env, local
import os
env.hosts = ['localhost']
#env.user = 'deploy'
#env.keyfile = ['$HOME/.ssh/deploy_rsa']
#env.directory = '/path/to/virtualenvs/project'
#env.activate = 'source /path/to/virtualenvs/project/bin/activate'
def test():
''' Run the unit tests '''
local('py.test builder test_builder.py')
def coverage():
''' Run the unit tests and generate a coverage report '''
local('py.test --cov builder test_builder.py')
def coverage_html():
''' Generate the HTML coverage report '''
local('coverage run test_builder.py; coverage html; firefox htmlcov/index.html')
def coverage_loop():
''' Run the coverage report in an infinite loop '''
while True:
coverage()
local('read')
def pep8():
''' Check the code base for PEP8 Compatibility '''
local('pep8 builder/')
def pep8_loop():
''' Run the pep8 report in an infinite loop '''
while True:
pep8()
local('read')
def clean():
'''
Clean the *.pyc files from the working tree. Additionally, remove all
the __pycache__ directories
'''
local('find . -type d -name "*__pycache__*" -exec rm -rv {} \;')
local('find . -iname "*.pyc" -exec rm -v {} \;')