-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
75 lines (64 loc) · 1.86 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
import ast
import sys
from setuptools import find_packages, setup
def readme():
try:
f = open('README.rst')
except IOError:
return
try:
return f.read()
finally:
f.close()
def get_version():
filename = 'dodotable/__init__.py'
with open(filename, 'r') as f:
tree = ast.parse(f.read(), filename)
for node in tree.body:
if (isinstance(node, ast.Assign) and
node.targets[0].id == '__version_info__'):
version = '.'.join(
str(x) for x in ast.literal_eval(node.value)
)
return version
else:
raise ValueError('could not find __version_info__')
install_requires = [
'setuptools',
'Flask',
'Jinja2',
'SQLAlchemy',
'six >= 1.10.0, < 2.0.0',
]
def get_install_requirements(requires):
install_requires = requires[:]
if 'bdist_wheel' not in sys.argv and sys.version_info < (3, 4):
install_requires.append('mock')
return install_requires
setup(
name='dodotable',
version=get_version(),
description='dodotable',
long_description=readme(),
url='https://github.com/spoqa/dodotable',
license='MIT',
author='Kang Hyojun',
author_email='ed' '@' 'spoqa.com',
packages=find_packages(exclude=['tests']),
package_data={
'dodotable': ['locale/*/LC_MESSAGES/*.mo', 'templates/*.html'],
},
install_requires=get_install_requirements(install_requires),
setup_requires=['Babel'],
message_extractors={
'dodotable': [('**.py', 'python', None)],
'dodotable/templates': [
('**.html', 'jinja2', {
'encoding': 'utf-8',
'extensions': 'jinja2.ext.autoescape,jinja2.ext.with_', # noqa
'silent': 'false',
}),
],
},
classifiers=[]
)