forked from apragacz/django-rest-registration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
82 lines (70 loc) · 2.28 KB
/
setup.py
File metadata and controls
82 lines (70 loc) · 2.28 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
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
import os.path
import re
from setuptools import find_packages, setup
ROOT_DIR = os.path.dirname(__file__)
def read_contents(local_filepath):
with open(os.path.join(ROOT_DIR, local_filepath)) as f:
return f.read()
def get_requirements(requirements_filepath):
'''
Return list of this package requirements via local filepath.
'''
return read_contents(requirements_filepath).split('\n')
def get_version(package):
'''
Return package version as listed in `__version__` in `init.py`.
'''
init_py = read_contents(os.path.join(package, '__init__.py'))
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
def get_long_description(markdown_filepath):
'''
Return the long description in RST format, when possible.
'''
try:
import pypandoc
return pypandoc.convert(markdown_filepath, 'rst')
except ImportError:
return read_contents(markdown_filepath)
setup(
name='django-rest-registration',
version=get_version('rest_registration'),
packages=find_packages(exclude=['tests.*', 'tests']),
include_package_data=True,
author='Andrzej Pragacz',
author_email='apragacz@o2.pl',
description=(
'User registration REST API, based on django-rest-framework'
),
license='MIT',
keywords=' '.join((
'django',
'rest',
'api',
'rest-framework',
'registration',
'register',
'login',
'sign-up',
'signin',
)),
long_description=get_long_description('README.md'),
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.10',
'Framework :: Django :: 2.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Internet',
'Topic :: Internet :: WWW/HTTP',
],
install_requires=get_requirements('requirements.txt'),
python_requires='>=3.4',
url='https://github.com/szopu/django-rest-registration',
)