Skip to content

Commit fe76417

Browse files
committed
Fix wheel support. Refs omab#588
1 parent 50aafbf commit fe76417

File tree

3 files changed

+52
-38
lines changed

3 files changed

+52
-38
lines changed

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@ docs:
44
site: docs
55
rsync -avkz site/ tarf:sites/psa/
66

7-
publish:
8-
python setup.py sdist bdist_wheel
9-
twine upload dist/*
7+
build:
8+
python setup.py sdist
9+
python setup.py bdist_wheel --python-tag py2
10+
BUILD_VERSION=3 python setup.py bdist_wheel --python-tag py3
11+
12+
publish: build
13+
python setup.py upload
14+
15+
clean:
16+
find . -name '*.py[co]' -delete
17+
find . -name '__pycache__' -delete
18+
rm -rf python_social_auth.egg-info dist build
1019

1120
.PHONY: site docs publish

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ with-coverage=1
99
cover-erase=1
1010
cover-package=social
1111
rednose=1
12-
13-
[wheel]
14-
universal = 1

setup.py

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from setuptools import setup
77

88

9-
PY3 = sys.version_info[0] == 3
9+
PY3 = os.environ.get('BUILD_VERSION') == '3' or sys.version_info[0] == 3
1010

1111
version = __import__('social').__version__
1212

@@ -46,34 +46,42 @@ def get_packages():
4646
return packages
4747

4848

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-
author_email='[email protected]',
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+
author_email='[email protected]',
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

Comments
 (0)