forked from progrium/ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
52 lines (47 loc) · 1.47 KB
/
setup.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
#!/usr/bin/env python
import os
from setuptools import Command
from setuptools import setup, find_packages
def command(fn):
def wrapped():
class cmdclass(Command):
def initialize_options(self): pass
def finalize_options(self): pass
user_options = []
description = fn.__doc__
def run(self): fn()
return cmdclass
return wrapped
@command
def test():
"""run tests with nose"""
os.execlp("nosetests", "nosetests")
@command
def build_pages():
"""rebuild the website"""
os.execlp("bash", "bash", "-c", """branch=$(git status | grep 'On branch' | cut -f 4 -d ' ')
git checkout gh-pages &&
git commit --allow-empty -m 'trigger pages rebuild' &&
git push origin gh-pages &&
git checkout $branch""")
@command
def coverage():
"""run test coverage report with nose"""
os.execlp("nosetests", "nosetests", "--with-coverage", "--cover-package=gservice")
setup(
name='gservice',
version='0.3.0',
author='Jeff Lindsay',
author_email='jeff.lindsay@twilio.com',
description='Lightweight service framework',
packages=find_packages(),
install_requires=['gevent==0.13.3', 'setproctitle', 'nose', 'python-daemon',],
data_files=[],
entry_points={
'console_scripts': [
'gservice = gservice.runner:main',]},
cmdclass={
'test': test(),
'coverage': coverage(),
'build_pages': build_pages(),}
)