forked from botify-labs/simpleflow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·142 lines (124 loc) · 3.55 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import subprocess
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from io import open
REQUIRES = [
]
PUBLISH_CMD = "python setup.py sdist bdist_wheel upload"
TEST_PUBLISH_CMD = 'python setup.py sdist bdist_wheel upload -r test'
PY2 = int(sys.version[0]) == 2
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)
def find_version(fname):
'''Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
'''
version = ''
with open(fname, 'r') as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in fp:
m = reg.match(line)
if m:
version = m.group(1)
break
if not version:
raise RuntimeError('Cannot find version information')
return version
__version__ = find_version("simpleflow/__init__.py")
if 'publish' in sys.argv:
try:
__import__('wheel')
except ImportError:
print("wheel required. Run `pip install wheel`.")
sys.exit(1)
status = subprocess.call(PUBLISH_CMD, shell=True)
sys.exit(status)
if 'publish_test' in sys.argv:
try:
__import__('wheel')
except ImportError:
print("wheel required. Run `pip install wheel`.")
sys.exit(1)
status = subprocess.call(TEST_PUBLISH_CMD, shell=True)
sys.exit()
def read(fname):
with open(fname, encoding='utf8') as fp:
content = fp.read()
return content
DEPS = [
'future',
'boto>=2.38.0',
'diskcache==2.4.1',
'Jinja2>=2.8',
'kubernetes==3.0.0',
'lazy_object_proxy',
'lockfile>=0.9.1',
'tabulate>=0.7.3,<0.8.0',
'setproctitle',
'click',
'psutil>=3.2.1',
'pytz',
'typing',
'PyYAML',
]
if PY2:
DEPS += [
'enum34',
'subprocess32',
]
setup(
name='simpleflow',
version=__version__,
description='Python library for dataflow programming with Amazon SWF',
long_description=(read("README.md") + '\n\n' +
read("CHANGELOG.md")),
long_description_content_type='text/markdown',
author='Greg Leclercq',
author_email='tech@botify.com',
url='https://github.com/botify-labs/simpleflow',
packages=find_packages(exclude=("test*",)),
package_dir={
'simpleflow': 'simpleflow',
'swf': 'swf',
},
include_package_data=True,
install_requires=DEPS,
license=read("LICENSE"),
zip_safe=False,
keywords='simpleflow amazon swf simple workflow',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
test_suite='tests',
tests_require=[
'pytest',
'moto==0.4.31',
],
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
'simpleflow = simpleflow.command:cli',
]
}
)