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 fileTake it
The walk stopped after 200 commits: lines older than a990653 point at it.
Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 1–8why, one step back1#!/usr/bin/env python2import os3import sys4from codecs import open56from setuptools import setup7from setuptools.command.test import test as TestCommand8Farewell, sweet Concorde!Nate Prewittbefore adoption8bce583
lines 9–29why, one step back9CURRENT_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)29Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 30why, one step back30Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 31why, one step back31class PyTest(TestCommand):Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 32why, one step back32 user_options = [("pytest-args=", "a", "Arguments to pass into py.test")]Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 33–37why, one step back3334 def initialize_options(self):35 TestCommand.initialize_options(self)36 try:37 from multiprocessing import cpu_countAdd automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 38–39why, one step back3839 self.pytest_args = ["-n", str(cpu_count()), "--boxed"]Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 40why, one step back40 except (ImportError, NotImplementedError):Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 41why, one step back41 self.pytest_args = ["-n", "1", "--boxed"]Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 42–53why, one step back4243 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)53Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 54why, one step back54Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 55why, one step back55# 'setup.py publish' shortcut.Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 56–58why, one step back56if sys.argv[-1] == "publish":57 os.system("python setup.py sdist bdist_wheel")58 os.system("twine upload dist/*")Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 59–61why, one step back59 sys.exit()6061requires = [Allow charset normalizer >=2 and <4 (#6261)deedy5before adoptionc57f1f0
line 62why, one step back62 "charset_normalizer>=2,<4",Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 63why, one step back63 "idna>=2.5,<4",v2.30.0Nate Prewittbefore adoption2ad18e0
line 64why, one step back64 "urllib3>=1.21.1,<3",Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 65why, one step back65 "certifi>=2017.4.17",Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 66–67why, one step back66]67test_requirements = [test on py3.12 (#6448)Thomas Graingerbefore adoptionb639e66
line 68why, one step back68 "pytest-httpbin==2.0.0",Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 69–73why, one step back69 "pytest-cov",70 "pytest-mock",71 "pytest-xdist",72 "PySocks>=1.5.6, !=1.5.7",73 "pytest>=3",Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 74–76why, one step back74]7576about = {}Farewell, sweet Concorde!Nate Prewittbefore adoption8bce583
line 77why, one step back77here = os.path.abspath(os.path.dirname(__file__))Move to src directory (#6506)Nate Prewittbefore adoptiond63e94f
line 78why, one step back78with open(os.path.join(here, "src", "requests", "__version__.py"), "r", "utf-8") as f:Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 79–80why, one step back79 exec(f.read(), about)80Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 81why, one step back81with open("README.md", "r", "utf-8") as f:Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 82–84why, one step back82 readme = f.read()8384setup(Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 85–87why, one step back85 name=about["__title__"],86 version=about["__version__"],87 description=about["__description__"],Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 88why, one step back88 long_description=readme,Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 89–94why, one step back89 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 back95 package_dir={"": "src"},Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 96why, one step back96 include_package_data=True,fix: Remove '<4' from python_requires (#6333)Matthew Feickertbefore adoption16a17a3
line 97why, one step back97 python_requires=">=3.7",Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 98why, one step back98 install_requires=requires,Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 99why, one step back99 license=about["__license__"],Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 100–101why, one step back100 zip_safe=False,101 classifiers=[Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 102–114why, one step back102 "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 back115 "Programming Language :: Python :: 3.12",Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 116–120why, one step back116 "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 #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
line 121why, one step back121 ],Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
line 122why, one step back122 cmdclass={"test": PyTest},Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 123–124why, one step back123 tests_require=test_requirements,124 extras_require={Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 125–126why, one step back125 "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 back127 "use_chardet_on_py3": ["chardet>=3.0.2,<6"],Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 128–129why, one step back128 },129 project_urls={Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 130–131why, one step back130 "Documentation": "https://requests.readthedocs.io",131 "Source": "https://github.com/psf/requests",Merge pull request #5326 from nawatts/intersphinx-mapping-configNate Prewittbefore adoptiona990653
lines 132–133why, one step back132 },133)