|
6 | 6 | from setuptools import setup
|
7 | 7 |
|
8 | 8 |
|
9 |
| -PY3 = sys.version_info[0] == 3 |
| 9 | +PY3 = os.environ.get('BUILD_VERSION') == '3' or sys.version_info[0] == 3 |
10 | 10 |
|
11 | 11 | version = __import__('social').__version__
|
12 | 12 |
|
@@ -46,34 +46,42 @@ def get_packages():
|
46 | 46 | return packages
|
47 | 47 |
|
48 | 48 |
|
49 |
| -requires = ['requests>=1.1.0', 'oauthlib>=0.3.8', 'six>=1.2.0', 'PyJWT>=1.0.0'] |
50 |
| -if PY3: |
51 |
| - requires += ['python3-openid>=3.0.1', 'requests-oauthlib>0.3.2'] |
52 |
| -else: |
53 |
| - requires += ['python-openid>=2.2', 'requests-oauthlib>=0.3.1'] |
54 |
| - |
55 |
| - |
56 |
| -setup(name='python-social-auth', |
57 |
| - version=version, |
58 |
| - author='Matias Aguirre', |
59 |
| - |
60 |
| - description='Python social authentication made simple.', |
61 |
| - license='BSD', |
62 |
| - keywords='django, flask, pyramid, webpy, openid, oauth, social auth', |
63 |
| - url='https://github.com/omab/python-social-auth', |
64 |
| - packages=get_packages(), |
65 |
| - # package_data={'social': ['locale/*/LC_MESSAGES/*']}, |
66 |
| - long_description=long_description(), |
67 |
| - install_requires=requires, |
68 |
| - classifiers=['Development Status :: 4 - Beta', |
69 |
| - 'Topic :: Internet', |
70 |
| - 'License :: OSI Approved :: BSD License', |
71 |
| - 'Intended Audience :: Developers', |
72 |
| - 'Environment :: Web Environment', |
73 |
| - 'Programming Language :: Python', |
74 |
| - 'Programming Language :: Python :: 2.6', |
75 |
| - 'Programming Language :: Python :: 2.7', |
76 |
| - 'Programming Language :: Python :: 3'], |
77 |
| - tests_require=['sure>=1.2.5', 'httpretty>=0.8.0', 'mock>=1.0.1'], |
78 |
| - test_suite='social.tests', |
79 |
| - zip_safe=False) |
| 49 | +requirements_file, tests_requirements_file = { |
| 50 | + False: ('requirements.txt', 'social/tests/requirements.txt'), |
| 51 | + True: ('requirements-python3.txt', 'social/tests/requirements-python3.txt') |
| 52 | +}[PY3] |
| 53 | + |
| 54 | +with open(requirements_file, 'r') as f: |
| 55 | + requirements = f.readlines() |
| 56 | + |
| 57 | +with open(tests_requirements_file, 'r') as f: |
| 58 | + tests_requirements = f.readlines() |
| 59 | + |
| 60 | +setup( |
| 61 | + name='python-social-auth', |
| 62 | + version=version, |
| 63 | + author='Matias Aguirre', |
| 64 | + |
| 65 | + description='Python social authentication made simple.', |
| 66 | + license='BSD', |
| 67 | + keywords='django, flask, pyramid, webpy, openid, oauth, social auth', |
| 68 | + url='https://github.com/omab/python-social-auth', |
| 69 | + packages=get_packages(), |
| 70 | + # package_data={'social': ['locale/*/LC_MESSAGES/*']}, |
| 71 | + long_description=long_description(), |
| 72 | + install_requires=requirements, |
| 73 | + classifiers=[ |
| 74 | + 'Development Status :: 4 - Beta', |
| 75 | + 'Topic :: Internet', |
| 76 | + 'License :: OSI Approved :: BSD License', |
| 77 | + 'Intended Audience :: Developers', |
| 78 | + 'Environment :: Web Environment', |
| 79 | + 'Programming Language :: Python', |
| 80 | + 'Programming Language :: Python :: 2.6', |
| 81 | + 'Programming Language :: Python :: 2.7', |
| 82 | + 'Programming Language :: Python :: 3' |
| 83 | + ], |
| 84 | + tests_require=tests_requirements, |
| 85 | + test_suite='social.tests', |
| 86 | + zip_safe=False |
| 87 | +) |
0 commit comments