-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Description
It appears our friend the reonovate-bot upgraded Flask from 1.1.4 to 2.0 recently, e.g. in the functions/helloworld/requirements.txt, causing an incompatibility with the production Functions runtime. The hello world example from the official documentation currently does not build.
My attempts running the hello world examples Python 3.8 or 3.9 yield the same error:
found incompatible dependencies: "functions-framework 2.1.3 has requirement click<8.0,>=7.0, but you have click 8.0.1. functions-framework 2.1.3 has requirement flask<2.0,>=1.0, but you have flask 2.0.1.
In between yesterday, when I first encountered this, and today, the bot has since upgraded functions-framework to 2.2.1. The hello world example, however, still does not work in production. It seems that the runtime defaults to functions-framework 2.1.3, which still expects Flask v1.
The two solutions I have found which work are to either revert to flask 1.1.4 for the short term, or to upgrade the functions framework package in the runtime, which seems to be stable with Flask > 2.0.
I realize that dependency management is a difficult problem to solve. In this specific case, I suggest the simple solution of explicitly adding the expected runtime version requirements.txt, in addition to requirements-test.txt where it is currently listed. This would ensure that the instructions in the tutorial work, without needed to additional instructions.
Concretely: adding the line functions-framework==2.2.1
to requirements.txt resolves the issue. I have not tested this on other sample code in the repository which relies on Flask, but presumably the issue and proposed solution are the same.