Skip to content
Myr

setup.py

This file

Path

setup.py

133 lines · 3.9 KiB · Python

Last changed by

Move to src directory (#6506)Nate Prewittbefore adoptiond63e94f

History of this file

Take it

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

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 1–8why, one step back
1#!/usr/bin/env python
2import os3import sys4from codecs import open56from setuptools import setup7from setuptools.command.test import test as TestCommand8

Farewell, sweet Concorde!Nate Prewittbefore adoption8bce583

lines 9–29why, one step back
9CURRENT_PYTHON = sys.version_info[:2]
10REQUIRED_PYTHON = (3, 7)1112if CURRENT_PYTHON < REQUIRED_PYTHON:13 sys.stderr.write(14 """15==========================16Unsupported Python version17==========================18This version of Requests requires at least Python {}.{}, but19you're trying to install it on Python {}.{}. To resolve this,20consider upgrading to a supported Python version.2122If you can't upgrade your Python version, you'll need to23pin to an older version of Requests (<2.28).24""".format(25 *(REQUIRED_PYTHON + CURRENT_PYTHON)26 )27 )28 sys.exit(1)29

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 30why, one step back
30

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

line 31why, one step back
31class PyTest(TestCommand):

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 32why, one step back
32 user_options = [("pytest-args=", "a", "Arguments to pass into py.test")]

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 33–37why, one step back
33
34 def initialize_options(self):35 TestCommand.initialize_options(self)36 try:37 from multiprocessing import cpu_count

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 38–39why, one step back
38
39 self.pytest_args = ["-n", str(cpu_count()), "--boxed"]

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

line 40why, one step back
40 except (ImportError, NotImplementedError):

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 41why, one step back
41 self.pytest_args = ["-n", "1", "--boxed"]

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 42–53why, one step back
42
43 def finalize_options(self):44 TestCommand.finalize_options(self)45 self.test_args = []46 self.test_suite = True4748 def run_tests(self):49 import pytest5051 errno = pytest.main(self.pytest_args)52 sys.exit(errno)53

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 54why, one step back
54

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

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

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 56–58why, one step back
56if sys.argv[-1] == "publish":
57 os.system("python setup.py sdist bdist_wheel")58 os.system("twine upload dist/*")

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 59–61why, one step back
59 sys.exit()
6061requires = [

Allow charset normalizer >=2 and <4 (#6261)deedy5before adoptionc57f1f0

line 62why, one step back
62 "charset_normalizer>=2,<4",

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 63why, one step back
63 "idna>=2.5,<4",

v2.30.0Nate Prewittbefore adoption2ad18e0

line 64why, one step back
64 "urllib3>=1.21.1,<3",

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 65why, one step back
65 "certifi>=2017.4.17",

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 66–67why, one step back
66]
67test_requirements = [

test on py3.12 (#6448)Thomas Graingerbefore adoptionb639e66

line 68why, one step back
68 "pytest-httpbin==2.0.0",

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 69–73why, one step back
69 "pytest-cov",
70 "pytest-mock",71 "pytest-xdist",72 "PySocks>=1.5.6, !=1.5.7",73 "pytest>=3",

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 74–76why, one step back
74]
7576about = {}

Farewell, sweet Concorde!Nate Prewittbefore adoption8bce583

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

Move to src directory (#6506)Nate Prewittbefore adoptiond63e94f

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

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 79–80why, one step back
79 exec(f.read(), about)
80

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

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

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 82–84why, one step back
82 readme = f.read()
8384setup(

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 85–87why, one step back
85 name=about["__title__"],
86 version=about["__version__"],87 description=about["__description__"],

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

line 88why, one step back
88 long_description=readme,

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 89–94why, one step back
89 long_description_content_type="text/markdown",
90 author=about["__author__"],91 author_email=about["__author_email__"],92 url=about["__url__"],93 packages=["requests"],94 package_data={"": ["LICENSE", "NOTICE"]},

Move to src directory (#6506)Nate Prewittbefore adoptiond63e94f

line 95why, one step back
95 package_dir={"": "src"},

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

line 96why, one step back
96 include_package_data=True,

fix: Remove '<4' from python_requires (#6333)Matthew Feickertbefore adoption16a17a3

line 97why, one step back
97 python_requires=">=3.7",

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

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

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 99why, one step back
99 license=about["__license__"],

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 100–101why, one step back
100 zip_safe=False,
101 classifiers=[

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 102–114why, one step back
102 "Development Status :: 5 - Production/Stable",
103 "Environment :: Web Environment",104 "Intended Audience :: Developers",105 "License :: OSI Approved :: Apache Software License",106 "Natural Language :: English",107 "Operating System :: OS Independent",108 "Programming Language :: Python",109 "Programming Language :: Python :: 3",110 "Programming Language :: Python :: 3.7",111 "Programming Language :: Python :: 3.8",112 "Programming Language :: Python :: 3.9",113 "Programming Language :: Python :: 3.10",114 "Programming Language :: Python :: 3.11",

Add 3.12 classifier and tox configuration (#6503)Nate Prewittbefore adoptione9fa2e2

line 115why, one step back
115 "Programming Language :: Python :: 3.12",

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 116–120why, one step back
116 "Programming Language :: Python :: 3 :: Only",
117 "Programming Language :: Python :: Implementation :: CPython",118 "Programming Language :: Python :: Implementation :: PyPy",119 "Topic :: Internet :: WWW/HTTP",120 "Topic :: Software Development :: Libraries",

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

line 121why, one step back
121 ],

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

line 122why, one step back
122 cmdclass={"test": PyTest},

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 123–124why, one step back
123 tests_require=test_requirements,
124 extras_require={

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 125–126why, one step back
125 "security": [],
126 "socks": ["PySocks>=1.5.6, !=1.5.7"],

Update Dependency with `chardet>=3.0.2,<6` (#6179)Wong Hoi Sing Edisonbefore adoption73793ce

line 127why, one step back
127 "use_chardet_on_py3": ["chardet>=3.0.2,<6"],

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 128–129why, one step back
128 },
129 project_urls={

Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290

lines 130–131why, one step back
130 "Documentation": "https://requests.readthedocs.io",
131 "Source": "https://github.com/psf/requests",

Merge pull request #5250 from MasterOdin/patch-1Nate Prewittbefore adoptioneedd674

lines 132–133why, one step back
132 },
133)