forked from xkmato/data_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
58 lines (51 loc) · 1.6 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import json
import os.path
import re
from codecs import open
from setuptools import setup
ROOT = os.path.realpath(os.path.dirname(__file__))
init = os.path.join(ROOT, 'data_api', '__init__.py')
_version_re = re.compile(r'__version__\s+=\s+(.*)')
_name_re = re.compile(r'NAME\s+=\s+(.*)')
with open(init, 'rb') as f:
content = f.read().decode('utf-8')
VERSION = str(ast.literal_eval(_version_re.search(content).group(1)))
NAME = str(ast.literal_eval(_name_re.search(content).group(1)))
def get_requirements(requires):
with open('Pipfile.lock') as fd:
lock_data = json.load(fd)
return [
package_name + package_data['version']
for package_name, package_data in lock_data[requires].items()
]
setup(
name=NAME,
version=VERSION,
author='UNICEF',
author_email='rapidpro@unicef.org',
url='',
description='',
long_description=open(os.path.join(ROOT, 'README.md')).read(),
packages=('data_api', ),
zip_safe=False,
license='BSD',
include_package_data=True,
install_requires=get_requirements('default'),
tests_require=get_requirements('develop'),
extras_require={
'test': get_requirements('develop'),
},
classifiers=[
'Framework :: Django',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Framework :: Django',
'Framework :: Django :: 2',
'Framework :: Django :: 2.2',
],
)