Skip to content

[requests-oauthlib] Add missing parameter and return annotations - #16771

Open
sumit-2007-git wants to merge 2 commits into
python:mainfrom
sumit-2007-git:fix/requests-oauthlib-typing
Open

sumit-2007-git wants to merge 2 commits into
python:mainfrom
sumit-2007-git:fix/requests-oauthlib-typing

Conversation

@sumit-2007-git

Copy link
Copy Markdown

Adds missing parameter, return, and attribute type annotations across requests-oauthlib based on the upstream implementation and requests._types / oauthlib client interfaces:

  • oauth1_auth.pyi (OAuth1.__init__): annotate client_key, client_secret, resource_owner_key, resource_owner_secret, callback_uri, signature_method, signature_type, rsa_key, verifier, realm, nonce, and timestamp.
  • oauth1_session.pyi: annotate urldecode and missing parameter types on OAuth1Session.__init__, authorization_url, fetch_request_token, and fetch_access_token.
  • oauth2_auth.pyi (OAuth2.__init__): annotate client_id and token.
  • oauth2_session.pyi: annotate TokenUpdated and missing attribute/property/method annotations on OAuth2Session (redirect_uri, state, token_updater, __init__, new_state, client_id, token, access_token, authorization_url, fetch_token, refresh_token, and request).

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

zulip (https://github.com/zulip/zulip)
+ zerver/views/video_calls.py:223: error: Argument "token" to "OAuth2Session" has incompatible type "object"; expected "dict[str, Any] | None"  [arg-type]

@sumit-2007-git

Copy link
Copy Markdown
Author

Hi maintainers,

Just checking in on this PR. All CI checks and mypy_primer run clean with zero regressions on existing open-source codebases.

Whenever you have a moment to review, please let me know if any further tweaks or tests are needed. Thank you for your time!

This branch has not been deployed

No deployments
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.

1 participant