Skip to content
Myr

setup.py

This file

Path

setup.py

100 lines · 3.1 KiB · Python

Last changed by

Drop Python 3.3 supportCory Benfieldbefore adoption0a2dc74

History of this file

Take it

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

last attemptKenneth Reitzbefore adoptionc6973d3

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__))

last attemptKenneth Reitzbefore adoptionc6973d3

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)

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

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']

last attemptKenneth Reitzbefore adoptionc6973d3

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.

last attemptKenneth Reitzbefore adoptionc6973d3

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/*')

last attemptKenneth Reitzbefore adoptionc6973d3

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']

last attemptKenneth Reitzbefore adoptionc6973d3

line 43why, one step back
43

Merge pull request #4067 from kennethreitz/depsKenneth Reitzbefore adoptiona6c3a0c

lines 44–45why, one step back
44requires = [
45 'chardet>=3.0.2,<3.1.0',

Merge pull request #4223 from Lukasa/widen-idna-pinCory Benfieldbefore adoption9ec2005

line 46why, one step back
46 'idna>=2.5,<2.7',

Merge pull request #4196 from Lukasa/require-next-urllib3Ian Stapleton Cordascobefore adoptionc10b838

line 47why, one step back
47 'urllib3>=1.21.1,<1.23',

Merge pull request #4067 from kennethreitz/depsKenneth Reitzbefore adoptiona6c3a0c

lines 48–50why, one step back
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']

last attemptKenneth Reitzbefore adoptionc6973d3

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)

last attemptKenneth Reitzbefore adoptionc6973d3

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__'],

last attemptKenneth Reitzbefore adoptionc6973d3

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__'],

last attemptKenneth Reitzbefore adoptionc6973d3

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__'],

last attemptKenneth Reitzbefore adoptionc6973d3

lines 76–96why, 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.4',87 'Programming Language :: Python :: 3.5',88 'Programming Language :: Python :: 3.6',89 'Programming Language :: Python :: Implementation :: CPython',90 'Programming Language :: Python :: Implementation :: PyPy'91 ),92 cmdclass={'test': PyTest},93 tests_require=test_requirements,94 extras_require={95 'security': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],96 'socks': ['PySocks>=1.5.6, !=1.5.7'],

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

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

last attemptKenneth Reitzbefore adoptionc6973d3

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