I inherited a legacy Python 2.7 App Engine app that I’m migrating to the Python 3 environment.
The Google migration guide for “pull” tasks, recommends moving them to use PubSub. I’ve rewritten our code to use PubSub, and can successfully run it in a local server both against an emulator and against production PubSub topics.
However, I am not able to deploy this new code due to version incompatibilities with grpcio:
- I’m using Python library
google-cloud-pubsubv 1.7.2, which the documentation lists as the last version compatible with Python 2.7 google-cloud-pubsubv 1.7.2 needsgrpciov 1.12.0, which fixes this bug- the legacy App Engine standard environment only allows installing
grpciovia the “built-in” libraries specified inapp.yml, which only providesgrpciov 1.0.0 (cf. https://cloud.google.com/appengine/docs/legacy/standard/python/tools/built-in-libraries-27))
I’ve come across a proposed workaround that simply catches the exception caused by the incompatibility, which might be bearable until we can get fully on Python 3, but is gross: https://github.com/googleapis/python-pubsub/issues/742#issuecomment-1224582470
Is there a combination of library versions that would allow me to use google-cloud-pubsub with Python 2.7 on the old App Engine environment?
What other alternatives do I have to do this migration? (Other than moving this code completely outside of App Engine for the moment, say to a Cloud Run function?)