From 46a3806312f4d56552f97939e21740041af9cb90 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Fri, 5 Aug 2022 07:28:35 -0400 Subject: [PATCH] Add `requests.__version__`; improve `requests.__init__` (#8484) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alex Waygood --- stubs/requests/requests/__init__.pyi | 24 ++++++++++++------------ stubs/requests/requests/__version__.pyi | 10 ++++++++++ 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 stubs/requests/requests/__version__.pyi diff --git a/stubs/requests/requests/__init__.pyi b/stubs/requests/requests/__init__.pyi index a53e4dc56..b3b379604 100644 --- a/stubs/requests/requests/__init__.pyi +++ b/stubs/requests/requests/__init__.pyi @@ -1,6 +1,15 @@ -import logging -from typing import Any - +from .__version__ import ( + __author__ as __author__, + __author_email__ as __author_email__, + __build__ as __build__, + __cake__ as __cake__, + __copyright__ as __copyright__, + __description__ as __description__, + __license__ as __license__, + __title__ as __title__, + __url__ as __url__, + __version__ as __version__, +) from .api import ( delete as delete, get as get, @@ -27,13 +36,4 @@ from .models import PreparedRequest as PreparedRequest, Request as Request, Resp from .sessions import Session as Session, session as session from .status_codes import codes as codes -__title__: Any -__build__: Any -__license__: Any -__copyright__: Any -__version__: Any - -class NullHandler(logging.Handler): - def emit(self, record): ... - def check_compatibility(urllib3_version: str, chardet_version: str | None, charset_normalizer_version: str | None) -> None: ... diff --git a/stubs/requests/requests/__version__.pyi b/stubs/requests/requests/__version__.pyi new file mode 100644 index 000000000..fe5db3dfd --- /dev/null +++ b/stubs/requests/requests/__version__.pyi @@ -0,0 +1,10 @@ +__title__: str +__description__: str +__url__: str +__version__: str +__build__: int +__author__: str +__author_email__: str +__license__: str +__copyright__: str +__cake__: str