You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functions-framework is incompatible with the google-cloud-functions SDK package, unless google-cloud-functions is installed with a separate install command AFTER functions-framework is installed.
As I understand it, this is not possible to do within the context of Google Cloud Functions, where packages get installed automatically from the requirements.txt file.
The reason is that functions-framework overwrites several important files in google/cloud/functions_v1, google/cloud/functions, and google/cloud/functions_v1beta2 that are required to make the google-cloud-functions SDK package work as intended.
For example: functions-framework overwrites google/cloud/functions_v1/__init__.py upon install, which breaks the ability to import packages in the normal, documented ways.
jyork03
changed the title
functions-framework breaks the google-cloud-functions SDK package
functions-framework breaks import paths for the google-cloud-functions SDK package
Apr 29, 2022
functions-framework is incompatible with the google-cloud-functions SDK package, unless google-cloud-functions is installed with a separate install command AFTER functions-framework is installed.
As I understand it, this is not possible to do within the context of Google Cloud Functions, where packages get installed automatically from the requirements.txt file.
The reason is that functions-framework overwrites several important files in google/cloud/functions_v1, google/cloud/functions, and google/cloud/functions_v1beta2 that are required to make the google-cloud-functions SDK package work as intended.
For example: functions-framework overwrites
google/cloud/functions_v1/__init__.py
upon install, which breaks the ability to import packages in the normal, documented ways.Steps to reproduce:
create a new python 3.9 environment:
Run:
pip install google-cloud-functions==1.6.0 functions-framework==3.0.0
Then execute:
This will raise:
AttributeError: module 'google.cloud.functions_v1' has no attribute 'CloudFunctionsServiceClient'
Edit:
This means that none of the sample code in the docs will work, since they all rely on the imported members from
google/cloud/functions_v1/__init__.py
. Example below:https://cloud.google.com/python/docs/reference/cloudfunctions/latest/google.cloud.functions_v1.services.cloud_functions_service.CloudFunctionsServiceClient#google_cloud_functions_v1_services_cloud_functions_service_CloudFunctionsServiceClient_create_function
The text was updated successfully, but these errors were encountered: