setup.py
This file
Path
setup.py
78 lines · 2.4 KiB · Python
Last changed by
Change setup.py to reflect required/optional dependenciesShivaram Lingamnenibefore adoptionbdd7f8f
History of this fileTake it
1#!/usr/bin/env python23"""4distutils/setuptools install script. See inline comments for packaging documentation.5"""67import sys89import requests10from requests.compat import is_py31112try:13 from setuptools import setup14except ImportError:15 from distutils.core import setup1617if sys.argv[-1] == 'publish':18 os.system('python setup.py sdist upload')19 sys.exit()2021packages = [22 'requests',23 'requests.packages',24 'requests.packages.urllib3',25 'requests.packages.urllib3.packages',26 'requests.packages.urllib3.packages.ssl_match_hostname',27 'requests.packages.urllib3.packages.mimetools_choose_boundary',28]2930# certifi is a Python package containing a CA certificate bundle for SSL verification.31# On certain supported platforms (e.g., Red Hat / Debian / FreeBSD), Requests can32# use the system CA bundle instead; see `requests.utils` for details.33# If your platform is supported, set `requires` to [] instead:34requires = ['certifi>=0.0.7']3536# chardet is used to optimally guess the encodings of pages that don't declare one.37# At this time, chardet is not a required dependency. However, it's sufficiently38# important that pip/setuptools should install it when it's unavailable.39if is_py3:40 chardet_package = 'chardet2'41else:42 chardet_package = 'chardet>=1.0.0'43requires.append(chardet_package)4445# The async API in requests.async requires the gevent package.46# This is also not a required dependency.47extras_require = {48 'async': ['gevent'],49}5051setup(52 name='requests',53 version=requests.__version__,54 description='Python HTTP for Humans.',55 long_description=open('README.rst').read() + '\n\n' +56 open('HISTORY.rst').read(),57 author='Kenneth Reitz',58 author_email='me@kennethreitz.com',59 url='http://python-requests.org',60 packages=packages,61 package_data={'': ['LICENSE', 'NOTICE']},62 include_package_data=True,63 install_requires=requires,64 extras_require=extras_require,65 license=open("LICENSE").read(),66 classifiers=(67 'Development Status :: 5 - Production/Stable',68 'Intended Audience :: Developers',69 'Natural Language :: English',70 'License :: OSI Approved :: ISC License (ISCL)',71 'Programming Language :: Python',72 'Programming Language :: Python :: 2.6',73 'Programming Language :: Python :: 2.7',74 'Programming Language :: Python :: 3',75 'Programming Language :: Python :: 3.0',76 'Programming Language :: Python :: 3.1',77 ),78)