Skip to content
Myr

setup.py

This file

Path

setup.py

81 lines · 2.5 KiB · Python

Last changed by

Merge pull request #572 from slingamn/chardet_2Kenneth Reitzbefore adoptiona3e5563

History of this file

Take it

1#!/usr/bin/env python23"""4distutils/setuptools install script. See inline comments for packaging documentation.5"""67import os8import sys910import requests11from requests.compat import is_py31213try:14    from setuptools import setup15except ImportError:16    from distutils.core import setup1718if sys.argv[-1] == 'publish':19    os.system('python setup.py sdist upload')20    sys.exit()2122packages = [23    'requests',24    'requests.packages',25    'requests.packages.urllib3',26    'requests.packages.urllib3.packages',27    'requests.packages.urllib3.packages.ssl_match_hostname',28    'requests.packages.urllib3.packages.mimetools_choose_boundary',29]3031# certifi is a Python package containing a CA certificate bundle for SSL verification.32# On certain supported platforms (e.g., Red Hat / Debian / FreeBSD), Requests can33# use the system CA bundle instead; see `requests.utils` for details.34# If your platform is supported, set `requires` to [] instead:35requires = ['certifi>=0.0.7']3637# chardet is used to optimally guess the encodings of pages that don't declare one.38# At this time, chardet is not a required dependency. However, it's sufficiently39# important that pip/setuptools should install it when it's unavailable.40if is_py3:41    chardet_package = 'chardet2'42else:43    chardet_package = 'chardet>=1.0.0'44    requires.append('oauthlib>=0.1.0,<0.2.0')4546requires.append(chardet_package)4748# The async API in requests.async requires the gevent package.49# This is also not a required dependency.50extras_require = {51        'async': ['gevent'],52}5354setup(55    name='requests',56    version=requests.__version__,57    description='Python HTTP for Humans.',58    long_description=open('README.rst').read() + '\n\n' +59                     open('HISTORY.rst').read(),60    author='Kenneth Reitz',61    author_email='me@kennethreitz.com',62    url='http://python-requests.org',63    packages=packages,64    package_data={'': ['LICENSE', 'NOTICE']},65    include_package_data=True,66    install_requires=requires,67    extras_require=extras_require,68    license=open("LICENSE").read(),69    classifiers=(70        'Development Status :: 5 - Production/Stable',71        'Intended Audience :: Developers',72        'Natural Language :: English',73        'License :: OSI Approved :: ISC License (ISCL)',74        'Programming Language :: Python',75        'Programming Language :: Python :: 2.6',76        'Programming Language :: Python :: 2.7',77        'Programming Language :: Python :: 3',78        'Programming Language :: Python :: 3.0',79        'Programming Language :: Python :: 3.1',80    ),81)