Skip to content
Myr

Change setup.py to reflect required/optional dependencies

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Shivaram Lingamneni · committed by Shivaram Lingamneni · parent d232948 · Browse files · 1 file+26 added−15 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+26 added−15 removed

  • other:+26 added−15 removed

1 file+26 added−15 removed

modified:setup.py+26 added-15 removed
1#!/usr/bin/env python2# -*- coding: utf-8 -*-24import os3"""4distutils/setuptools install script. See inline comments for packaging documentation.5"""67import sys89import requests7from requests.compat import is_py3, is_py210from requests.compat import is_py31112try:13 from setuptools import setup14except ImportError:15 from distutils.core import setup16141517if sys.argv[-1] == 'publish':18 os.system('python setup.py sdist upload')19 sys.exit()2020if sys.argv[-1] == 'test':21 os.system('python tests/test_requests.py')22 sys.exit()2324required = ['certifi>=0.0.7']21packages = [22 'requests',23 'requests.packages',24 'requests.packages.urllib3',
1 unmodified line
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:35 required.append('chardet2')40 chardet_package = 'chardet2'41else:37 required.append('chardet>=1.0.0')38 required.append('oauthlib')39 packages.append('requests.packages.oreos')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.',
4 unmodified lines
59 url='http://python-requests.org',60 packages=packages,61 package_data={'': ['LICENSE', 'NOTICE']},62 include_package_data=True,53 install_requires=required,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',
10 unmodified lines