Skip to content
Myr

setup.py

This file

Path

setup.py

101 lines · 3.1 KiB · Python

Last changed by

Update setup.pyKenneth Reitzbefore adoption96b9a3f

History of this file

Take it

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

hhg2pKenneth Reitzbefore adoptione7b7574

line 1why, one step back
1#!/usr/bin/env python

Update setup.pyKenneth Reitzbefore adoption96b9a3f

line 2why, one step back
2# Learn more: https://github.com/kennethreitz/setup.py

hhg2pKenneth Reitzbefore adoptione7b7574

lines 3–12why, one step back
3
4import os5import re6import sys78from codecs import open910from setuptools import setup11from setuptools.command.test import test as TestCommand12

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

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

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

lines 25–36why, one step back
25
26 def finalize_options(self):27 TestCommand.finalize_options(self)28 self.test_args = []29 self.test_suite = True3031 def run_tests(self):32 import pytest3334 errno = pytest.main(self.pytest_args)35 sys.exit(errno)36

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

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

fix setup.pyKenneth Reitzbefore adoption0aee483

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

hhg2pKenneth Reitzbefore adoptione7b7574

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

vastly simpify making packages available for backwards compatibilityKenneth Reitzbefore adoption28666e5

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

hhg2pKenneth Reitzbefore adoptione7b7574

line 44why, one step back
44

Merge pull request #4067 from kennethreitz/depsKenneth Reitzbefore adoptiona6c3a0c

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

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

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

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

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

Merge pull request #4067 from kennethreitz/depsKenneth Reitzbefore adoptiona6c3a0c

lines 49–51why, one step back
49 'certifi>=2017.4.17'
5051]

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

line 53why, one step back
53

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

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

cleanup version.pyKenneth Reitzbefore adoptiona44284c

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

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

lines 57–63why, one step back
57
58with 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(

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

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

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

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

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

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

hhg2pKenneth Reitzbefore adoptione7b7574

lines 77–97why, one step back
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.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'],

hhg2pKenneth Reitzbefore adoptione7b7574

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