Skip to content
Myr

setup.py

This file

Path

setup.py

72 lines · 2.0 KiB · Python

Last changed by

Stop falling back to distutils in setup.pyIan Cordascobefore adoption5f2fef5

History of this file

Take it

1#!/usr/bin/env python23import os4import re5import sys67from codecs import open89from setuptools import setup101112if sys.argv[-1] == 'publish':13    os.system('python setup.py sdist upload')14    sys.exit()1516packages = [17    'requests',18    'requests.packages',19    'requests.packages.chardet',20    'requests.packages.urllib3',21    'requests.packages.urllib3.packages',22    'requests.packages.urllib3.contrib',23    'requests.packages.urllib3.util',24    'requests.packages.urllib3.packages.ssl_match_hostname',25]2627requires = []2829version = ''30with open('requests/__init__.py', 'r') as fd:31    version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',32                        fd.read(), re.MULTILINE).group(1)3334if not version:35    raise RuntimeError('Cannot find version information')3637with open('README.rst', 'r', 'utf-8') as f:38    readme = f.read()39with open('HISTORY.rst', 'r', 'utf-8') as f:40    history = f.read()4142setup(43    name='requests',44    version=version,45    description='Python HTTP for Humans.',46    long_description=readme + '\n\n' + history,47    author='Kenneth Reitz',48    author_email='me@kennethreitz.com',49    url='http://python-requests.org',50    packages=packages,51    package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},52    package_dir={'requests': 'requests'},53    include_package_data=True,54    install_requires=requires,55    license='Apache 2.0',56    zip_safe=False,57    classifiers=(58        'Development Status :: 5 - Production/Stable',59        'Intended Audience :: Developers',60        'Natural Language :: English',61        'License :: OSI Approved :: Apache Software License',62        'Programming Language :: Python',63        'Programming Language :: Python :: 2.7',64        'Programming Language :: Python :: 3',65        'Programming Language :: Python :: 3.3',66        'Programming Language :: Python :: 3.4',67        'Programming Language :: Python :: 3.5',68    ),69    extras_require={70        'security': ['pyOpenSSL>=0.13', 'ndg-httpsclient', 'pyasn1'],71    },72)