forked from myarik/django-rest-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
78 lines (67 loc) · 2.47 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from setuptools import setup, find_packages
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
with open(os.path.join(package, '__init__.py'), 'rb') as init_py:
src = init_py.read().decode('utf-8')
return re.search("__version__ = ['\"]([^'\"]+)['\"]", src).group(1)
def get_requires():
"""
Return requires packages listend in `requirements.txt`.
"""
current_dir = os.path.dirname(os.path.realpath(__file__))
requirement_path = current_dir + '/requirements.txt'
install_requires = []
if os.path.isfile(requirement_path):
with open(requirement_path) as f:
install_requires = f.read().splitlines()
return install_requires
def get_dev_requires():
"""
Return development requires packages listend in `requirements_dev.txt`.
"""
current_dir = os.path.dirname(os.path.realpath(__file__))
dev_requirement_path = current_dir + '/requirements_dev.txt'
dev_install_requires = []
if os.path.isfile(dev_requirement_path):
with open(dev_requirement_path) as f:
dev_install_requires = f.read().splitlines()
return dev_install_requires
setup(
name='django-rest-elasticsearch',
version=get_version('rest_framework_elasticsearch'),
url='https://github.com/myarik/rest_framework_elasticsearch',
license='Apache 2.0',
description='Elasticsearch support for Django REST Framework',
author='Yaroslav Muravskyi',
author_email='[email protected]',
packages=find_packages(
where='.',
exclude=('example_project*','compose*')
),
include_package_data=True,
install_requires=get_requires(),
tests_require=get_dev_requires(),
setup_requires=get_dev_requires(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
'Topic :: Internet :: WWW/HTTP',
]
)