Hello,
We've got a Python project that uses some Google client libraries that rely on protobuf as a dependency. We're using a Cloud Build CI/CD pipeline with poetry as the package manager and pip to install the dependencies in a directory to be zipped and used elsewhere.
pip install poetry==1.4.2
poetry install --with dev,test
pytest tests/ --cov
poetry run pip install . -t src_with_deps
When trying to run the project, we get the following error, which I believe is because we have somehow got a newer version of protobuf (v5.27.2) installed than is compatible with the Google client libraries.
AttributeError: type object 'MethodOptions' has no attribute 'RegisterExtension'
Poetry seems to resolve a usable version of protobuf (v4.25.3) but the pip install seems to resolve v5.27.2
Has anyone else come across anything like this or knows how to resolve it?
The Google client libraries we're using are:
- google-cloud-bigquery v3.3.5
- google-cloud-logging v3.2.5
- google-cloud-storage v2.5.0
And we're using Python 3.10