From 9bf7af86b1ea5bb477b37f5238c71fe35ef92e6a Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 09:35:59 +1100 Subject: [PATCH 1/5] fix(appengine): update all app engine samples to latest Python Python 3.9 is EOL, new deployments will error, with the message saying to update to the latest Python runtime. b/452455170 --- appengine/standard_python3/bigquery/app.yaml | 2 +- .../standard_python3/building-an-app/building-an-app-2/app.yaml | 2 +- .../standard_python3/building-an-app/building-an-app-3/app.yaml | 2 +- .../standard_python3/building-an-app/building-an-app-4/app.yaml | 2 +- .../standard_python3/bundled-services/blobstore/django/app.yaml | 2 +- .../standard_python3/bundled-services/blobstore/flask/app.yaml | 2 +- .../standard_python3/bundled-services/blobstore/wsgi/app.yaml | 2 +- .../standard_python3/bundled-services/deferred/django/app.yaml | 2 +- .../standard_python3/bundled-services/deferred/flask/app.yaml | 2 +- .../standard_python3/bundled-services/deferred/wsgi/app.yaml | 2 +- .../standard_python3/bundled-services/mail/django/app.yaml | 2 +- appengine/standard_python3/bundled-services/mail/flask/app.yaml | 2 +- appengine/standard_python3/bundled-services/mail/wsgi/app.yaml | 2 +- appengine/standard_python3/cloudsql/app.yaml | 2 +- appengine/standard_python3/custom-server/app.yaml | 2 +- appengine/standard_python3/django/app.yaml | 2 +- appengine/standard_python3/migration/urlfetch/app.yaml | 2 +- appengine/standard_python3/pubsub/app.yaml | 2 +- appengine/standard_python3/redis/app.yaml | 2 +- appengine/standard_python3/spanner/app.yaml | 2 +- appengine/standard_python3/warmup/app.yaml | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/appengine/standard_python3/bigquery/app.yaml b/appengine/standard_python3/bigquery/app.yaml index 83c91f5b872..472f1f0c034 100644 --- a/appengine/standard_python3/bigquery/app.yaml +++ b/appengine/standard_python3/bigquery/app.yaml @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 diff --git a/appengine/standard_python3/building-an-app/building-an-app-2/app.yaml b/appengine/standard_python3/building-an-app/building-an-app-2/app.yaml index a0931a8a5d9..100d540982b 100644 --- a/appengine/standard_python3/building-an-app/building-an-app-2/app.yaml +++ b/appengine/standard_python3/building-an-app/building-an-app-2/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 handlers: # This configures Google App Engine to serve the files in the app's static diff --git a/appengine/standard_python3/building-an-app/building-an-app-3/app.yaml b/appengine/standard_python3/building-an-app/building-an-app-3/app.yaml index a0931a8a5d9..100d540982b 100644 --- a/appengine/standard_python3/building-an-app/building-an-app-3/app.yaml +++ b/appengine/standard_python3/building-an-app/building-an-app-3/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 handlers: # This configures Google App Engine to serve the files in the app's static diff --git a/appengine/standard_python3/building-an-app/building-an-app-4/app.yaml b/appengine/standard_python3/building-an-app/building-an-app-4/app.yaml index a0931a8a5d9..100d540982b 100644 --- a/appengine/standard_python3/building-an-app/building-an-app-4/app.yaml +++ b/appengine/standard_python3/building-an-app/building-an-app-4/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 handlers: # This configures Google App Engine to serve the files in the app's static diff --git a/appengine/standard_python3/bundled-services/blobstore/django/app.yaml b/appengine/standard_python3/bundled-services/blobstore/django/app.yaml index 96e1c924ee3..6994339e157 100644 --- a/appengine/standard_python3/bundled-services/blobstore/django/app.yaml +++ b/appengine/standard_python3/bundled-services/blobstore/django/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true handlers: diff --git a/appengine/standard_python3/bundled-services/blobstore/flask/app.yaml b/appengine/standard_python3/bundled-services/blobstore/flask/app.yaml index 96e1c924ee3..6994339e157 100644 --- a/appengine/standard_python3/bundled-services/blobstore/flask/app.yaml +++ b/appengine/standard_python3/bundled-services/blobstore/flask/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true handlers: diff --git a/appengine/standard_python3/bundled-services/blobstore/wsgi/app.yaml b/appengine/standard_python3/bundled-services/blobstore/wsgi/app.yaml index 96e1c924ee3..6994339e157 100644 --- a/appengine/standard_python3/bundled-services/blobstore/wsgi/app.yaml +++ b/appengine/standard_python3/bundled-services/blobstore/wsgi/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true handlers: diff --git a/appengine/standard_python3/bundled-services/deferred/django/app.yaml b/appengine/standard_python3/bundled-services/deferred/django/app.yaml index 84314e1d25b..c2226a56b67 100644 --- a/appengine/standard_python3/bundled-services/deferred/django/app.yaml +++ b/appengine/standard_python3/bundled-services/deferred/django/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true env_variables: NDB_USE_CROSS_COMPATIBLE_PICKLE_PROTOCOL: "True" diff --git a/appengine/standard_python3/bundled-services/deferred/flask/app.yaml b/appengine/standard_python3/bundled-services/deferred/flask/app.yaml index 84314e1d25b..c2226a56b67 100644 --- a/appengine/standard_python3/bundled-services/deferred/flask/app.yaml +++ b/appengine/standard_python3/bundled-services/deferred/flask/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true env_variables: NDB_USE_CROSS_COMPATIBLE_PICKLE_PROTOCOL: "True" diff --git a/appengine/standard_python3/bundled-services/deferred/wsgi/app.yaml b/appengine/standard_python3/bundled-services/deferred/wsgi/app.yaml index 84314e1d25b..c2226a56b67 100644 --- a/appengine/standard_python3/bundled-services/deferred/wsgi/app.yaml +++ b/appengine/standard_python3/bundled-services/deferred/wsgi/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true env_variables: NDB_USE_CROSS_COMPATIBLE_PICKLE_PROTOCOL: "True" diff --git a/appengine/standard_python3/bundled-services/mail/django/app.yaml b/appengine/standard_python3/bundled-services/mail/django/app.yaml index ff79a69182c..902fe897910 100644 --- a/appengine/standard_python3/bundled-services/mail/django/app.yaml +++ b/appengine/standard_python3/bundled-services/mail/django/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true inbound_services: diff --git a/appengine/standard_python3/bundled-services/mail/flask/app.yaml b/appengine/standard_python3/bundled-services/mail/flask/app.yaml index ff79a69182c..902fe897910 100644 --- a/appengine/standard_python3/bundled-services/mail/flask/app.yaml +++ b/appengine/standard_python3/bundled-services/mail/flask/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true inbound_services: diff --git a/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml b/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml index ff79a69182c..902fe897910 100644 --- a/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml +++ b/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 app_engine_apis: true inbound_services: diff --git a/appengine/standard_python3/cloudsql/app.yaml b/appengine/standard_python3/cloudsql/app.yaml index 496b60f231b..dfb14663846 100644 --- a/appengine/standard_python3/cloudsql/app.yaml +++ b/appengine/standard_python3/cloudsql/app.yaml @@ -14,7 +14,7 @@ # [START gae_python38_cloudsql_config] # [START gae_python3_cloudsql_config] -runtime: python39 +runtime: python313 env_variables: CLOUD_SQL_USERNAME: YOUR-USERNAME diff --git a/appengine/standard_python3/custom-server/app.yaml b/appengine/standard_python3/custom-server/app.yaml index ff2f64b2b26..b67aef4f96e 100644 --- a/appengine/standard_python3/custom-server/app.yaml +++ b/appengine/standard_python3/custom-server/app.yaml @@ -14,7 +14,7 @@ # [START gae_python38_custom_runtime] # [START gae_python3_custom_runtime] -runtime: python39 +runtime: python313 entrypoint: uwsgi --http-socket :$PORT --wsgi-file main.py --callable app --master --processes 1 --threads 2 # [END gae_python3_custom_runtime] # [END gae_python38_custom_runtime] diff --git a/appengine/standard_python3/django/app.yaml b/appengine/standard_python3/django/app.yaml index 5a7255118c8..ddf86e23823 100644 --- a/appengine/standard_python3/django/app.yaml +++ b/appengine/standard_python3/django/app.yaml @@ -15,7 +15,7 @@ # # [START gaestd_py_django_app_yaml] -runtime: python39 +runtime: python313 env_variables: # This setting is used in settings.py to configure your ALLOWED_HOSTS diff --git a/appengine/standard_python3/migration/urlfetch/app.yaml b/appengine/standard_python3/migration/urlfetch/app.yaml index dd75aa47c69..3aa9d9d2207 100644 --- a/appengine/standard_python3/migration/urlfetch/app.yaml +++ b/appengine/standard_python3/migration/urlfetch/app.yaml @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 diff --git a/appengine/standard_python3/pubsub/app.yaml b/appengine/standard_python3/pubsub/app.yaml index 9e3e948e4db..3c36b4bfb3c 100644 --- a/appengine/standard_python3/pubsub/app.yaml +++ b/appengine/standard_python3/pubsub/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 # [START gae_standard_pubsub_env] env_variables: diff --git a/appengine/standard_python3/redis/app.yaml b/appengine/standard_python3/redis/app.yaml index 2797ed154f7..138895c3737 100644 --- a/appengine/standard_python3/redis/app.yaml +++ b/appengine/standard_python3/redis/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 env_variables: REDIS_HOST: your-redis-host diff --git a/appengine/standard_python3/spanner/app.yaml b/appengine/standard_python3/spanner/app.yaml index a4e3167ec08..59a31baca33 100644 --- a/appengine/standard_python3/spanner/app.yaml +++ b/appengine/standard_python3/spanner/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 env_variables: SPANNER_INSTANCE: "YOUR-SPANNER-INSTANCE-ID" diff --git a/appengine/standard_python3/warmup/app.yaml b/appengine/standard_python3/warmup/app.yaml index fdda19a79b1..3cc59533b01 100644 --- a/appengine/standard_python3/warmup/app.yaml +++ b/appengine/standard_python3/warmup/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python39 +runtime: python313 inbound_services: - warmup From 8ee289ac849230b7c6607ffde50643682c0e2c69 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Tue, 21 Oct 2025 10:38:10 +1100 Subject: [PATCH 2/5] cgi dropped in py313, make this sample use py312 for now --- appengine/standard_python3/bundled-services/mail/wsgi/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml b/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml index 902fe897910..79f6d993358 100644 --- a/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml +++ b/appengine/standard_python3/bundled-services/mail/wsgi/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python313 +runtime: python312 app_engine_apis: true inbound_services: From c7703597426e4d780ce3b7aaac2dfc7b27e590b4 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Tue, 21 Oct 2025 10:54:31 +1100 Subject: [PATCH 3/5] cloudsql binary not installing on py313, try latest version just in case --- appengine/standard_python3/cloudsql/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appengine/standard_python3/cloudsql/requirements.txt b/appengine/standard_python3/cloudsql/requirements.txt index 7ca534fe2e0..14302a55d3e 100644 --- a/appengine/standard_python3/cloudsql/requirements.txt +++ b/appengine/standard_python3/cloudsql/requirements.txt @@ -1,6 +1,6 @@ flask==3.0.0 # psycopg2==2.8.4 # you will need either the binary or the regular - for more info see http://initd.org/psycopg/docs/install.html -psycopg2-binary==2.9.9 +psycopg2-binary==2.9.11 PyMySQL==1.1.1 -SQLAlchemy==2.0.10 \ No newline at end of file +SQLAlchemy==2.0.10 From fcdf98c061e6b180ec498e9a45ca6bbcbffafc64 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Tue, 21 Oct 2025 11:08:38 +1100 Subject: [PATCH 4/5] bump sqlalchemy to avoid import typing error --- appengine/standard_python3/cloudsql/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appengine/standard_python3/cloudsql/requirements.txt b/appengine/standard_python3/cloudsql/requirements.txt index 14302a55d3e..7fe39c1a1b2 100644 --- a/appengine/standard_python3/cloudsql/requirements.txt +++ b/appengine/standard_python3/cloudsql/requirements.txt @@ -3,4 +3,4 @@ flask==3.0.0 # you will need either the binary or the regular - for more info see http://initd.org/psycopg/docs/install.html psycopg2-binary==2.9.11 PyMySQL==1.1.1 -SQLAlchemy==2.0.10 +SQLAlchemy==2.0.44 From e02edafa843db56032b034e4aee59030614fc631 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Tue, 21 Oct 2025 14:35:45 +1100 Subject: [PATCH 5/5] mail package also uses cgi, pull back to py312 --- appengine/standard_python3/bundled-services/mail/flask/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appengine/standard_python3/bundled-services/mail/flask/app.yaml b/appengine/standard_python3/bundled-services/mail/flask/app.yaml index 902fe897910..79f6d993358 100644 --- a/appengine/standard_python3/bundled-services/mail/flask/app.yaml +++ b/appengine/standard_python3/bundled-services/mail/flask/app.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime: python313 +runtime: python312 app_engine_apis: true inbound_services: