Skip to content

Incompatibility with Flask <2.0 due to flask.typing import #345

Closed
@apgiorgi

Description

@apgiorgi

The functions-framework package (as of version 3.5.0) is using flask.typing, which was introduced in Flask 2.0.0. However, the setup.py file allows Flask versions from 1.0 to 4.0. This causes runtime errors when using functions-framework with Flask versions before 2.0.0.

Error Message

CopyTraceback (most recent call last):
File "/layers/google.python.pip/pip/bin/functions-framework", line 5, in <module>
    from functions_framework._cli import *cli
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/functions_framework/__init__.py", line 57, in <module>
    HTTPFunction = Callable[[flask.Request], flask.typing.ResponseReturnValue]
AttributeError: module 'flask' has no attribute 'typing'

Proposed Solution

Requirements should be updated to Flask 2.0.0 or later.

Metadata

Metadata

Assignees

Labels

P2bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions