-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Added annotation for five functions in Authlib #14800
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
21e12c7
84bcf4f
57fa61c
514d619
8025584
c17df44
8addbd3
8af2d45
42348ad
a36b99d
5d71ad7
fe8f5f0
9f0ed4e
736414c
210f1f5
6e406b4
ce035d2
dd1416f
6858213
e368db3
f8ceb98
c50be52
65acd6c
4b771bf
c2469c0
405cb7e
c1b465b
3280a42
51db573
186e0e4
8b1a45d
4428ef8
94e23c4
3665c2b
52f27aa
ebaf5ae
2ce8939
bc140cc
99a15db
7b83007
5060bd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
from logging import Logger | ||
from typing import Any | ||
|
||
import requests # type: ignore[import-untyped] | ||
from authlib.integrations.base_client.sync_app import OAuth1Base, OAuth2Base | ||
|
||
log: Logger | ||
|
||
__all__ = ["AsyncOAuth1Mixin", "AsyncOAuth2Mixin"] | ||
|
||
class AsyncOAuth1Mixin(OAuth1Base): | ||
async def request(self, method, url, token=None, **kwargs): ... | ||
async def create_authorization_url(self, redirect_uri=None, **kwargs): ... | ||
async def fetch_access_token(self, request_token=None, **kwargs): ... | ||
async def request(self, method: str, url: str, token: dict[str, Any] | None = None, **kwargs) -> requests.Response: ... | ||
|
||
async def create_authorization_url(self, redirect_uri: str | None = None, **kwargs) -> dict[str, Any]: ... | ||
async def fetch_access_token(self, request_token: dict[str, Any] | None = None, **kwargs) -> dict[str, Any]: ... | ||
|
||
class AsyncOAuth2Mixin(OAuth2Base): | ||
async def load_server_metadata(self): ... | ||
async def request(self, method, url, token=None, **kwargs): ... | ||
async def create_authorization_url(self, redirect_uri=None, **kwargs): ... | ||
async def fetch_access_token(self, redirect_uri=None, **kwargs): ... | ||
async def load_server_metadata(self) -> dict[str, Any]: ... | ||
async def request(self, method: str, url: str, token: dict[str, Any] | None = None, **kwargs) -> requests.Response: ... | ||
async def create_authorization_url(self, redirect_uri: str | None = None, **kwargs) -> dict[str, Any]: ... | ||
async def fetch_access_token(self, redirect_uri: str | None = None, **kwargs) -> dict[str, Any]: ... | ||
Spider84pr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are importing a 3rd-party lib, you need to add
types-requests
as a dependency: https://github.com/python/typeshed/blob/main/stubs/Authlib/METADATA.tomlUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sobolevn I must do it like so?
Metadata. toml
dependencies = [
"types-httpx",
]
Sorry, I've faced it first time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Spider84pr
requires = ["types-requests"]
should be correct. See for examplestubs/pysftp/METADATA.toml
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srittau I have added required section and changed the library as we discussed with @sobolevn in the below, but the most test failed
I don't know what to do