Skip to content
Myr

setup.py

This file

Path

setup.py

107 lines · 3.2 KiB · Python

Last changed by

Merge pull request #6802 from graingert/3.13Ian Stapleton Cordascobefore adoption1ae6fc3

History of this file

Take it

1#!/usr/bin/env python2import os3import sys4from codecs import open56from setuptools import setup78CURRENT_PYTHON = sys.version_info[:2]9REQUIRED_PYTHON = (3, 8)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(24            *(REQUIRED_PYTHON + CURRENT_PYTHON)25        )26    )27    sys.exit(1)282930# 'setup.py publish' shortcut.31if sys.argv[-1] == "publish":32    os.system("python setup.py sdist bdist_wheel")33    os.system("twine upload dist/*")34    sys.exit()3536requires = [37    "charset_normalizer>=2,<4",38    "idna>=2.5,<4",39    "urllib3>=1.21.1,<3",40    "certifi>=2017.4.17",41]42test_requirements = [43    "pytest-httpbin==2.1.0",44    "pytest-cov",45    "pytest-mock",46    "pytest-xdist",47    "PySocks>=1.5.6, !=1.5.7",48    "pytest>=3",49]5051about = {}52here = os.path.abspath(os.path.dirname(__file__))53with open(os.path.join(here, "src", "requests", "__version__.py"), "r", "utf-8") as f:54    exec(f.read(), about)5556with open("README.md", "r", "utf-8") as f:57    readme = f.read()5859setup(60    name=about["__title__"],61    version=about["__version__"],62    description=about["__description__"],63    long_description=readme,64    long_description_content_type="text/markdown",65    author=about["__author__"],66    author_email=about["__author_email__"],67    url=about["__url__"],68    packages=["requests"],69    package_data={"": ["LICENSE", "NOTICE"]},70    package_dir={"": "src"},71    include_package_data=True,72    python_requires=">=3.8",73    install_requires=requires,74    license=about["__license__"],75    zip_safe=False,76    classifiers=[77        "Development Status :: 5 - Production/Stable",78        "Environment :: Web Environment",79        "Intended Audience :: Developers",80        "License :: OSI Approved :: Apache Software License",81        "Natural Language :: English",82        "Operating System :: OS Independent",83        "Programming Language :: Python",84        "Programming Language :: Python :: 3",85        "Programming Language :: Python :: 3.8",86        "Programming Language :: Python :: 3.9",87        "Programming Language :: Python :: 3.10",88        "Programming Language :: Python :: 3.11",89        "Programming Language :: Python :: 3.12",90        "Programming Language :: Python :: 3.13",91        "Programming Language :: Python :: 3 :: Only",92        "Programming Language :: Python :: Implementation :: CPython",93        "Programming Language :: Python :: Implementation :: PyPy",94        "Topic :: Internet :: WWW/HTTP",95        "Topic :: Software Development :: Libraries",96    ],97    tests_require=test_requirements,98    extras_require={99        "security": [],100        "socks": ["PySocks>=1.5.6, !=1.5.7"],101        "use_chardet_on_py3": ["chardet>=3.0.2,<6"],102    },103    project_urls={104        "Documentation": "https://requests.readthedocs.io",105        "Source": "https://github.com/psf/requests",106    },107)