1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import os
5import sys
6import re
7
8try:
9    from setuptools import setup
10except ImportError:
11    from distutils.core import setup
12
13# Get the version
14version_regex = r'__version__ = ["\']([^"\']*)["\']'
15with open('requests_oauthlib/__init__.py', 'r') as f:
16    text = f.read()
17    match = re.search(version_regex, text)
18
19    if match:
20        VERSION = match.group(1)
21    else:
22        raise RuntimeError("No version number found!")
23
24
25APP_NAME = 'requests-oauthlib'
26
27settings = dict()
28
29
30# Publish Helper.
31if sys.argv[-1] == 'publish':
32    os.system('python setup.py sdist upload')
33    sys.exit()
34
35tests_require = ['mock', 'requests-mock']
36if sys.version_info < (2, 7): # Python 2.6 or lower
37    tests_require.append('unittest2')
38
39
40settings.update(
41    name=APP_NAME,
42    version=VERSION,
43    description='OAuthlib authentication support for Requests.',
44    long_description=open('README.rst').read() + '\n\n' +
45                     open('HISTORY.rst').read(),
46    author='Kenneth Reitz',
47    author_email='me@kennethreitz.com',
48    url='https://github.com/requests/requests-oauthlib',
49    packages=['requests_oauthlib', 'requests_oauthlib.compliance_fixes'],
50    install_requires=['oauthlib>=0.6.2', 'requests>=2.0.0'],
51    extras_require={'rsa': ['oauthlib[rsa]>=0.6.2', 'requests>=2.0.0']},
52    license='ISC',
53    classifiers=(
54        'Development Status :: 5 - Production/Stable',
55        'Intended Audience :: Developers',
56        'Natural Language :: English',
57        'License :: OSI Approved :: BSD License',
58        'Programming Language :: Python',
59        'Programming Language :: Python :: 2.6',
60        'Programming Language :: Python :: 2.7',
61        'Programming Language :: Python :: 3',
62        'Programming Language :: Python :: 3.3',
63        'Programming Language :: Python :: 3.4',
64    ),
65    zip_safe=False,
66    tests_require=tests_require,
67    test_suite='tests'
68)
69
70setup(**settings)
71