Skip to content
Myr

setup.py

This file

Path

setup.py

109 lines · 3.3 KiB · Python

Last changed by

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

History of this file

Take it

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

last attemptKenneth Reitzbefore adoptionc6973d3

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

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

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

last attemptKenneth Reitzbefore adoptionc6973d3

lines 3–11why, one step back
3import os
4import 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 #1 from requests/masterMaina Nickbefore adoption3a831be

lines 46–47why, one step back
46 'idna>=2.5,<2.8',
47 'urllib3>=1.21.1,<1.25',

Merge pull request #4067 from kennethreitz/depsKenneth Reitzbefore adoptiona6c3a0c

lines 48–50why, one step back
48 'certifi>=2017.4.17'
4950]

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

lines 51–58why, one step back
51test_requirements = [
52 'pytest-httpbin==0.0.7',53 'pytest-cov',54 'pytest-mock',55 'pytest-xdist',56 'PySocks>=1.5.6, !=1.5.7',57 'pytest>=2.8.0'58]

last attemptKenneth Reitzbefore adoptionc6973d3

line 59why, one step back
59

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

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

cleanup version.pyKenneth Reitzbefore adoptiona44284c

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

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

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

last attemptKenneth Reitzbefore adoptionc6973d3

line 63why, one step back
63

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 64why, one step back
64with open('README.md', 'r', 'utf-8') as f:

last attemptKenneth Reitzbefore adoptionc6973d3

line 65why, one step back
65 readme = f.read()

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 66why, one step back
66with open('HISTORY.md', 'r', 'utf-8') as f:

last attemptKenneth Reitzbefore adoptionc6973d3

lines 67–69why, one step back
67 history = f.read()
6869setup(

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

lines 70–72why, one step back
70 name=about['__title__'],
71 version=about['__version__'],72 description=about['__description__'],

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

lines 73–74why, one step back
73 long_description=readme,
74 long_description_content_type='text/markdown',

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

lines 75–77why, one step back
75 author=about['__author__'],
76 author_email=about['__author_email__'],77 url=about['__url__'],

last attemptKenneth Reitzbefore adoptionc6973d3

lines 78–81why, one step back
78 packages=packages,
79 package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},80 package_dir={'requests': 'requests'},81 include_package_data=True,

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 82why, one step back
82 python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",

last attemptKenneth Reitzbefore adoptionc6973d3

line 83why, one step back
83 install_requires=requires,

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

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

last attemptKenneth Reitzbefore adoptionc6973d3

line 85why, one step back
85 zip_safe=False,

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 86why, one step back
86 classifiers=[

last attemptKenneth Reitzbefore adoptionc6973d3

lines 87–91why, one step back
87 'Development Status :: 5 - Production/Stable',
88 'Intended Audience :: Developers',89 'Natural Language :: English',90 'License :: OSI Approved :: Apache Software License',91 'Programming Language :: Python',

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 92why, one step back
92 'Programming Language :: Python :: 2',

last attemptKenneth Reitzbefore adoptionc6973d3

lines 93–97why, one step back
93 'Programming Language :: Python :: 2.7',
94 'Programming Language :: Python :: 3',95 'Programming Language :: Python :: 3.4',96 'Programming Language :: Python :: 3.5',97 'Programming Language :: Python :: 3.6',

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 98why, one step back
98 'Programming Language :: Python :: 3.7',

last attemptKenneth Reitzbefore adoptionc6973d3

lines 99–100why, one step back
99 'Programming Language :: Python :: Implementation :: CPython',
100 'Programming Language :: Python :: Implementation :: PyPy'

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 101why, one step back
101 ],

last attemptKenneth Reitzbefore adoptionc6973d3

lines 102–104why, one step back
102 cmdclass={'test': PyTest},
103 tests_require=test_requirements,104 extras_require={

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 105why, one step back
105 'security': ['pyOpenSSL >= 0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],

last attemptKenneth Reitzbefore adoptionc6973d3

line 106why, one step back
106 'socks': ['PySocks>=1.5.6, !=1.5.7'],

Merge pull request #1 from requests/masterMaina Nickbefore adoption3a831be

line 107why, one step back
107 'socks:sys_platform == "win32" and python_version == "2.7"': ['win_inet_pton'],

last attemptKenneth Reitzbefore adoptionc6973d3

lines 108–109why, one step back
108 },
109)