Skip to content

Commit

Permalink
Generate packages names dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
omab committed Jan 16, 2014
1 parent f024172 commit 22b251c
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
"""Setup file for easy installation"""
import sys
from os.path import join, dirname
import os
from os.path import join, dirname, split
from setuptools import setup


Expand All @@ -28,13 +29,31 @@ def long_description():
return LONG_DESCRIPTION


def path_tokens(path):
if not path:
return []
head, tail = os.path.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


requires = ['requests>=1.1.0', 'oauthlib>=0.3.8', 'six>=1.2.0']
if PY3:
requires += ['python3-openid>=3.0.1',
'requests-oauthlib>=0.3.0,<0.3.2']
else:
requires += ['python-openid>=2.2', 'requests-oauthlib>=0.3.0']


setup(name='python-social-auth',
version=version,
author='Matias Aguirre',
Expand All @@ -43,20 +62,7 @@ def long_description():
license='BSD',
keywords='django, flask, pyramid, webpy, openid, oauth, social auth',
url='https://github.com/omab/python-social-auth',
packages=['social',
'social.storage',
'social.apps',
'social.apps.django_app',
'social.apps.django_app.default',
'social.apps.django_app.me',
'social.apps.webpy_app',
'social.apps.flask_app',
'social.backends',
'social.pipeline',
'social.strategies',
'social.tests.actions',
'social.tests.backends',
'social.tests'],
packages=get_packages(),
#package_data={'social': ['locale/*/LC_MESSAGES/*']},
long_description=long_description(),
install_requires=requires,
Expand Down

0 comments on commit 22b251c

Please sign in to comment.