-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
54 lines (45 loc) · 1.52 KB
/
setup.py
File metadata and controls
54 lines (45 loc) · 1.52 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
import os, re
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
def _get_version():
path = os.path.join(here, 'silota', '__init__.py')
version_re = r".*__version__ = '(.*?)'"
fo = open(path, 'r')
try:
return re.compile(version_re, re.S).match(fo.read()).group(1)
finally:
fo.close()
def parse_requirements(file_name):
requirements = []
for line in open(file_name, 'r').read().split('\n'):
if re.match(r'(\s*#)|(\s*$)', line):
continue
if re.match(r'\s*-e\s+', line):
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line))
elif re.match(r'\s*-f\s+', line):
pass
else:
requirements.append(line)
return requirements
VERSION = _get_version()
README = open(os.path.join(here, "README.rst")).read()
#README = README + open(os.path.join(here, "CHANGES.txt")).read()
setup(
name='silota',
version=VERSION,
author='Ganesh Swami',
author_email='support@silota.com',
url='http://www.silota.com',
packages=['silota'],
license='BSD',
description='Python client for the Silota Search As A Service API',
long_description=README,
test_suite = 'nose.collector',
install_requires=parse_requirements('requirements.txt'),
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)