forked from python-social-auth/social-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
121 lines (101 loc) · 4.01 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# -*- coding: utf-8 -*-
import sys
import re
import os
from os.path import join, dirname
from setuptools import setup
VERSION_RE = re.compile(r'__version__ = \'([\d\.]+)\'')
LONG_DESCRIPTION = """
Python Social Auth is an easy to setup social authentication/registration
mechanism with support for several frameworks and auth providers.
It implements a common interface to define new authentication
providers from third parties. And to bring support for more frameworks
and ORMs.
"""
def long_description():
try:
return open(join(dirname(__file__), 'README.md')).read()
except IOError:
return None
def read_version():
with open('social_core/__init__.py') as file:
version_line = [line for line in file.readlines()
if line.startswith('__version__')][0]
return VERSION_RE.match(version_line).groups()[0]
def read_requirements(filename):
with open(filename, 'r') as file:
return [line for line in file.readlines() if not line.startswith('-')]
def read_tests_requirements(filename):
return read_requirements('social_core/tests/{0}'.format(filename))
PY = os.environ.get("BUILD_VERSION") or sys.version_info[0]
requirements = read_requirements('requirements-base.txt')
# May be able to just use environment markers in requirements-base.txt
# at least on setuptools 36.2.0 and up.
requirements_py2 = read_requirements('requirements-python2.txt')
requirements_py3 = read_requirements('requirements-python3.txt')
requirements_openidconnect = read_requirements('requirements-openidconnect.txt')
requirements_saml = read_requirements('requirements-saml-python%s.txt' % PY)
requirements_azuread = read_requirements('requirements-azuread.txt')
tests_requirements_base = read_tests_requirements('requirements-base.txt')
tests_requirements = tests_requirements_base + \
read_tests_requirements('requirements-python%s.txt' % PY)
requirements_all = requirements_openidconnect + \
requirements_saml + \
requirements_azuread
tests_requirements = tests_requirements + requirements_all
setup(
name='social-auth-core',
version=read_version(),
author='Matias Aguirre',
author_email='[email protected]',
description='Python social authentication made simple.',
license='BSD',
keywords='openid, oauth, saml, social auth',
url='https://github.com/python-social-auth/social-core',
packages=[
'social_core',
'social_core.backends',
'social_core.pipeline',
'social_core.tests',
'social_core.tests.actions',
'social_core.tests.backends',
'social_core.tests.backends.data'
],
long_description=long_description() or LONG_DESCRIPTION,
long_description_content_type="text/markdown",
install_requires=requirements,
extras_require={
'openidconnect': [requirements_openidconnect],
'saml': [requirements_saml],
'azuread': [requirements_azuread],
'all': [requirements_all],
'allpy2': [requirements_all, requirements_py2],
'allpy3': [requirements_all, requirements_py3],
':python_version < "3.0"': [requirements_py2],
':python_version >= "3.0"': [requirements_py3],
},
classifiers=[
'Development Status :: 4 - Beta',
'Topic :: Internet',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Environment :: Web Environment',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
package_data={
'social_core/tests': [
'social_core/tests/*.txt',
'social_core/tests/testkey.pem'
]
},
include_package_data=True,
tests_require=tests_requirements,
test_suite='social_core.tests',
zip_safe=False
)