Skip to content

Add stubs for flask-cors #6939

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

Merged
merged 16 commits into from
Jan 22, 2022
Merged

Add stubs for flask-cors #6939

merged 16 commits into from
Jan 22, 2022

Conversation

kasium
Copy link
Contributor

@kasium kasium commented Jan 17, 2022

No description provided.

@kasium
Copy link
Contributor Author

kasium commented Jan 17, 2022

This package has dependencies to werkzeug and flask which are not part of typeshed. I currently used Any till #5768 is done

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks!

@kasium
Copy link
Contributor Author

kasium commented Jan 19, 2022

@JelleZijlstra can you please take a look why the CI fails?

@kasium kasium requested a review from srittau January 19, 2022 11:33
@JelleZijlstra
Copy link
Member

@JelleZijlstra can you please take a look why the CI fails?

Looks like CI is green now. I responded to the two conversations that are still open.

@kasium kasium requested a review from JelleZijlstra January 20, 2022 13:13
@kasium
Copy link
Contributor Author

kasium commented Jan 20, 2022

@JelleZijlstra CI complains with error: flask_cors.core.DEFAULT_OPTIONS variable differs from runtime type builtins.dict[Any, Any] . Not sure how to fix this...

_App = Any # flask is not part of typeshed
_Response = Any # flask is not part of typeshed
_MultiDict = Any # werkzeug is not part of typeshed
_Options = TypedDict(
Copy link
Member

@JelleZijlstra JelleZijlstra Jan 22, 2022

Choose a reason for hiding this comment

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

You should use class syntax for TypedDict: class _Options(TypedDict, total=False):.

@JelleZijlstra
Copy link
Member

@JelleZijlstra CI complains with error: flask_cors.core.DEFAULT_OPTIONS variable differs from runtime type builtins.dict[Any, Any] . Not sure how to fix this...

That looks like a stubtest bug (cc @hauntsaninja). You can add it to the allowlist for now (I think you used the allowlist in another PR already?) and report it as a bug over at https://github.com/python/mypy.

@hauntsaninja
Copy link
Collaborator

I was wondering when this would come up :-) I can try to fix soon

@kasium kasium requested a review from JelleZijlstra January 22, 2022 14:38
@kasium
Copy link
Contributor Author

kasium commented Jan 22, 2022

@JelleZijlstra done

@JelleZijlstra JelleZijlstra merged commit 30133bb into python:master Jan 22, 2022
@kasium kasium deleted the flask-cors branch January 22, 2022 15:20
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.

4 participants