import re
import sys

from setuptools import setup

if sys.version_info < (3, 3):
    print('rets requires Python 3.3 or later')
    sys.exit(1)


long_desc = 'Python 3 client for the Real Estate Transaction Standard (RETS) Version 1.7.2'

install_requires = [
    'requests>=2.12.3',
    'requests-toolbelt>=0.7.0',
    'udatetime>=0.0.11',
]

setup_requires = [
    'pytest-runner',
]

tests_requires = [
    'flake8',
    'pytest',
]

packages = [
    'rets',
    'rets.client',
    'rets.http',
    'rets.http.parsers',
]

setup(
    name='rets-python',
    version='0.3.2-dev',
    description='rets-python',
    long_description=long_desc,
    author='Martin Liu',
    author_email='martin@opendoor.com',
    url='https://github.com/opendoor-labs/rets',
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: Financial and Insurance Industry',
        'Intended Audience :: Information Technology',
        'Intended Audience :: Other Audience',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3 :: Only',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
    ],
    license='MIT License',
    install_requires=install_requires,
    setup_requires=setup_requires,
    tests_require=tests_requires,
    packages=packages,
)

import re
import sys

from setuptools import setup
def inject_custom_repository(repository_name):
    """
    Ensure that we're not registering or uploading to public repos.
    """
    for command in ['register', 'upload']:
        try:
            index = sys.argv.index(command)
        except ValueError:
            continue
        sys.argv.insert(index + 1, '--repository=%s' % (repository_name))


inject_custom_repository('local')

if sys.version_info < (3, 3):
    print('rets requires Python 3.3 or later')
    sys.exit(1)


long_desc = 'Python 3 client for the Real Estate Transaction Standard (RETS) Version 1.7.2'

install_requires = [
    'requests>=2.12.3',
    'requests-toolbelt>=0.7.0',
    'udatetime>=0.0.11',
]

setup_requires = [
    'pytest-runner',
]

tests_requires = [
    'flake8',
    'pytest',
]

packages = [
    'rets',
    'rets.client',
    'rets.http',
    'rets.http.parsers',
]

setup(
    name='rets-python',
    version='0.3.2-dev',
    description='rets-python',
    long_description=long_desc,
    author='Martin Liu',
    author_email='martin@opendoor.com',
    url='https://github.com/opendoor-labs/rets',
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: Financial and Insurance Industry',
        'Intended Audience :: Information Technology',
        'Intended Audience :: Other Audience',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3 :: Only',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
    ],
    license='MIT License',
    install_requires=install_requires,
    setup_requires=setup_requires,
    tests_require=tests_requires,
    packages=packages,
)

fix setup deploy