Skip to content

Remove app.pyi file #1932

Closed
adityamohta wants to merge 15 commits intoaws:masterfrom
adityamohta:master
Closed

Remove app.pyi file #1932
adityamohta wants to merge 15 commits intoaws:masterfrom
adityamohta:master

Conversation

@adityamohta
Copy link
Contributor

Issue #1802

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@adityamohta adityamohta marked this pull request as draft May 26, 2022 18:11
raise NotImplementedError("to_swagger")

def with_scopes(self, scopes):
def with_scopes(self, scopes: List[str]) -> 'Authorizer':
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since from __future__ import annotations is only supported for python 3.7+
To support v3.6, We are using quotes for annotations referring to classes declared after usage. Example - 'Authorizer'

# A backoff factor to apply between attempts after the second try.
backoff_factor=2,
method_whitelist=['GET', 'POST', 'PUT'],
allowed_methods=['GET', 'POST', 'PUT'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes method_whitelist deprecation warning in the next version from urllib3 library

Copy link
Member

Choose a reason for hiding this comment

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

Would you mind sending a separate PR for this? I'd like to keep this one just focused on removing the app.pyi file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jamesls Yeah, good point. I have a terrible habit of doing it.
Here is a separate PR for the same: #1939

@jamesls
Copy link
Member

jamesls commented Jun 3, 2022

Thanks for starting the work on this! I reran the failed jobs (looks like there's an unrelated intermittent test failure I need to track down). Looks like there's some type errors that are now failing.

@adityamohta adityamohta marked this pull request as ready for review June 13, 2022 05:11
@adityamohta
Copy link
Contributor Author

Thanks for starting the work on this! I reran the failed jobs (looks like there's an unrelated intermittent test failure I need to track down). Looks like there's some type errors that are now failing.

@jamesls Thanks for taking a look! Yes, I did shift all the type declarations to app.py from the app.pyi file, but the app.py was still missing many. I have defined those and resolved all the test failures.

@jamesls
Copy link
Member

jamesls commented Jun 13, 2022

Wow, thanks for doing this! Taking a look now.

Copy link
Member

@jamesls jamesls left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm going to go ahead and squash/merge. I'll also spend some time seeing if we can get even more specific with some of these types and replace some of these Anys.

jamesls added a commit that referenced this pull request Jun 13, 2022
PR #1932

* adityamohta/master:
  Add type definitions to app.py
@adityamohta
Copy link
Contributor Author

Looks good to me. I'm going to go ahead and squash/merge. I'll also spend some time seeing if we can get even more specific with some of these types and replace some of these Anys.

Excellent, Thanks for taking out time @jamesls !

I'll also spend some time seeing if we can get even more specific with some of these types and replace some of these Anys.

Awesome! Anys are frustrating and I did try to avoid it in this PR but for some vars, it was a rabbit hole, so I skipped some. :/

@adityamohta adityamohta deleted the master branch June 14, 2022 16:28
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