Skip to content

Add stubs for httpretty#16048

Open
adamtheturtle wants to merge 9 commits into
python:mainfrom
adamtheturtle:agent/add-httpretty-stubs
Open

Add stubs for httpretty#16048
adamtheturtle wants to merge 9 commits into
python:mainfrom
adamtheturtle:agent/add-httpretty-stubs

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Adds type stubs for HTTPretty 1.1.4.

Related: #16047.

@adamtheturtle
adamtheturtle marked this pull request as ready for review July 20, 2026 13:29
@github-actions

This comment has been minimized.

@donbarbos donbarbos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I noted a few moments:

Comment thread stubs/httpretty/httpretty/__init__.pyi Outdated
Comment thread stubs/httpretty/httpretty/core.pyi Outdated
Comment thread stubs/httpretty/httpretty/http.pyi Outdated
Comment thread stubs/httpretty/httpretty/http.pyi Outdated
Comment thread stubs/httpretty/httpretty/core.pyi Outdated
@property
def host(self) -> str: ...
def parse_querystring(self, qs: str) -> dict[str, list[str]]: ...
def parse_request_body(self, body: str) -> Any: ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some explanatory comments:

Suggested change
def parse_request_body(self, body: str) -> Any: ...
def parse_request_body(self, body: str) -> Any: ... # Any object can be returned if deserialization is successful

Comment thread stubs/httpretty/httpretty/core.pyi Outdated
@@ -0,0 +1 @@
version: str

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: str
from typing import Final
version: Final[str]

encoding: str = "utf-8",
verbose: bool = False,
allow_net_connect: bool = True,
pool_manager_params: Mapping[str, Any] | None = None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another explanatory comment:

Suggested change
pool_manager_params: Mapping[str, Any] | None = None,
# Passed to urllib3.PoolManager as kwargs, and connection pool's parameters have various types
pool_manager_params: Mapping[str, Any] | None = None,

)
from .errors import HTTPrettyError as HTTPrettyError, UnmockedError as UnmockedError

__version__: str

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
__version__: str
__version__: Final[str]

adamtheturtle and others added 5 commits July 20, 2026 20:17
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
@github-actions

This comment has been minimized.

adamtheturtle and others added 3 commits July 20, 2026 20:44
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants