Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove requests dependency #401

Draft
wants to merge 7 commits into
base: trunk
Choose a base branch
from
Draft

remove requests dependency #401

wants to merge 7 commits into from

Conversation

glyph
Copy link
Member

@glyph glyph commented Sep 19, 2024

Fixes #325

In order to know whether we are even testing the various requests extensions, we want to have type hints that actually reflect the signatures on all the helpers.

I've definitely bitten off more than I can chew for getting this done today, so if anyone else wants to have a look at this, please be my guest.

@@ -14,6 +28,7 @@ def head(url, **kwargs):
return _client(kwargs).head(url, _stacklevel=4, **kwargs)


@_like(HTTPClient.get)
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting approach... I have a branch somewhere where I started factoring out TypedDict for all the arguments but it is so painful I haven't worked up the will to finish it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, huh, will Mypy actually do the right thing with a TypedDict in this context?

Copy link
Member Author

Choose a reason for hiding this comment

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

(I do think I prefer this approach regardless, that one had just never occurred to me.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I expect it will given Unpack (my experience actually doing this is with Pyright).

I certainly agree that this is less painful!

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.

Eliminate dependency on requests
2 participants