Skip to content
Myr

setup.py

This file

Path

setup.py

98 lines · 2.8 KiB · Python

Last changed by

cleanup setup.py from #2991Kenneth Reitzbefore adoption90688c6

History of this file

Take it

1#!/usr/bin/env python23import os4import platform5import re6import sys78from codecs import open910from setuptools import setup11from setuptools.command.test import test as TestCommand121314class 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 = []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)313233if sys.argv[-1] == 'publish':34    os.system('python setup.py sdist upload')35    sys.exit()3637packages = [38    'requests',39    'requests.packages',40    'requests.packages.chardet',41    'requests.packages.urllib3',42    'requests.packages.urllib3.packages',43    'requests.packages.urllib3.contrib',44    'requests.packages.urllib3.util',45    'requests.packages.urllib3.packages.ssl_match_hostname',46]4748requires = []49test_requirements = ['pytest>=2.8.0', 'pytest-httpbin==0.0.7', 'pytest-cov']5051with open('requests/__init__.py', 'r') as fd:52    version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',53                        fd.read(), re.MULTILINE).group(1)5455if not version:56    raise RuntimeError('Cannot find version information')5758with open('README.rst', 'r', 'utf-8') as f:59    readme = f.read()60with open('HISTORY.rst', 'r', 'utf-8') as f:61    history = f.read()6263setup(64    name='requests',65    version=version,66    description='Python HTTP for Humans.',67    long_description=readme + '\n\n' + history,68    author='Kenneth Reitz',69    author_email='me@kennethreitz.com',70    url='http://python-requests.org',71    packages=packages,72    package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},73    package_dir={'requests': 'requests'},74    include_package_data=True,75    install_requires=requires,76    license='Apache 2.0',77    zip_safe=False,78    classifiers=(79        'Development Status :: 5 - Production/Stable',80        'Intended Audience :: Developers',81        'Natural Language :: English',82        'License :: OSI Approved :: Apache Software License',83        'Programming Language :: Python',84        'Programming Language :: Python :: 2.6',85        'Programming Language :: Python :: 2.7',86        'Programming Language :: Python :: 3',87        'Programming Language :: Python :: 3.3',88        'Programming Language :: Python :: 3.4',89        'Programming Language :: Python :: 3.5',90        'Programming Language :: Python :: Implementation :: CPython',91        'Programming Language :: Python :: Implementation :: PyPy'92    ),93    cmdclass={'test': PyTest},94    tests_require=test_requirements,95    extras_require={96        'security': ['pyOpenSSL>=0.13', 'ndg-httpsclient', 'pyasn1'],97    },98)