Skip to content
Myr

Migrate build system to PEP 517 (#7012)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nate Prewitt · committed by GitHub · parent a389aaa · Browse files · 3 files+79 added−111 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+79 added−111 removed

  • other:+79 added−111 removed

3 files+79 added−111 removed

modified:pyproject.toml+75 added-1 removed
deleted:setup.cfg-10 removed
1[metadata]2license_file = LICENSE3provides-extra =4 socks5 use_chardet_on_py36requires-dist =7 certifi>=2017.4.178 charset_normalizer>=2,<49 idna>=2.5,<410 urllib3>=1.21.1,<3
modified:setup.py+4 added-100 removed
1#!/usr/bin/env python2import os1import sys4from codecs import open26from setuptools import setup78CURRENT_PYTHON = sys.version_info[:2]9REQUIRED_PYTHON = (3, 9)1011if CURRENT_PYTHON < REQUIRED_PYTHON:12 sys.stderr.write(13 """14==========================15Unsupported Python version16==========================17This version of Requests requires at least Python {}.{}, but18you're trying to install it on Python {}.{}. To resolve this,19consider upgrading to a supported Python version.2021If you can't upgrade your Python version, you'll need to22pin to an older version of Requests (<2.32.0).23""".format(*(REQUIRED_PYTHON + CURRENT_PYTHON))24 )3if sys.version_info < (3, 9):4 sys.stderr.write("Requests requires Python 3.9 or later.\n")5 sys.exit(1)67from setuptools import setup828# 'setup.py publish' shortcut.29if sys.argv[-1] == "publish":30 os.system("python setup.py sdist bdist_wheel")31 os.system("twine upload dist/*")32 sys.exit()3334requires = [35 "charset_normalizer>=2,<4",36 "idna>=2.5,<4",37 "urllib3>=1.21.1,<3",38 "certifi>=2017.4.17",39]40test_requirements = [41 "pytest-httpbin==2.1.0",42 "pytest-cov",43 "pytest-mock",44 "pytest-xdist",45 "PySocks>=1.5.6, !=1.5.7",46 "pytest>=3",47]4849about = {}50here = os.path.abspath(os.path.dirname(__file__))51with open(os.path.join(here, "src", "requests", "__version__.py"), "r", "utf-8") as f:52 exec(f.read(), about)5354with open("README.md", "r", "utf-8") as f:55 readme = f.read()5657setup(9setup()58 name=about["__title__"],59 version=about["__version__"],60 description=about["__description__"],61 long_description=readme,62 long_description_content_type="text/markdown",63 author=about["__author__"],64 author_email=about["__author_email__"],65 url=about["__url__"],66 packages=["requests"],67 package_data={"": ["LICENSE", "NOTICE"]},68 package_dir={"": "src"},69 include_package_data=True,70 python_requires=">=3.9",71 install_requires=requires,72 license=about["__license__"],73 zip_safe=False,74 classifiers=[75 "Development Status :: 5 - Production/Stable",76 "Environment :: Web Environment",77 "Intended Audience :: Developers",78 "License :: OSI Approved :: Apache Software License",79 "Natural Language :: English",80 "Operating System :: OS Independent",81 "Programming Language :: Python",82 "Programming Language :: Python :: 3",83 "Programming Language :: Python :: 3.9",84 "Programming Language :: Python :: 3.10",85 "Programming Language :: Python :: 3.11",86 "Programming Language :: Python :: 3.12",87 "Programming Language :: Python :: 3.13",88 "Programming Language :: Python :: 3.14",89 "Programming Language :: Python :: 3 :: Only",90 "Programming Language :: Python :: Implementation :: CPython",91 "Programming Language :: Python :: Implementation :: PyPy",92 "Topic :: Internet :: WWW/HTTP",93 "Topic :: Software Development :: Libraries",94 ],95 tests_require=test_requirements,96 extras_require={97 "security": [],98 "socks": ["PySocks>=1.5.6, !=1.5.7"],99 "use_chardet_on_py3": ["chardet>=3.0.2,<6"],100 },101 project_urls={102 "Documentation": "https://requests.readthedocs.io",103 "Source": "https://github.com/psf/requests",104 },105)