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
Provenance
- Commit
cb2c800- Tree
82e5a37- Author
Nate Prewitt <nate.prewitt@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
a389aaa
3 files changed+79 added−111 removed
modified:pyproject.toml+75 added-1 removed
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576776 unmodified lines848586878815899091929311 unmodified lines[build-system]requires = ["setuptools>=61.0"]build-backend = "setuptools.build_meta"
[project]name = "requests"description = "Python HTTP for Humans."readme = "README.md"license = {text = "Apache-2.0"}authors = [ { name = "Kenneth Reitz", email = "me@kennethreitz.org" },]maintainers = [ {name = "Ian Stapleton Cordasco", email="graffatcolmingov@gmail.com"}, {name = "Nate Prewitt", email="nate.prewitt@gmail.com"}]requires-python = ">=3.9"dependencies = [ "charset_normalizer>=2,<4", "idna>=2.5,<4", "urllib3>=1.21.1,<3", "certifi>=2017.4.17"]dynamic = ["version"]
classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries"]
[project.urls]Documentation = "https://requests.readthedocs.io"Source = "https://github.com/psf/requests"
[project.optional-dependencies]security = []socks = ["PySocks>=1.5.6, !=1.5.7"]use_chardet_on_py3 = ["chardet>=3.0.2,<6"]test = [ "pytest-httpbin==2.1.0", "pytest-cov", "pytest-mock", "pytest-xdist", "PySocks>=1.5.6, !=1.5.7", "pytest>=3"]
[tool.setuptools]license-files = ["LICENSE", "NOTICE"]
[tool.setuptools.dynamic]version = {attr = "requests.__version__.__version__"}
[tool.setuptools.packages.find]where = ["src"]
[tool.ruff]target-version = "py310"src = ["src/requests", "tests"]exclude = ["docs/", "ext/"]6 unmodified lines "I", # isort "UP", # pyupgrade "T10", # flake8-debugger (replaces debug-statements hook)]# UP036: Remove once Python 3.10 is the minimum supported versionignore = ["E203", "E501", "UP038", "UP031"]ignore = ["E203", "E501", "UP038", "UP031", "UP036"]per-file-ignores = {"src/requests/__init__.py" = ["E402", "F401"], "src/requests/compat.py" = ["E402", "F401"], "tests/compat.py" = ["F401"]}
[tool.ruff.lint.isort]known-first-party = ["requests"]11 unmodified linesdeleted:setup.cfg-10 removed
1-[metadata]2-license_file = LICENSE3-provides-extra =4- socks5- use_chardet_on_py36-requires-dist =7- certifi>=2017.4.178- charset_normalizer>=2,<49- idna>=2.5,<410- urllib3>=1.21.1,<3modified:setup.py+4 added-100 removed
1-#!/usr/bin/env python2-import os1 import sys4-from codecs import open2 6-from setuptools import setup7-8-CURRENT_PYTHON = sys.version_info[:2]9-REQUIRED_PYTHON = (3, 9)10-11-if CURRENT_PYTHON < REQUIRED_PYTHON:12- sys.stderr.write(13- """14-==========================15-Unsupported Python version16-==========================17-This version of Requests requires at least Python {}.{}, but18-you're trying to install it on Python {}.{}. To resolve this,19-consider upgrading to a supported Python version.20-21-If you can't upgrade your Python version, you'll need to22-pin to an older version of Requests (<2.32.0).23-""".format(*(REQUIRED_PYTHON + CURRENT_PYTHON))24- )3+if sys.version_info < (3, 9):4+ sys.stderr.write("Requests requires Python 3.9 or later.\n")5 sys.exit(1)6 7+from setuptools import setup8 28-# 'setup.py publish' shortcut.29-if sys.argv[-1] == "publish":30- os.system("python setup.py sdist bdist_wheel")31- os.system("twine upload dist/*")32- sys.exit()33-34-requires = [35- "charset_normalizer>=2,<4",36- "idna>=2.5,<4",37- "urllib3>=1.21.1,<3",38- "certifi>=2017.4.17",39-]40-test_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-]48-49-about = {}50-here = os.path.abspath(os.path.dirname(__file__))51-with open(os.path.join(here, "src", "requests", "__version__.py"), "r", "utf-8") as f:52- exec(f.read(), about)53-54-with open("README.md", "r", "utf-8") as f:55- readme = f.read()56-57-setup(9+setup()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-)