forked from omab/python-social-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
90 lines (74 loc) · 2.65 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
# -*- coding: utf-8 -*-
"""Setup file for easy installation"""
import sys
import os
from os.path import join, dirname, split
from setuptools import setup
PY3 = os.environ.get('BUILD_VERSION') == '3' or sys.version_info[0] == 3
version = __import__('social').__version__
LONG_DESCRIPTION = """
Python Social Auth is an easy to setup social authentication/registration
mechanism with support for several frameworks and auth providers.
Crafted using base code from django-social-auth, implements a common interface
to define new authentication providers from third parties. And to bring support
for more frameworks and ORMs.
"""
def long_description():
"""Return long description from README.rst if it's present
because it doesn't get installed."""
try:
return open(join(dirname(__file__), 'README.rst')).read()
except IOError:
return LONG_DESCRIPTION
def path_tokens(path):
if not path:
return []
head, tail = split(path)
return path_tokens(head) + [tail]
def get_packages():
exclude_pacakages = ('__pycache__',)
packages = []
for path_info in os.walk('social'):
tokens = path_tokens(path_info[0])
if tokens[-1] not in exclude_pacakages:
packages.append('.'.join(tokens))
return packages
requirements_file, tests_requirements_file = {
False: ('requirements.txt', 'social/tests/requirements.txt'),
True: ('requirements-python3.txt', 'social/tests/requirements-python3.txt')
}[PY3]
with open(requirements_file, 'r') as f:
requirements = f.readlines()
with open(tests_requirements_file, 'r') as f:
tests_requirements = f.readlines()
setup(
name='python-social-auth',
version=version,
author='Matias Aguirre',
author_email='[email protected]',
description='Python social authentication made simple.',
license='BSD',
keywords='django, flask, pyramid, webpy, openid, oauth, social auth',
url='https://github.com/omab/python-social-auth',
packages=get_packages(),
long_description=long_description(),
install_requires=requirements,
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.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3'
],
package_data={
'social/tests': ['social/tests/*.txt']
},
include_package_data=True,
tests_require=tests_requirements,
test_suite='social.tests',
zip_safe=False
)