Skip to content
Myr

setup.py

This file

Path

setup.py

101 lines · 3.1 KiB · Python

Last changed by

Catch error if multiprocessing is not available or is unable to determine the number of CPUsJacob Mansfieldbefore adoption98bbf8d

History of this file

Take it

The walk stopped after 200 commits: lines older than 5dcc039 point at it.

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 1–11why, one step back
1#!/usr/bin/env python
23import os4import re5import sys67from codecs import open89from setuptools import setup10from setuptools.command.test import test as TestCommand11

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

line 12why, one step back
12here = os.path.abspath(os.path.dirname(__file__))

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 13–18why, one step back
13
14class PyTest(TestCommand):15 user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]1617 def initialize_options(self):18 TestCommand.initialize_options(self)

Catch error if multiprocessing is not available or is unable to determine the number of CPUsJacob Mansfieldbefore adoption98bbf8d

lines 19–23why, one step back
19 try:
20 from multiprocessing import cpu_count21 self.pytest_args = ['-n', str(cpu_count()), '--boxed']22 except (ImportError, NotImplementedError):23 self.pytest_args = ['-n', '1', '--boxed']

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 24–35why, one step back
24
25 def finalize_options(self):26 TestCommand.finalize_options(self)27 self.test_args = []28 self.test_suite = True2930 def run_tests(self):31 import pytest3233 errno = pytest.main(self.pytest_args)34 sys.exit(errno)35

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

line 36why, one step back
36# 'setup.py publish' shortcut.

v2.12.5Cory Benfieldbefore adoption5dcc039

line 37why, one step back
37if sys.argv[-1] == 'publish':

fix setup.pyKenneth Reitzbefore adoption0aee483

lines 38–39why, one step back
38 os.system('python setup.py sdist bdist_wheel')
39 os.system('twine upload dist/*')

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 40–41why, one step back
40 sys.exit()
41

vastly simpify making packages available for backwards compatibilityKenneth Reitzbefore adoption28666e5

line 42why, one step back
42packages = ['requests']

v2.12.5Cory Benfieldbefore adoption5dcc039

line 43why, one step back
43

Merge pull request #4067 from kennethreitz/depsKenneth Reitzbefore adoptiona6c3a0c

lines 44–50why, one step back
44requires = [
45 'chardet>=3.0.2,<3.1.0',46 'idna>=2.5,<2.6',47 'urllib3>=1.21.1,<1.22',48 'certifi>=2017.4.17'4950]

Merge pull request #4083 from kennethreitz/faster-ciKenneth Reitzbefore adoption148ab30

line 51why, one step back
51test_requirements = ['pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock', 'pytest-xdist', 'PySocks>=1.5.6, !=1.5.7', 'pytest>=2.8.0']

v2.12.5Cory Benfieldbefore adoption5dcc039

line 52why, one step back
52

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

line 53why, one step back
53about = {}

cleanup version.pyKenneth Reitzbefore adoptiona44284c

line 54why, one step back
54with open(os.path.join(here, 'requests', '__version__.py'), 'r', 'utf-8') as f:

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

line 55why, one step back
55 exec(f.read(), about)

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 56–62why, one step back
56
57with open('README.rst', 'r', 'utf-8') as f:58 readme = f.read()59with open('HISTORY.rst', 'r', 'utf-8') as f:60 history = f.read()6162setup(

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

lines 63–65why, one step back
63 name=about['__title__'],
64 version=about['__version__'],65 description=about['__description__'],

v2.12.5Cory Benfieldbefore adoption5dcc039

line 66why, one step back
66 long_description=readme + '\n\n' + history,

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

lines 67–69why, one step back
67 author=about['__author__'],
68 author_email=about['__author_email__'],69 url=about['__url__'],

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 70–74why, one step back
70 packages=packages,
71 package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},72 package_dir={'requests': 'requests'},73 include_package_data=True,74 install_requires=requires,

Merge branch 'master' of github.com:kennethreitz/requestsKenneth Reitzbefore adoption733ff4b

line 75why, one step back
75 license=about['__license__'],

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 76–97why, one step back
76 zip_safe=False,
77 classifiers=(78 'Development Status :: 5 - Production/Stable',79 'Intended Audience :: Developers',80 'Natural Language :: English',81 'License :: OSI Approved :: Apache Software License',82 'Programming Language :: Python',83 'Programming Language :: Python :: 2.6',84 'Programming Language :: Python :: 2.7',85 'Programming Language :: Python :: 3',86 'Programming Language :: Python :: 3.3',87 'Programming Language :: Python :: 3.4',88 'Programming Language :: Python :: 3.5',89 'Programming Language :: Python :: 3.6',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.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],97 'socks': ['PySocks>=1.5.6, !=1.5.7'],

Merge pull request #4014 from Lukasa/even-more-compatCory Benfieldbefore adoption2e496c3

line 98why, one step back
98 'socks:sys_platform == "win32" and (python_version == "2.7" or python_version == "2.6")': ['win_inet_pton'],

v2.12.5Cory Benfieldbefore adoption5dcc039

lines 99–101why, one step back
99 },
100)101