setup.py
This file
Path
setup.py
105 lines · 3.2 KiB · Python
Last changed by
Merge pull request #4007 from Lukasa/use-more-comaptible-markerCory Benfieldbefore adoption636082f
History of this fileTake it
1#!/usr/bin/env python23import os4import re5import sys67from codecs import open89from setuptools import setup10from setuptools.command.test import test as TestCommand111213class PyTest(TestCommand):14 user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]1516 def initialize_options(self):17 TestCommand.initialize_options(self)18 self.pytest_args = []1920 def finalize_options(self):21 TestCommand.finalize_options(self)22 self.test_args = []23 self.test_suite = True2425 def run_tests(self):26 import pytest2728 errno = pytest.main(self.pytest_args)29 sys.exit(errno)303132if sys.argv[-1] == 'publish':33 os.system('python setup.py sdist upload')34 sys.exit()3536packages = [37 'requests',38 'requests.packages',39 'requests.packages.chardet',40 'requests.packages.chardet.cli',41 'requests.packages.idna',42 'requests.packages.urllib3',43 'requests.packages.urllib3.packages',44 'requests.packages.urllib3.contrib',45 'requests.packages.urllib3.util',46 'requests.packages.urllib3.packages.ssl_match_hostname',47 'requests.packages.urllib3.packages.backports',48 'requests.packages.urllib3.contrib._securetransport',49]5051requires = []52test_requirements = ['pytest>=2.8.0', 'pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock']5354with open('requests/__init__.py', 'r') as fd:55 version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',56 fd.read(), re.MULTILINE).group(1)5758if not version:59 raise RuntimeError('Cannot find version information')6061with open('README.rst', 'r', 'utf-8') as f:62 readme = f.read()63with open('HISTORY.rst', 'r', 'utf-8') as f:64 history = f.read()6566setup(67 name='requests',68 version=version,69 description='Python HTTP for Humans.',70 long_description=readme + '\n\n' + history,71 author='Kenneth Reitz',72 author_email='me@kennethreitz.com',73 url='http://python-requests.org',74 packages=packages,75 package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},76 package_dir={'requests': 'requests'},77 include_package_data=True,78 install_requires=requires,79 license='Apache 2.0',80 zip_safe=False,81 classifiers=(82 'Development Status :: 5 - Production/Stable',83 'Intended Audience :: Developers',84 'Natural Language :: English',85 'License :: OSI Approved :: Apache Software License',86 'Programming Language :: Python',87 'Programming Language :: Python :: 2.6',88 'Programming Language :: Python :: 2.7',89 'Programming Language :: Python :: 3',90 'Programming Language :: Python :: 3.3',91 'Programming Language :: Python :: 3.4',92 'Programming Language :: Python :: 3.5',93 'Programming Language :: Python :: 3.6',94 'Programming Language :: Python :: Implementation :: CPython',95 'Programming Language :: Python :: Implementation :: PyPy'96 ),97 cmdclass={'test': PyTest},98 tests_require=test_requirements,99 extras_require={100 'security': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],101 'socks': ['PySocks>=1.5.6, !=1.5.7'],102 'socks:sys_platform == "win32" and python_version<"3.3"': ['win_inet_pton'],103 },104)105