forked from rackerlabs/stackslurp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
84 lines (70 loc) · 2.14 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
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Backwards compatibility for Python 2.x
try:
from itertools import ifilter
filter = ifilter
except ImportError:
pass
def get_version():
'''
Version slurping without importing stackslurp, since dependencies may not
be met until setup is run.
'''
version_regex = re.compile(r"__version__\s+=\s+"
r"['\"](\d+.\d+.\d+\w*)['\"]$")
versions = filter(version_regex.match, open("stackslurp/__init__.py"))
try:
version = next(versions)
except StopIteration:
raise Exception("stackslurp version not set")
return version_regex.match(version).group(1)
version = get_version()
# Utility for publishing stackslurp, courtesy kennethreitz/requests
if sys.argv[-1] == 'publish':
print("Publishing stackslurp {version}".format(version=version))
os.system('python setup.py sdist upload')
sys.exit()
packages = ['stackslurp']
requires = [
"PyYAML>=3.10",
"argparse>=1.2.1",
"requests>=2.0.1"
]
setup(name='stackslurp',
version=version,
description='Grab questions on StackExchange, send to a CloudQueue',
# Switch to generated ReST later.
long_description=open('README.md').read(),
author='Kyle Kelley',
author_email='kyle.kelley@rackspace.com',
url='',
packages=packages,
package_data={'': ['LICENSE']},
include_package_data=False,
install_requires=requires,
entry_points={
'console_scripts': [
'slurp = stackslurp.main:main',
]
},
license=open('LICENSE').read(),
zip_safe=False,
classifiers=(
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Environment :: OpenStack',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
),
)