forked from progrium/ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (52 loc) · 1.59 KB
/
Copy pathsetup.py
File metadata and controls
58 lines (52 loc) · 1.59 KB
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
#!/usr/bin/env python
import os
from setuptools import Command
from setuptools import setup, find_packages
def command(fn):
"""decorator for easily making setuptools commands"""
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=ginkgo")
from ginkgo import __version__
setup(
name='Ginkgo',
version=__version__+"dev",
author='Jeff Lindsay',
author_email='jeff.lindsay@twilio.com',
description='Lightweight service framework',
packages=find_packages(),
install_requires=['gevent==0.13.3', 'nose',],
data_files=[],
entry_points={
'console_scripts': [
'ginkgo = ginkgo.app:run_ginkgo',
'ginkgoctl = ginkgo.app:run_ginkgoctl']},
cmdclass={
'test': test(),
'coverage': coverage(),
'build_pages': build_pages(),}
)