setup.py
This file
Path
setup.py
97 lines · 2.9 KiB · Python
Last changed by
Merge pull request #4083 from kennethreitz/faster-ciKenneth Reitzbefore adoption148ab30
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 TestCommand1112here = os.path.abspath(os.path.dirname(__file__))1314class PyTest(TestCommand):15 user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]1617 def initialize_options(self):18 TestCommand.initialize_options(self)19 self.pytest_args = ['-n', '8', '--boxed']2021 def finalize_options(self):22 TestCommand.finalize_options(self)23 self.test_args = []24 self.test_suite = True2526 def run_tests(self):27 import pytest2829 errno = pytest.main(self.pytest_args)30 sys.exit(errno)3132# 'setup.py publish' shortcut.33if sys.argv[-1] == 'publish':34 os.system('python setup.py sdist bdist_wheel')35 os.system('twine upload dist/*')36 sys.exit()3738packages = ['requests']3940requires = [41 'chardet>=3.0.2,<3.1.0',42 'idna>=2.5,<2.6',43 'urllib3>=1.21.1,<1.22',44 'certifi>=2017.4.17'4546]47test_requirements = ['pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock', 'pytest-xdist', 'PySocks>=1.5.6, !=1.5.7', 'pytest>=2.8.0']4849about = {}50with open(os.path.join(here, 'requests', '__version__.py'), 'r', 'utf-8') as f:51 exec(f.read(), about)5253with open('README.rst', 'r', 'utf-8') as f:54 readme = f.read()55with open('HISTORY.rst', 'r', 'utf-8') as f:56 history = f.read()5758setup(59 name=about['__title__'],60 version=about['__version__'],61 description=about['__description__'],62 long_description=readme + '\n\n' + history,63 author=about['__author__'],64 author_email=about['__author_email__'],65 url=about['__url__'],66 packages=packages,67 package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},68 package_dir={'requests': 'requests'},69 include_package_data=True,70 install_requires=requires,71 license=about['__license__'],72 zip_safe=False,73 classifiers=(74 'Development Status :: 5 - Production/Stable',75 'Intended Audience :: Developers',76 'Natural Language :: English',77 'License :: OSI Approved :: Apache Software License',78 'Programming Language :: Python',79 'Programming Language :: Python :: 2.6',80 'Programming Language :: Python :: 2.7',81 'Programming Language :: Python :: 3',82 'Programming Language :: Python :: 3.3',83 'Programming Language :: Python :: 3.4',84 'Programming Language :: Python :: 3.5',85 'Programming Language :: Python :: 3.6',86 'Programming Language :: Python :: Implementation :: CPython',87 'Programming Language :: Python :: Implementation :: PyPy'88 ),89 cmdclass={'test': PyTest},90 tests_require=test_requirements,91 extras_require={92 'security': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],93 'socks': ['PySocks>=1.5.6, !=1.5.7'],94 'socks:sys_platform == "win32" and (python_version == "2.7" or python_version == "2.6")': ['win_inet_pton'],95 },96)97