diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index d56cb1380630..72feb31a500b 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -45,7 +45,7 @@ branchProtectionRules: - "Kokoro CI - Lint" - "Kokoro CI - Python 2.7 (App Engine Standard Only)" - "Kokoro CI - Python 3.8" - - "Kokoro CI - Python 3.12" + - "Kokoro CI - Python 3.13" - "cla/google" - "snippet-bot check" # List of explicit permissions to add (additive only) diff --git a/alloydb/notebooks/noxfile_config.py b/alloydb/notebooks/noxfile_config.py index b12448e7fbe2..f5bc1ea9e2f0 100644 --- a/alloydb/notebooks/noxfile_config.py +++ b/alloydb/notebooks/noxfile_config.py @@ -14,7 +14,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/appengine/flexible/django_cloudsql/noxfile_config.py b/appengine/flexible/django_cloudsql/noxfile_config.py index a3234e2e0aab..8bf4a236ee53 100644 --- a/appengine/flexible/django_cloudsql/noxfile_config.py +++ b/appengine/flexible/django_cloudsql/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string diff --git a/appengine/flexible/django_cloudsql/requirements.txt b/appengine/flexible/django_cloudsql/requirements.txt index 93f3930eda82..52318f17ab34 100644 --- a/appengine/flexible/django_cloudsql/requirements.txt +++ b/appengine/flexible/django_cloudsql/requirements.txt @@ -1,5 +1,5 @@ -Django==5.1.4; python_version >= "3.10" -Django==4.2.17; python_version >= "3.8" and python_version < "3.10" +Django==5.1.5; python_version >= "3.10" +Django==5.1.5; python_version >= "3.8" and python_version < "3.10" gunicorn==22.0.0 psycopg2-binary==2.9.10 django-environ==0.11.2 diff --git a/appengine/flexible/hello_world_django/requirements.txt b/appengine/flexible/hello_world_django/requirements.txt index 7f041f9278d2..5bf2d53f4656 100644 --- a/appengine/flexible/hello_world_django/requirements.txt +++ b/appengine/flexible/hello_world_django/requirements.txt @@ -1,4 +1,4 @@ -Django==5.1.4; python_version >= "3.10" -Django==4.2.17; python_version >= "3.8" and python_version < "3.10" -Django==3.2.25; python_version < "3.8" +Django==5.1.5; python_version >= "3.10" +Django==5.1.5; python_version >= "3.8" and python_version < "3.10" +Django==5.1.5; python_version < "3.8" gunicorn==22.0.0 diff --git a/appengine/flexible/numpy/noxfile_config.py b/appengine/flexible/numpy/noxfile_config.py index 157877897134..21d912ad459a 100644 --- a/appengine/flexible/numpy/noxfile_config.py +++ b/appengine/flexible/numpy/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.7", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible/scipy/noxfile_config.py b/appengine/flexible/scipy/noxfile_config.py index c5139a5493ca..fa718fc163c7 100644 --- a/appengine/flexible/scipy/noxfile_config.py +++ b/appengine/flexible/scipy/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/analytics/noxfile_config.py b/appengine/flexible_python37_and_earlier/analytics/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/analytics/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/analytics/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/datastore/noxfile_config.py b/appengine/flexible_python37_and_earlier/datastore/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/datastore/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/datastore/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/disk/noxfile_config.py b/appengine/flexible_python37_and_earlier/disk/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/disk/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/disk/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/django_cloudsql/noxfile_config.py b/appengine/flexible_python37_and_earlier/django_cloudsql/noxfile_config.py index 393aa3f69329..a51f3680ad61 100644 --- a/appengine/flexible_python37_and_earlier/django_cloudsql/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/django_cloudsql/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt b/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt index bbe8c3404a93..5c73ea543de6 100644 --- a/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt +++ b/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt @@ -1,6 +1,6 @@ -Django==5.1.4; python_version >= "3.10" -Django==4.2.17; python_version >= "3.8" and python_version < "3.10" -Django==3.2.25; python_version < "3.8" +Django==5.1.5; python_version >= "3.10" +Django==5.1.5; python_version >= "3.8" and python_version < "3.10" +Django==5.1.5; python_version < "3.8" gunicorn==22.0.0 psycopg2-binary==2.9.10 django-environ==0.11.2 diff --git a/appengine/flexible_python37_and_earlier/extending_runtime/noxfile_config.py b/appengine/flexible_python37_and_earlier/extending_runtime/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/extending_runtime/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/extending_runtime/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/hello_world/noxfile_config.py b/appengine/flexible_python37_and_earlier/hello_world/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/hello_world/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/hello_world/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/hello_world_django/noxfile_config.py b/appengine/flexible_python37_and_earlier/hello_world_django/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/hello_world_django/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/hello_world_django/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt b/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt index 7f041f9278d2..5bf2d53f4656 100644 --- a/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt +++ b/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt @@ -1,4 +1,4 @@ -Django==5.1.4; python_version >= "3.10" -Django==4.2.17; python_version >= "3.8" and python_version < "3.10" -Django==3.2.25; python_version < "3.8" +Django==5.1.5; python_version >= "3.10" +Django==5.1.5; python_version >= "3.8" and python_version < "3.10" +Django==5.1.5; python_version < "3.8" gunicorn==22.0.0 diff --git a/appengine/flexible_python37_and_earlier/metadata/noxfile_config.py b/appengine/flexible_python37_and_earlier/metadata/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/metadata/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/metadata/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/multiple_services/noxfile_config.py b/appengine/flexible_python37_and_earlier/multiple_services/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/multiple_services/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/multiple_services/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/numpy/noxfile_config.py b/appengine/flexible_python37_and_earlier/numpy/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/numpy/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/numpy/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/pubsub/noxfile_config.py b/appengine/flexible_python37_and_earlier/pubsub/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/pubsub/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/pubsub/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/scipy/noxfile_config.py b/appengine/flexible_python37_and_earlier/scipy/noxfile_config.py index 9dbc4dd20c86..887244766fdf 100644 --- a/appengine/flexible_python37_and_earlier/scipy/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/scipy/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/static_files/noxfile_config.py b/appengine/flexible_python37_and_earlier/static_files/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/static_files/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/static_files/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/storage/noxfile_config.py b/appengine/flexible_python37_and_earlier/storage/noxfile_config.py index 85dce2f0ae0a..6c2c81fa22b9 100644 --- a/appengine/flexible_python37_and_earlier/storage/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/storage/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/appengine/flexible_python37_and_earlier/tasks/noxfile_config.py b/appengine/flexible_python37_and_earlier/tasks/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/tasks/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/tasks/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/twilio/noxfile_config.py b/appengine/flexible_python37_and_earlier/twilio/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/twilio/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/twilio/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible_python37_and_earlier/websockets/noxfile_config.py b/appengine/flexible_python37_and_earlier/websockets/noxfile_config.py index 40a88b65ca40..1665dd736f8b 100644 --- a/appengine/flexible_python37_and_earlier/websockets/noxfile_config.py +++ b/appengine/flexible_python37_and_earlier/websockets/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pyarrow compilation failure. - "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard/images/guestbook/main.py b/appengine/standard/images/guestbook/main.py index 5abe23c3264e..f5ef2f1c6f86 100644 --- a/appengine/standard/images/guestbook/main.py +++ b/appengine/standard/images/guestbook/main.py @@ -18,22 +18,21 @@ For more information, see README.md. """ -# [START all] - +# [START gae_images_guestbook_all] import cgi import urllib -# [START import_images] +# [START gae_images_guestbook_import_images] from google.appengine.api import images +# [END gae_images_guestbook_import_images] -# [END import_images] from google.appengine.api import users from google.appengine.ext import ndb import webapp2 -# [START model] +# [START gae_images_guestbook_model] class Greeting(ndb.Model): """Models a Guestbook entry with an author, content, avatar, and date.""" @@ -41,9 +40,7 @@ class Greeting(ndb.Model): content = ndb.TextProperty() avatar = ndb.BlobProperty() date = ndb.DateTimeProperty(auto_now_add=True) - - -# [END model] +# [END gae_images_guestbook_model] def guestbook_key(guestbook_name=None): @@ -67,16 +64,16 @@ def get(self): self.response.out.write("%s wrote:" % greeting.author) else: self.response.out.write("An anonymous person wrote:") - # [START display_image] + # [START gae_images_guestbook_display_image] self.response.out.write( '
' % greeting.key.urlsafe() ) self.response.out.write( "
%s
" % cgi.escape(greeting.content) ) - # [END display_image] + # [END gae_images_guestbook_display_image] - # [START form] + # [START gae_images_guestbook_form] self.response.out.write( """
'3.6' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 \ No newline at end of file diff --git a/appengine/standard/mailjet/templates/index.html b/appengine/standard/mailjet/templates/index.html index 7426c4e5d16a..51e3c031cdd9 100644 --- a/appengine/standard/mailjet/templates/index.html +++ b/appengine/standard/mailjet/templates/index.html @@ -19,11 +19,9 @@ Mailjet on Google App Engine -
- diff --git a/appengine/standard/memcache/guestbook/main.py b/appengine/standard/memcache/guestbook/main.py index b181cf1eac68..8c6352ce4348 100644 --- a/appengine/standard/memcache/guestbook/main.py +++ b/appengine/standard/memcache/guestbook/main.py @@ -18,8 +18,7 @@ For more information, see README.md. """ -# [START all] - +# [START gae_memcache_guestbook_all] import cgi import cStringIO import logging @@ -73,7 +72,7 @@ def get(self): ) ) - # [START check_memcache] + # [START gae_memcache_guestbook_check_memcache] def get_greetings(self, guestbook_name): """ get_greetings() @@ -98,10 +97,9 @@ def get_greetings(self, guestbook_name): except ValueError: logging.error("Memcache set failed - data larger than 1MB") return greetings + # [END gae_memcache_guestbook_check_memcache] - # [END check_memcache] - - # [START query_datastore] + # [START gae_memcache_guestbook_query_datastore] def render_greetings(self, guestbook_name): """ render_greetings() @@ -131,8 +129,7 @@ def render_greetings(self, guestbook_name): "
{}
".format(cgi.escape(greeting.content)) ) return output.getvalue() - - # [END query_datastore] + # [END gae_memcache_guestbook_query_datastore] class Guestbook(webapp2.RequestHandler): @@ -155,4 +152,4 @@ def post(self): app = webapp2.WSGIApplication([("/", MainPage), ("/sign", Guestbook)], debug=True) -# [END all] +# [END gae_memcache_guestbook_all] diff --git a/appengine/standard/migration/incoming/main.py b/appengine/standard/migration/incoming/main.py index 23125216260d..d51c62c2e960 100644 --- a/appengine/standard/migration/incoming/main.py +++ b/appengine/standard/migration/incoming/main.py @@ -17,10 +17,10 @@ """ # [START gae_python_app_identity_incoming] -from google.oauth2 import id_token -from google.auth.transport import requests - import logging + +from google.auth.transport import requests +from google.oauth2 import id_token import webapp2 diff --git a/appengine/standard/migration/ndb/overview/README.md b/appengine/standard/migration/ndb/overview/README.md index c91442a5e081..8bd2d9e6cbac 100644 --- a/appengine/standard/migration/ndb/overview/README.md +++ b/appengine/standard/migration/ndb/overview/README.md @@ -11,11 +11,6 @@ with the [Google Cloud NDB library](https://googleapis.dev/python/python-ndb/lat This library can be used not only on App Engine, but also other Python 3 platforms. -To deploy and run this sample in App Engine standard for Python 2.7: - - pip install -t lib -r requirements.txt - gcloud app deploy - -To deploy and run this sample in App Engine standard for Python 3.7: +To deploy and run this sample in App Engine standard for Python 3.8: gcloud app deploy app3.yaml diff --git a/appengine/standard/migration/ndb/overview/main.py b/appengine/standard/migration/ndb/overview/main.py index a714e50ca345..97fbd8e44951 100644 --- a/appengine/standard/migration/ndb/overview/main.py +++ b/appengine/standard/migration/ndb/overview/main.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START all] from flask import Flask, redirect, render_template, request from google.cloud import ndb @@ -25,15 +24,12 @@ client = ndb.Client() -# [START greeting] class Greeting(ndb.Model): """Models an individual Guestbook entry with content and date.""" content = ndb.StringProperty() date = ndb.DateTimeProperty(auto_now_add=True) - # [END greeting] - # [START query] with client.context(): @classmethod @@ -48,7 +44,6 @@ def display_guestbook(): with client.context(): ancestor_key = ndb.Key("Book", guestbook_name or "*notitle*") greetings = Greeting.query_book(ancestor_key).fetch(20) - # [END query] greeting_blockquotes = [greeting.content for greeting in greetings] return render_template( @@ -58,7 +53,6 @@ def display_guestbook(): ) -# [START submit] @app.route("/sign", methods=["POST"]) def update_guestbook(): # We set the parent key on each 'Greeting' to ensure each guestbook's @@ -73,7 +67,6 @@ def update_guestbook(): content=request.form.get("content", None), ) greeting.put() - # [END submit] return redirect("/?" + urlencode({"guestbook_name": guestbook_name})) @@ -81,4 +74,3 @@ def update_guestbook(): if __name__ == "__main__": # This is used when running locally. app.run(host="127.0.0.1", port=8080, debug=True) -# [END all] diff --git a/appengine/standard/migration/ndb/overview/requirements-test.txt b/appengine/standard/migration/ndb/overview/requirements-test.txt index 7439fc43d48b..454c88a573a3 100644 --- a/appengine/standard/migration/ndb/overview/requirements-test.txt +++ b/appengine/standard/migration/ndb/overview/requirements-test.txt @@ -1,2 +1,6 @@ # pin pytest to 4.6.11 for Python2. pytest==4.6.11; python_version < '3.0' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 \ No newline at end of file diff --git a/appengine/standard/migration/ndb/overview/templates/index.html b/appengine/standard/migration/ndb/overview/templates/index.html index 969634d22b9f..b16f01e0edba 100644 --- a/appengine/standard/migration/ndb/overview/templates/index.html +++ b/appengine/standard/migration/ndb/overview/templates/index.html @@ -43,4 +43,4 @@ - + diff --git a/appengine/standard/migration/storage/main.py b/appengine/standard/migration/storage/main.py index 5fd016dda73c..a290f10dc864 100644 --- a/appengine/standard/migration/storage/main.py +++ b/appengine/standard/migration/storage/main.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flask import Flask, make_response import os +from flask import Flask +from flask import make_response from google.cloud import storage - app = Flask(__name__) diff --git a/appengine/standard/migration/storage/main_test.py b/appengine/standard/migration/storage/main_test.py index 2ba92ce8c1d8..484ee86c09fb 100644 --- a/appengine/standard/migration/storage/main_test.py +++ b/appengine/standard/migration/storage/main_test.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import main import os import uuid +import main + def test_index(): main.app.testing = True diff --git a/appengine/standard/migration/taskqueue/pull-counter/appengine_config.py b/appengine/standard/migration/taskqueue/pull-counter/appengine_config.py index 3004e7377bd6..6323bc77ddfa 100644 --- a/appengine/standard/migration/taskqueue/pull-counter/appengine_config.py +++ b/appengine/standard/migration/taskqueue/pull-counter/appengine_config.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from google.appengine.ext import vendor # appengine_config.py import pkg_resources -from google.appengine.ext import vendor # Set path to your libraries folder. path = "lib" diff --git a/appengine/standard/migration/taskqueue/pull-counter/main.py b/appengine/standard/migration/taskqueue/pull-counter/main.py index e74d3edace48..c9823d9a2622 100644 --- a/appengine/standard/migration/taskqueue/pull-counter/main.py +++ b/appengine/standard/migration/taskqueue/pull-counter/main.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START all] """A simple counter with a Pub/Sub pull subscription, replacing a TaskQueue pull queue, which is not available in Python 3 App Engine runtimes. @@ -21,11 +20,13 @@ import os import time -from flask import Flask, redirect, render_template, request +from flask import Flask +from flask import redirect +from flask import render_template +from flask import request from google.cloud import datastore from google.cloud import pubsub_v1 as pubsub - app = Flask(__name__) datastore_client = datastore.Client() publisher = pubsub.PublisherClient() @@ -97,9 +98,6 @@ def start_handling_tasks(): return "Done" # Never reached except under test -# [END all] - - if __name__ == "__main__": # This is used when running locally only. When deploying to Google App # Engine, a webserver process such as Gunicorn will serve the app. This diff --git a/appengine/standard/migration/taskqueue/pull-counter/main_test.py b/appengine/standard/migration/taskqueue/pull-counter/main_test.py index bee6684d3da9..50c86868a610 100644 --- a/appengine/standard/migration/taskqueue/pull-counter/main_test.py +++ b/appengine/standard/migration/taskqueue/pull-counter/main_test.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest import uuid -import main +import pytest +import main TEST_NAME = "taskqueue-migration-" + str(uuid.uuid4()) TEST_TASKS = {"alpha": 2, "beta": 1, "gamma": 3} diff --git a/appengine/standard/migration/taskqueue/pull-counter/requirements-test.txt b/appengine/standard/migration/taskqueue/pull-counter/requirements-test.txt index e94b3aa1a5c0..454c88a573a3 100644 --- a/appengine/standard/migration/taskqueue/pull-counter/requirements-test.txt +++ b/appengine/standard/migration/taskqueue/pull-counter/requirements-test.txt @@ -1,3 +1,6 @@ -pytest==7.0.1 ; python_version >= "3.0" # pin pytest to 4.6.11 for Python2. pytest==4.6.11; python_version < '3.0' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 \ No newline at end of file diff --git a/appengine/standard/migration/urlfetch/async/main.py b/appengine/standard/migration/urlfetch/async/main.py index 1454f528c720..dea6dca1f5aa 100644 --- a/appengine/standard/migration/urlfetch/async/main.py +++ b/appengine/standard/migration/urlfetch/async/main.py @@ -14,12 +14,12 @@ # [START app] import logging +from time import sleep -from flask import Flask, make_response - +from flask import Flask +from flask import make_response # [START imports] from requests_futures.sessions import FuturesSession -from time import sleep # [END imports] diff --git a/appengine/standard/migration/urlfetch/async/main_test.py b/appengine/standard/migration/urlfetch/async/main_test.py index b418d31c5ab1..996f62e5672f 100644 --- a/appengine/standard/migration/urlfetch/async/main_test.py +++ b/appengine/standard/migration/urlfetch/async/main_test.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import main -import pytest import sys +import pytest + +import main + @pytest.mark.skipif(sys.version_info < (3, 0), reason="no urlfetch adapter in test env") def test_index(): diff --git a/appengine/standard/migration/urlfetch/requests/main_test.py b/appengine/standard/migration/urlfetch/requests/main_test.py index fa982fdf99e9..822f4de53d35 100644 --- a/appengine/standard/migration/urlfetch/requests/main_test.py +++ b/appengine/standard/migration/urlfetch/requests/main_test.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import main -import pytest import sys +import pytest + +import main + @pytest.mark.skipif(sys.version_info < (3, 0), reason="no urlfetch adapter in test env") def test_index(): diff --git a/appengine/standard/ndb/overview/main.py b/appengine/standard/ndb/overview/main.py index ab4cfb1f79ff..a502ab1c8fed 100644 --- a/appengine/standard/ndb/overview/main.py +++ b/appengine/standard/ndb/overview/main.py @@ -20,7 +20,7 @@ For more information, see README.md """ -# [START all] +# [START gae_ndb_overview] import cgi import textwrap import urllib @@ -30,15 +30,15 @@ import webapp2 -# [START greeting] +# [START gae_ndb_overview_greeting] class Greeting(ndb.Model): """Models an individual Guestbook entry with content and date.""" content = ndb.StringProperty() date = ndb.DateTimeProperty(auto_now_add=True) - # [END greeting] + # [END gae_ndb_overview_greeting] - # [START query] + # [START gae_ndb_overview_query] @classmethod def query_book(cls, ancestor_key): return cls.query(ancestor=ancestor_key).order(-cls.date) @@ -50,7 +50,7 @@ def get(self): guestbook_name = self.request.get("guestbook_name") ancestor_key = ndb.Key("Book", guestbook_name or "*notitle*") greetings = Greeting.query_book(ancestor_key).fetch(20) - # [END query] + # [END gae_ndb_overview_query] greeting_blockquotes = [] for greeting in greetings: @@ -89,7 +89,7 @@ def get(self): ) -# [START submit] +# [START gae_ndb_overview_submit] class SubmitForm(webapp2.RequestHandler): def post(self): # We set the parent key on each 'Greeting' to ensure each guestbook's @@ -100,9 +100,9 @@ def post(self): content=self.request.get("content"), ) greeting.put() - # [END submit] + # [END gae_ndb_overview_submit] self.redirect("/?" + urllib.urlencode({"guestbook_name": guestbook_name})) app = webapp2.WSGIApplication([("/", MainPage), ("/sign", SubmitForm)]) -# [END all] +# [END gae_ndb_overview] diff --git a/appengine/standard/ndb/overview/requirements-test.txt b/appengine/standard/ndb/overview/requirements-test.txt new file mode 100644 index 000000000000..454c88a573a3 --- /dev/null +++ b/appengine/standard/ndb/overview/requirements-test.txt @@ -0,0 +1,6 @@ +# pin pytest to 4.6.11 for Python2. +pytest==4.6.11; python_version < '3.0' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 \ No newline at end of file diff --git a/appengine/standard/ndb/overview/requirements.txt b/appengine/standard/ndb/overview/requirements.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/appengine/standard/noxfile-template.py b/appengine/standard/noxfile-template.py index df2580bdf432..14aa1d669fd1 100644 --- a/appengine/standard/noxfile-template.py +++ b/appengine/standard/noxfile-template.py @@ -37,7 +37,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string @@ -79,10 +79,10 @@ def get_pytest_env_vars(): # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] # Any default versions that should be ignored. -IGNORED_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] +IGNORED_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) diff --git a/appengine/standard/pubsub/requirements-test.txt b/appengine/standard/pubsub/requirements-test.txt index 7439fc43d48b..ffbcaae7cb48 100644 --- a/appengine/standard/pubsub/requirements-test.txt +++ b/appengine/standard/pubsub/requirements-test.txt @@ -1,2 +1,6 @@ # pin pytest to 4.6.11 for Python2. pytest==4.6.11; python_version < '3.0' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 diff --git a/appengine/standard/pubsub/templates/index.html b/appengine/standard/pubsub/templates/index.html index 9054eaa490f6..914f8d07353f 100755 --- a/appengine/standard/pubsub/templates/index.html +++ b/appengine/standard/pubsub/templates/index.html @@ -28,11 +28,9 @@

Note: because your application is likely running multiple instances, each instance will have a different list of messages.

-
- diff --git a/appengine/standard/storage/appengine-client/main.py b/appengine/standard/storage/appengine-client/main.py index 473a40b5f656..4681a2e6ce1b 100644 --- a/appengine/standard/storage/appengine-client/main.py +++ b/appengine/standard/storage/appengine-client/main.py @@ -14,32 +14,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START sample] +# [START gae_storage_sample] """A sample app that uses GCS client to operate on bucket and file.""" -# [START imports] +# [START gae_storage_imports] import os import cloudstorage from google.appengine.api import app_identity import webapp2 +# [END gae_storage_imports] -# [END imports] - -# [START retries] cloudstorage.set_default_retry_params( cloudstorage.RetryParams( initial_delay=0.2, max_delay=5.0, backoff_factor=2, max_retry_period=15 ) ) -# [END retries] class MainPage(webapp2.RequestHandler): """Main page for GCS demo application.""" - # [START get_default_bucket] + # [START gae_storage_get_default_bucket] def get(self): bucket_name = os.environ.get( "BUCKET_NAME", app_identity.get_default_gcs_bucket_name() @@ -52,7 +49,7 @@ def get(self): ) ) self.response.write("Using bucket name: {}\n\n".format(bucket_name)) - # [END get_default_bucket] + # [END gae_storage_get_default_bucket] bucket = "/" + bucket_name filename = bucket + "/demo-testfile" @@ -79,7 +76,7 @@ def get(self): self.delete_files() self.response.write("\n\nThe demo ran successfully!\n") - # [START write] + # [START gae_storage_write] def create_file(self, filename): """Create a file.""" @@ -98,10 +95,9 @@ def create_file(self, filename): cloudstorage_file.write("abcde\n") cloudstorage_file.write("f" * 1024 * 4 + "\n") self.tmp_filenames_to_clean_up.append(filename) + # [END gae_storage_write] - # [END write] - - # [START read] + # [START gae_storage_read] def read_file(self, filename): self.response.write("Abbreviated file content (first line and last 1K):\n") @@ -109,8 +105,7 @@ def read_file(self, filename): self.response.write(cloudstorage_file.readline()) cloudstorage_file.seek(-1024, os.SEEK_END) self.response.write(cloudstorage_file.read()) - - # [END read] + # [END gae_storage_read] def stat_file(self, filename): self.response.write("File stat:\n") @@ -126,7 +121,7 @@ def create_files_for_list_bucket(self, bucket): for f in filenames: self.create_file(f) - # [START list_bucket] + # [START gae_storage_list_bucket] def list_bucket(self, bucket): """Create several files and paginate through them.""" @@ -147,8 +142,7 @@ def list_bucket(self, bucket): stats = cloudstorage.listbucket( bucket + "/foo", max_keys=page_size, marker=stat.filename ) - - # [END list_bucket] + # [END gae_storage_list_bucket] def list_bucket_directory_mode(self, bucket): self.response.write("Listbucket directory mode result:\n") @@ -162,7 +156,6 @@ def list_bucket_directory_mode(self, bucket): self.response.write(" {}".format(subdir_file)) self.response.write("\n") - # [START delete_files] def delete_files(self): self.response.write("Deleting files...\n") for filename in self.tmp_filenames_to_clean_up: @@ -173,8 +166,5 @@ def delete_files(self): pass -# [END delete_files] - - app = webapp2.WSGIApplication([("/", MainPage)], debug=True) -# [END sample] +# [END gae_storage_sample] diff --git a/appengine/standard/storage/appengine-client/requirements-test.txt b/appengine/standard/storage/appengine-client/requirements-test.txt index c607ba3b2abb..b7e6a172e184 100644 --- a/appengine/standard/storage/appengine-client/requirements-test.txt +++ b/appengine/standard/storage/appengine-client/requirements-test.txt @@ -1,3 +1,8 @@ # pin pytest to 4.6.11 for Python2. pytest==4.6.11; python_version < '3.0' WebTest==2.0.35; python_version < '3.0' +# 2025-01-14 - Added support for Python 3 +pytest==8.3.2; python_version >= '3.0' +WebTest==3.0.1; python_version >= '3.0' +six==1.16.0 + diff --git a/appengine/standard/taskqueue/counter/requirements-test.txt b/appengine/standard/taskqueue/counter/requirements-test.txt new file mode 100644 index 000000000000..454c88a573a3 --- /dev/null +++ b/appengine/standard/taskqueue/counter/requirements-test.txt @@ -0,0 +1,6 @@ +# pin pytest to 4.6.11 for Python2. +pytest==4.6.11; python_version < '3.0' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 \ No newline at end of file diff --git a/appengine/standard/taskqueue/counter/requirements.txt b/appengine/standard/taskqueue/counter/requirements.txt new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/appengine/standard/taskqueue/counter/requirements.txt @@ -0,0 +1 @@ + diff --git a/appengine/standard/taskqueue/counter/worker.py b/appengine/standard/taskqueue/counter/worker.py index d930819428c6..1f8e8db4ba51 100644 --- a/appengine/standard/taskqueue/counter/worker.py +++ b/appengine/standard/taskqueue/counter/worker.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START all] - from google.appengine.ext import ndb import webapp2 @@ -41,4 +39,3 @@ def update_counter(): app = webapp2.WSGIApplication([("/update_counter", UpdateCounterHandler)], debug=True) -# [END all] diff --git a/appengine/standard/taskqueue/pull-counter/main.py b/appengine/standard/taskqueue/pull-counter/main.py index 4c78fb1a326d..24b27763a11f 100644 --- a/appengine/standard/taskqueue/pull-counter/main.py +++ b/appengine/standard/taskqueue/pull-counter/main.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START all] """A simple counter with App Engine pull queue.""" import logging @@ -41,7 +40,6 @@ def get(self): counter_template = JINJA_ENV.get_template("counter.html") self.response.out.write(counter_template.render(template_values)) - # [START adding_task] def post(self): key = self.request.get("key") if key: @@ -49,8 +47,6 @@ def post(self): queue.add(taskqueue.Task(payload="", method="PULL", tag=key)) self.redirect("/") - # [END adding_task] - @ndb.transactional def update_counter(key, tasks): @@ -91,4 +87,3 @@ def get(self): app = webapp2.WSGIApplication( [("/", CounterHandler), ("/_ah/start", CounterWorker)], debug=True ) -# [END all] diff --git a/appengine/standard/taskqueue/pull-counter/requirements-test.txt b/appengine/standard/taskqueue/pull-counter/requirements-test.txt new file mode 100644 index 000000000000..454c88a573a3 --- /dev/null +++ b/appengine/standard/taskqueue/pull-counter/requirements-test.txt @@ -0,0 +1,6 @@ +# pin pytest to 4.6.11 for Python2. +pytest==4.6.11; python_version < '3.0' + +# pytest==8.3.4 and six==1.17.0 for Python3. +pytest==8.3.4; python_version >= '3.0' +six==1.17.0 \ No newline at end of file diff --git a/appengine/standard/taskqueue/pull-counter/requirements.txt b/appengine/standard/taskqueue/pull-counter/requirements.txt new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/appengine/standard/taskqueue/pull-counter/requirements.txt @@ -0,0 +1 @@ + diff --git a/appengine/standard_python3/bundled-services/blobstore/django/noxfile_config.py b/appengine/standard_python3/bundled-services/blobstore/django/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/blobstore/django/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/blobstore/django/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/blobstore/flask/noxfile_config.py b/appengine/standard_python3/bundled-services/blobstore/flask/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/blobstore/flask/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/blobstore/flask/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/blobstore/wsgi/noxfile_config.py b/appengine/standard_python3/bundled-services/blobstore/wsgi/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/blobstore/wsgi/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/blobstore/wsgi/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/deferred/django/noxfile_config.py b/appengine/standard_python3/bundled-services/deferred/django/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/deferred/django/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/deferred/django/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/deferred/flask/noxfile_config.py b/appengine/standard_python3/bundled-services/deferred/flask/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/deferred/flask/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/deferred/flask/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/deferred/wsgi/noxfile_config.py b/appengine/standard_python3/bundled-services/deferred/wsgi/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/deferred/wsgi/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/deferred/wsgi/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/mail/django/noxfile_config.py b/appengine/standard_python3/bundled-services/mail/django/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/mail/django/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/mail/django/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/mail/flask/noxfile_config.py b/appengine/standard_python3/bundled-services/mail/flask/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/mail/flask/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/mail/flask/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/bundled-services/mail/wsgi/noxfile_config.py b/appengine/standard_python3/bundled-services/mail/wsgi/noxfile_config.py index 51f0f5dd8143..0bd124013a3b 100644 --- a/appengine/standard_python3/bundled-services/mail/wsgi/noxfile_config.py +++ b/appengine/standard_python3/bundled-services/mail/wsgi/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/standard_python3/django/noxfile_config.py b/appengine/standard_python3/django/noxfile_config.py index 49c43054020b..2a0073f33fdf 100644 --- a/appengine/standard_python3/django/noxfile_config.py +++ b/appengine/standard_python3/django/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string diff --git a/appengine/standard_python3/pubsub/templates/index.html b/appengine/standard_python3/pubsub/templates/index.html index f8941d0b5940..ceb76945c390 100644 --- a/appengine/standard_python3/pubsub/templates/index.html +++ b/appengine/standard_python3/pubsub/templates/index.html @@ -42,11 +42,9 @@

Note: because your application is likely running multiple instances, each instance will have a different list of messages.

-
- diff --git a/automl/snippets/noxfile_config.py b/automl/snippets/noxfile_config.py index fa13db73249e..ef111e5e3098 100644 --- a/automl/snippets/noxfile_config.py +++ b/automl/snippets/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them # "enforce_type_hints": False, diff --git a/cloud-media-livestream/keypublisher/noxfile_config.py b/cloud-media-livestream/keypublisher/noxfile_config.py index 02ccd9eb1566..3f0b74f9b96c 100644 --- a/cloud-media-livestream/keypublisher/noxfile_config.py +++ b/cloud-media-livestream/keypublisher/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/composer/airflow_1_samples/noxfile_config.py b/composer/airflow_1_samples/noxfile_config.py index c069c66d7487..7185f4151008 100644 --- a/composer/airflow_1_samples/noxfile_config.py +++ b/composer/airflow_1_samples/noxfile_config.py @@ -32,7 +32,7 @@ # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to numpy compilation failure. # Skipping 3.6 and 3.7, they are more out of date - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/composer/workflows/kubernetes_pod_operator_c2.py b/composer/workflows/kubernetes_pod_operator_c2.py index 94e3655cc44e..65e432896950 100644 --- a/composer/workflows/kubernetes_pod_operator_c2.py +++ b/composer/workflows/kubernetes_pod_operator_c2.py @@ -18,7 +18,7 @@ from airflow import models from airflow.kubernetes.secret import Secret -from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import ( +from airflow.providers.cncf.kubernetes.operators.pod import ( KubernetesPodOperator, ) from kubernetes.client import models as k8s_models diff --git a/compute/encryption/generate_wrapped_rsa_key.py b/compute/encryption/generate_wrapped_rsa_key.py index c291576bac43..3a62eac55db0 100644 --- a/compute/encryption/generate_wrapped_rsa_key.py +++ b/compute/encryption/generate_wrapped_rsa_key.py @@ -19,7 +19,6 @@ For more information, see the README.md under /compute. """ -# [START all] # [START compute_generate_wrapped_rsa_key] import argparse import base64 @@ -119,4 +118,3 @@ def main(key_file: Optional[str]) -> None: main(args.key_file) # [END compute_generate_wrapped_rsa_key] -# [END all] diff --git a/compute/metadata/main.py b/compute/metadata/main.py index 83c515971b80..692b188c0640 100644 --- a/compute/metadata/main.py +++ b/compute/metadata/main.py @@ -19,8 +19,7 @@ For more information, see the README.md under /compute. """ -# [START all] - +# [START compute_metadata_watch_maintenance_notices] import time from typing import Callable, NoReturn, Optional @@ -32,8 +31,7 @@ def wait_for_maintenance(callback: Callable[[Optional[str]], None]) -> NoReturn: - """ - Start an infinite loop waiting for maintenance signal. + """Start an infinite loop waiting for maintenance signal. Args: callback: Function to be called when a maintenance is scheduled. @@ -43,7 +41,7 @@ def wait_for_maintenance(callback: Callable[[Optional[str]], None]) -> NoReturn: """ url = METADATA_URL + "instance/maintenance-event" last_maintenance_event = None - # [START hanging_get] + # [START compute_metadata_hanging_get_etag] last_etag = "0" while True: @@ -61,7 +59,7 @@ def wait_for_maintenance(callback: Callable[[Optional[str]], None]) -> NoReturn: r.raise_for_status() last_etag = r.headers["etag"] - # [END hanging_get] + # [END compute_metadata_hanging_get_etag] if r.text == "NONE": maintenance_event = None @@ -74,8 +72,7 @@ def wait_for_maintenance(callback: Callable[[Optional[str]], None]) -> NoReturn: def maintenance_callback(event: Optional[str]) -> None: - """ - Example callback function to handle the maintenance event. + """Example callback function to handle the maintenance event. Args: event: details about scheduled maintenance. @@ -92,4 +89,4 @@ def main(): if __name__ == "__main__": main() -# [END all] +# [END compute_metadata_watch_maintenance_notices] diff --git a/compute/metadata/vm_identity.py b/compute/metadata/vm_identity.py index 4307ca7ba0ce..8cb89ed36759 100644 --- a/compute/metadata/vm_identity.py +++ b/compute/metadata/vm_identity.py @@ -12,20 +12,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" -Example of verifying Google Compute Engine virtual machine identity. +"""Example of verifying Google Compute Engine virtual machine identity. This sample will work only on a GCE virtual machine, as it relies on -communication with metadata server (https://cloud.google.com/compute/docs/storing-retrieving-metadata). +communication with metadata server +(https://cloud.google.com/compute/docs/storing-retrieving-metadata). -Example is used on: https://cloud.google.com/compute/docs/instances/verifying-instance-identity +Example is used on: +https://cloud.google.com/compute/docs/instances/verifying-instance-identity """ import pprint # [START compute_vm_identity_verify_token] import google.auth.transport.requests from google.oauth2 import id_token - # [END compute_vm_identity_verify_token] # [START compute_vm_identity_acquire_token] @@ -78,17 +78,12 @@ def acquire_token( # Extract and return the token from the response. r.raise_for_status() return r.text - - # [END compute_vm_identity_acquire_token] # [START compute_vm_identity_verify_token] - - def verify_token(token: str, audience: str) -> dict: - """ - Verify token signature and return the token payload. + """Verify token signature and return the token payload. Args: token: the JSON Web Token received from the metadata server to @@ -102,8 +97,6 @@ def verify_token(token: str, audience: str) -> dict: request = google.auth.transport.requests.Request() payload = id_token.verify_token(token, request=request, audience=audience) return payload - - # [END compute_vm_identity_verify_token] diff --git a/compute/metadata/vm_identity_test.py b/compute/metadata/vm_identity_test.py index db1f1bf2052a..7e0cd18583b9 100644 --- a/compute/metadata/vm_identity_test.py +++ b/compute/metadata/vm_identity_test.py @@ -19,6 +19,7 @@ import vm_identity + AUDIENCE = "http://www.testing.com" diff --git a/contentwarehouse/snippets/noxfile_config.py b/contentwarehouse/snippets/noxfile_config.py index 9dcea352d7db..a85697d4eb5b 100644 --- a/contentwarehouse/snippets/noxfile_config.py +++ b/contentwarehouse/snippets/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/custom-containers/miniconda/noxfile_config.py b/dataflow/custom-containers/miniconda/noxfile_config.py index 5a3de2913023..fb2bcbdea221 100644 --- a/dataflow/custom-containers/miniconda/noxfile_config.py +++ b/dataflow/custom-containers/miniconda/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ We're opting out of all Python versions except 3.9. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/custom-containers/minimal/noxfile_config.py b/dataflow/custom-containers/minimal/noxfile_config.py index 5a3de2913023..fb2bcbdea221 100644 --- a/dataflow/custom-containers/minimal/noxfile_config.py +++ b/dataflow/custom-containers/minimal/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ We're opting out of all Python versions except 3.9. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/custom-containers/ubuntu/noxfile_config.py b/dataflow/custom-containers/ubuntu/noxfile_config.py index 5a3de2913023..fb2bcbdea221 100644 --- a/dataflow/custom-containers/ubuntu/noxfile_config.py +++ b/dataflow/custom-containers/ubuntu/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ We're opting out of all Python versions except 3.9. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/extensible-templates/noxfile_config.py b/dataflow/extensible-templates/noxfile_config.py index 7f490302491d..d15bd45490fc 100644 --- a/dataflow/extensible-templates/noxfile_config.py +++ b/dataflow/extensible-templates/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/flex-templates/pipeline_with_dependencies/noxfile_config.py b/dataflow/flex-templates/pipeline_with_dependencies/noxfile_config.py index 460411fffee7..8df70c1108bf 100644 --- a/dataflow/flex-templates/pipeline_with_dependencies/noxfile_config.py +++ b/dataflow/flex-templates/pipeline_with_dependencies/noxfile_config.py @@ -19,5 +19,5 @@ # > ℹ️ We're opting out of all Python versions except 3.11. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12", "3.13"], } diff --git a/dataflow/flex-templates/streaming_beam/noxfile_config.py b/dataflow/flex-templates/streaming_beam/noxfile_config.py index a9bd3c39663e..3c3fb5c040e6 100644 --- a/dataflow/flex-templates/streaming_beam/noxfile_config.py +++ b/dataflow/flex-templates/streaming_beam/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ We're opting out of all Python versions except 3.8. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/gemma-flex-template/noxfile_config.py b/dataflow/gemma-flex-template/noxfile_config.py index d483d3f479d2..7e6ba7ba31ba 100644 --- a/dataflow/gemma-flex-template/noxfile_config.py +++ b/dataflow/gemma-flex-template/noxfile_config.py @@ -19,7 +19,7 @@ # Opting out of all Python versions except 3.10. # The Python version used is defined by the Dockerfile and the job # submission enviornment must match. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], "envs": { "PYTHONPATH": ".." }, diff --git a/dataflow/gemma/noxfile_config.py b/dataflow/gemma/noxfile_config.py index 32432cccd4a2..7b3b1b9ebf6d 100644 --- a/dataflow/gemma/noxfile_config.py +++ b/dataflow/gemma/noxfile_config.py @@ -19,7 +19,7 @@ # Opting out of all Python versions except 3.11. # The Python version used is defined by the Dockerfile and the job # submission enviornment must match. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12", "3.13"], "envs": { "PYTHONPATH": ".." }, diff --git a/dataflow/gpu-examples/pytorch-minimal/noxfile_config.py b/dataflow/gpu-examples/pytorch-minimal/noxfile_config.py index 6a9924b7ab63..99b1fb47b8e8 100644 --- a/dataflow/gpu-examples/pytorch-minimal/noxfile_config.py +++ b/dataflow/gpu-examples/pytorch-minimal/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ We're opting out of all Python versions except 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/gpu-examples/tensorflow-landsat-prime/noxfile_config.py b/dataflow/gpu-examples/tensorflow-landsat-prime/noxfile_config.py index d70b4fc78ca4..376ea30e3b6e 100644 --- a/dataflow/gpu-examples/tensorflow-landsat-prime/noxfile_config.py +++ b/dataflow/gpu-examples/tensorflow-landsat-prime/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/gpu-examples/tensorflow-landsat/noxfile_config.py b/dataflow/gpu-examples/tensorflow-landsat/noxfile_config.py index 830ebbb0f432..baf977898838 100644 --- a/dataflow/gpu-examples/tensorflow-landsat/noxfile_config.py +++ b/dataflow/gpu-examples/tensorflow-landsat/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/gpu-examples/tensorflow-minimal/noxfile_config.py b/dataflow/gpu-examples/tensorflow-minimal/noxfile_config.py index 830ebbb0f432..baf977898838 100644 --- a/dataflow/gpu-examples/tensorflow-minimal/noxfile_config.py +++ b/dataflow/gpu-examples/tensorflow-minimal/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/run-inference/noxfile_config.py b/dataflow/run-inference/noxfile_config.py index 6fa4b4f78691..a2c4bb212c87 100644 --- a/dataflow/run-inference/noxfile_config.py +++ b/dataflow/run-inference/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Only test on Python 3.11. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/dataflow/snippets/noxfile_config.py b/dataflow/snippets/noxfile_config.py index 3c61ecbdff31..dd0def22c9e0 100644 --- a/dataflow/snippets/noxfile_config.py +++ b/dataflow/snippets/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/datalabeling/README.md b/datalabeling/README.md deleted file mode 100644 index 70a4d55b0de9..000000000000 --- a/datalabeling/README.md +++ /dev/null @@ -1,3 +0,0 @@ -These samples have been moved. - -https://github.com/googleapis/python-datalabeling/tree/main/samples diff --git a/dataproc/README.md b/dataproc/README.md deleted file mode 100644 index bbe6a2977ea8..000000000000 --- a/dataproc/README.md +++ /dev/null @@ -1,3 +0,0 @@ -These samples have been moved. - -https://github.com/googleapis/python-dataproc/tree/main/samples diff --git a/datastore/cloud-ndb/noxfile_config.py b/datastore/cloud-ndb/noxfile_config.py index 13b3c1bb5c51..25d1d4e081c2 100644 --- a/datastore/cloud-ndb/noxfile_config.py +++ b/datastore/cloud-ndb/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them # "enforce_type_hints": True, diff --git a/dialogflow-cx/noxfile_config.py b/dialogflow-cx/noxfile_config.py index 67bebf20857a..462f6d428f75 100644 --- a/dialogflow-cx/noxfile_config.py +++ b/dialogflow-cx/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11", "3.12", "3.13"], # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string diff --git a/dialogflow/noxfile_config.py b/dialogflow/noxfile_config.py index 99dde0533ddb..3285f14ee146 100644 --- a/dialogflow/noxfile_config.py +++ b/dialogflow/noxfile_config.py @@ -25,7 +25,7 @@ # # Disable these tests for now until there is time for significant refactoring # related to exception handling and timeouts. - "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/dns/api/noxfile_config.py b/dns/api/noxfile_config.py index 13b3c1bb5c51..25d1d4e081c2 100644 --- a/dns/api/noxfile_config.py +++ b/dns/api/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them # "enforce_type_hints": True, diff --git a/endpoints/getting-started/noxfile_config.py b/endpoints/getting-started/noxfile_config.py index 13b3c1bb5c51..25d1d4e081c2 100644 --- a/endpoints/getting-started/noxfile_config.py +++ b/endpoints/getting-started/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them # "enforce_type_hints": True, diff --git a/functions/ocr/app/noxfile_config.py b/functions/ocr/app/noxfile_config.py index 1772d5edd5c1..c20434b7d70d 100644 --- a/functions/ocr/app/noxfile_config.py +++ b/functions/ocr/app/noxfile_config.py @@ -24,7 +24,7 @@ # You can opt out from the test for specific Python versions. # google-cloud-translate==3.12.1 is incompatible with Python 12. # Staying with 3.11 testing for now. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Declare optional test sessions you want to opt-in. Currently we # have the following optional test sessions: # 'cloud_run' # Test session for Cloud Run application. diff --git a/jobs/v3/api_client/location_search_sample.py b/jobs/v3/api_client/location_search_sample.py index 89983a056c93..9ea6b9e0c194 100755 --- a/jobs/v3/api_client/location_search_sample.py +++ b/jobs/v3/api_client/location_search_sample.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START instantiate] import os import time @@ -22,10 +21,9 @@ client_service = build("jobs", "v3") parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"] -# [END instantiate] -# [START basic_location_search] +# [START job_basic_location_search] def basic_location_search(client_service, company_name, location, distance): request_metadata = { "user_id": "HashedUserId", @@ -47,10 +45,10 @@ def basic_location_search(client_service, company_name, location, distance): print(response) -# [END basic_location_search] +# [END job_basic_location_search] -# [START keyword_location_search] +# [START job_keyword_location_search] def keyword_location_search(client_service, company_name, location, distance, keyword): request_metadata = { "user_id": "HashedUserId", @@ -72,10 +70,10 @@ def keyword_location_search(client_service, company_name, location, distance, ke print(response) -# [END keyword_location_search] +# [END job_keyword_location_search] -# [START city_location_search] +# [START job_city_location_search] def city_location_search(client_service, company_name, location): request_metadata = { "user_id": "HashedUserId", @@ -97,10 +95,10 @@ def city_location_search(client_service, company_name, location): print(response) -# [END city_location_search] +# [END job_city_location_search] -# [START multi_locations_search] +# [START job_multi_locations_search] def multi_locations_search( client_service, company_name, location1, distance1, location2 ): @@ -125,10 +123,10 @@ def multi_locations_search( print(response) -# [END multi_locations_search] +# [END job_multi_locations_search] -# [START broadening_location_search] +# [START job_broadening_location_search] def broadening_location_search(client_service, company_name, location): request_metadata = { "user_id": "HashedUserId", @@ -151,7 +149,7 @@ def broadening_location_search(client_service, company_name, location): print(response) -# [END broadening_location_search] +# [END job_broadening_location_search] location = "Mountain View, CA" diff --git a/kubernetes_engine/django_tutorial/requirements.txt b/kubernetes_engine/django_tutorial/requirements.txt index 1cc3dd293f1d..230192b01bca 100644 --- a/kubernetes_engine/django_tutorial/requirements.txt +++ b/kubernetes_engine/django_tutorial/requirements.txt @@ -1,6 +1,6 @@ -Django==5.1.4; python_version >= "3.10" -Django==4.2.17; python_version >= "3.8" and python_version < "3.10" -Django==3.2.25; python_version < "3.8" +Django==5.1.5; python_version >= "3.10" +Django==5.1.5; python_version >= "3.8" and python_version < "3.10" +Django==5.1.5; python_version < "3.8" # Uncomment the mysqlclient requirement if you are using MySQL rather than # PostgreSQL. You must also have a MySQL client installed in that case. #mysqlclient==1.4.1 diff --git a/language/snippets/classify_text/noxfile_config.py b/language/snippets/classify_text/noxfile_config.py index 13b3c1bb5c51..25d1d4e081c2 100644 --- a/language/snippets/classify_text/noxfile_config.py +++ b/language/snippets/classify_text/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them # "enforce_type_hints": True, diff --git a/ml_engine/online_prediction/noxfile_config.py b/ml_engine/online_prediction/noxfile_config.py index f76df3bcab22..1012d419c8cc 100644 --- a/ml_engine/online_prediction/noxfile_config.py +++ b/ml_engine/online_prediction/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/noxfile-template.py b/noxfile-template.py index 61bb9a3f2525..d1d88ec4132f 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -88,7 +88,7 @@ def get_pytest_env_vars() -> dict[str, str]: # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12"] +ALL_VERSIONS = ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] diff --git a/noxfile_config.py b/noxfile_config.py index 457e86f5413c..1c46fbabc065 100644 --- a/noxfile_config.py +++ b/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11", "3.12"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/geospatial-classification/noxfile_config.py b/people-and-planet-ai/geospatial-classification/noxfile_config.py index 5bc74bde9dca..aa2149abb0d4 100644 --- a/people-and-planet-ai/geospatial-classification/noxfile_config.py +++ b/people-and-planet-ai/geospatial-classification/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # > ℹ️ Test only on Python 3.10. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/image-classification/noxfile_config.py b/people-and-planet-ai/image-classification/noxfile_config.py index aafe920cea5b..6048504d2cd1 100644 --- a/people-and-planet-ai/image-classification/noxfile_config.py +++ b/people-and-planet-ai/image-classification/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # NOTE: Apache Beam does not currently support Python 3.12. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/land-cover-classification/noxfile_config.py b/people-and-planet-ai/land-cover-classification/noxfile_config.py index 2a0458698b45..228e1eb58f59 100644 --- a/people-and-planet-ai/land-cover-classification/noxfile_config.py +++ b/people-and-planet-ai/land-cover-classification/noxfile_config.py @@ -26,7 +26,7 @@ # https://cloud.google.com/dataflow/docs/support/beam-runtime-support # "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11"], # Temp disable until team has time for refactoring tests - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/timeseries-classification/noxfile_config.py b/people-and-planet-ai/timeseries-classification/noxfile_config.py index b61673d46906..f8531486af23 100644 --- a/people-and-planet-ai/timeseries-classification/noxfile_config.py +++ b/people-and-planet-ai/timeseries-classification/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/weather-forecasting/tests/dataset_tests/noxfile_config.py b/people-and-planet-ai/weather-forecasting/tests/dataset_tests/noxfile_config.py index 556f95b09333..81b47f2ab34d 100644 --- a/people-and-planet-ai/weather-forecasting/tests/dataset_tests/noxfile_config.py +++ b/people-and-planet-ai/weather-forecasting/tests/dataset_tests/noxfile_config.py @@ -25,7 +25,7 @@ # 💡 Only test with Python 3.10 # "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11"], # Temp disable until team has time for refactoring tests - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/weather-forecasting/tests/overview_tests/noxfile_config.py b/people-and-planet-ai/weather-forecasting/tests/overview_tests/noxfile_config.py index b5d2890bfa83..08cdcbbe707d 100644 --- a/people-and-planet-ai/weather-forecasting/tests/overview_tests/noxfile_config.py +++ b/people-and-planet-ai/weather-forecasting/tests/overview_tests/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # 💡 Only test with Python 3.10 - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/weather-forecasting/tests/predictions_tests/noxfile_config.py b/people-and-planet-ai/weather-forecasting/tests/predictions_tests/noxfile_config.py index b5d2890bfa83..08cdcbbe707d 100644 --- a/people-and-planet-ai/weather-forecasting/tests/predictions_tests/noxfile_config.py +++ b/people-and-planet-ai/weather-forecasting/tests/predictions_tests/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # 💡 Only test with Python 3.10 - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/people-and-planet-ai/weather-forecasting/tests/training_tests/noxfile_config.py b/people-and-planet-ai/weather-forecasting/tests/training_tests/noxfile_config.py index b5d2890bfa83..08cdcbbe707d 100644 --- a/people-and-planet-ai/weather-forecasting/tests/training_tests/noxfile_config.py +++ b/people-and-planet-ai/weather-forecasting/tests/training_tests/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # 💡 Only test with Python 3.10 - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/profiler/appengine/flexible/noxfile_config.py b/profiler/appengine/flexible/noxfile_config.py index e7b8cee0641d..5c4a4b39a257 100644 --- a/profiler/appengine/flexible/noxfile_config.py +++ b/profiler/appengine/flexible/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # 3.11 is currently unsupported - "ignored_versions": ["2.7", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/profiler/appengine/standard_python37/noxfile_config.py b/profiler/appengine/standard_python37/noxfile_config.py index 0a85595cd947..f61d176ce12e 100644 --- a/profiler/appengine/standard_python37/noxfile_config.py +++ b/profiler/appengine/standard_python37/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.8", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/pubsub/streaming-analytics/noxfile_config.py b/pubsub/streaming-analytics/noxfile_config.py index 7871cc82a4a4..783945807ee1 100644 --- a/pubsub/streaming-analytics/noxfile_config.py +++ b/pubsub/streaming-analytics/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/run/django/requirements.txt b/run/django/requirements.txt index 0b6f246258df..51a43e1b585a 100644 --- a/run/django/requirements.txt +++ b/run/django/requirements.txt @@ -1,5 +1,5 @@ -Django==5.1.4; python_version >= "3.10" -Django==4.2.17; python_version >= "3.8" and python_version < "3.10" +Django==5.1.5; python_version >= "3.10" +Django==4.2.18; python_version >= "3.8" and python_version < "3.10" Django==3.2.25; python_version < "3.8" django-storages[google]==1.14.4 django-environ==0.11.2 diff --git a/run/idp-sql/noxfile_config.py b/run/idp-sql/noxfile_config.py index fbc542e64a4b..cdad4b250333 100644 --- a/run/idp-sql/noxfile_config.py +++ b/run/idp-sql/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # We only run the cloud run tests in py39 session. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.12", "3.13"], "enforce_type_hints": True, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a diff --git a/service_extensions/callouts/add_header/noxfile_config.py b/service_extensions/callouts/add_header/noxfile_config.py index e82267556e2d..ef7d95212ec4 100644 --- a/service_extensions/callouts/add_header/noxfile_config.py +++ b/service_extensions/callouts/add_header/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # Supported versions are >= 3.7 as per https://pypi.org/project/grpcio/ - "ignored_versions": ["2.7", "3.6", "3.7", "3.12"], # "3.9", "3.8", "3.10", "3.11" + "ignored_versions": ["2.7", "3.6", "3.7", "3.12", "3.13"], # "3.9", "3.8", "3.10", "3.11" # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/speech/microphone/noxfile_config.py b/speech/microphone/noxfile_config.py index 24c67bedb95f..eb964b8ab7d6 100644 --- a/speech/microphone/noxfile_config.py +++ b/speech/microphone/noxfile_config.py @@ -15,7 +15,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/storagecontrol/noxfile_config.py b/storagecontrol/noxfile_config.py index 8568231c3061..ebd23ea63354 100644 --- a/storagecontrol/noxfile_config.py +++ b/storagecontrol/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.7", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/tpu/queued_resources_delete.py b/tpu/queued_resources_delete.py index db503d087191..8586c708c85e 100644 --- a/tpu/queued_resources_delete.py +++ b/tpu/queued_resources_delete.py @@ -17,7 +17,7 @@ def delete_queued_resource( project_id: str, zone: str, queued_resource_name: str ) -> None: - # [START tpu_queued_resource_delete] + # [START tpu_queued_resources_delete] from google.cloud import tpu_v2alpha1 # TODO(developer): Update and un-comment below lines @@ -38,7 +38,7 @@ def delete_queued_resource( print(f"Error deleting resource: {e}") print(f"Queued resource '{queued_resource_name}' successfully deleted.") - # [END tpu_queued_resource_delete] + # [END tpu_queued_resources_delete] if __name__ == "__main__": diff --git a/trace/trace-python-sample-opentelemetry/noxfile_config.py b/trace/trace-python-sample-opentelemetry/noxfile_config.py index 13b3c1bb5c51..25d1d4e081c2 100644 --- a/trace/trace-python-sample-opentelemetry/noxfile_config.py +++ b/trace/trace-python-sample-opentelemetry/noxfile_config.py @@ -25,7 +25,7 @@ # > ℹ️ Test only on Python 3.10. # > The Python version used is defined by the Dockerfile, so it's redundant # > to run multiple tests since they would all be running the same Dockerfile. - "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.9", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them # "enforce_type_hints": True, diff --git a/translate/samples/snippets/noxfile_config.py b/translate/samples/snippets/noxfile_config.py index 19c8db7a40a4..701e94473e69 100644 --- a/translate/samples/snippets/noxfile_config.py +++ b/translate/samples/snippets/noxfile_config.py @@ -23,7 +23,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. # Google-cloud-translate doesn't work with Python 3.12 for now. - "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"], + "ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, diff --git a/video/cloud-client/README.rst b/video/cloud-client/README.rst deleted file mode 100644 index bed120300311..000000000000 --- a/video/cloud-client/README.rst +++ /dev/null @@ -1,3 +0,0 @@ -These samples have been moved. - -https://github.com/googleapis/python-videointelligence/tree/main/samples diff --git a/workflows/cloud-client/main.py b/workflows/cloud-client/main.py index 0847a2e0f5d4..a9e3d20e62b6 100644 --- a/workflows/cloud-client/main.py +++ b/workflows/cloud-client/main.py @@ -13,6 +13,7 @@ # limitations under the License. # [START workflows_api_quickstart] +import os import time from google.cloud import workflows_v1 @@ -20,16 +21,20 @@ from google.cloud.workflows.executions_v1 import Execution from google.cloud.workflows.executions_v1.types import executions +PROJECT = os.getenv("GOOGLE_CLOUD_PROJECT") +LOCATION = os.getenv("LOCATION", "us-central1") +WORKFLOW_ID = os.getenv("WORKFLOW", "myFirstWorkflow") -def execute_workflow( - project: str, location: str = "us-central1", workflow: str = "myFirstWorkflow" -) -> Execution: + +def execute_workflow(project: str, location: str, workflow: str) -> Execution: """Execute a workflow and print the execution results. - A workflow consists of a series of steps described using the Workflows syntax, and can be written in either YAML or JSON. + A workflow consists of a series of steps described + using the Workflows syntax, and can be written in either YAML or JSON. Args: - project: The Google Cloud project id which contains the workflow to execute. + project: The Google Cloud project id + which contains the workflow to execute. location: The location for the workflow workflow: The ID of the workflow to execute. @@ -41,6 +46,7 @@ def execute_workflow( execution_client = executions_v1.ExecutionsClient() workflows_client = workflows_v1.WorkflowsClient() # [END workflows_api_quickstart_client_libraries] + # [START workflows_api_quickstart_execution] # Construct the fully qualified location path. parent = workflows_client.workflow_path(project, location, workflow) @@ -54,7 +60,9 @@ def execute_workflow( backoff_delay = 1 # Start wait with delay of 1 second print("Poll for result...") while not execution_finished: - execution = execution_client.get_execution(request={"name": response.name}) + execution = execution_client.get_execution( + request={"name": response.name} + ) execution_finished = execution.state != executions.Execution.State.ACTIVE # If we haven't seen the result yet, wait a second. @@ -70,4 +78,7 @@ def execute_workflow( # [END workflows_api_quickstart_execution] +if __name__ == "__main__": + assert PROJECT, "'GOOGLE_CLOUD_PROJECT' environment variable not set." + execute_workflow(PROJECT, LOCATION, WORKFLOW_ID) # [END workflows_api_quickstart] diff --git a/workflows/cloud-client/main_test.py b/workflows/cloud-client/main_test.py index 7b5d854dd5ab..8e3d39723e5b 100644 --- a/workflows/cloud-client/main_test.py +++ b/workflows/cloud-client/main_test.py @@ -19,13 +19,13 @@ import main -PROJECT = os.environ["GOOGLE_CLOUD_PROJECT"] +PROJECT = os.getenv("GOOGLE_CLOUD_PROJECT") LOCATION = "us-central1" WORKFLOW_ID = "myFirstWorkflow" def test_workflow_execution() -> None: - assert PROJECT != "" + assert PROJECT, "'GOOGLE_CLOUD_PROJECT' environment variable not set." if not workflow_exists(): workflow_file = open("myFirstWorkflow.workflows.yaml").read() @@ -37,20 +37,25 @@ def test_workflow_execution() -> None: # https://github.com/googleapis/python-workflows/issues/21 "parent": f"projects/{PROJECT}/locations/{LOCATION}", "workflow_id": WORKFLOW_ID, - "workflow": {"name": WORKFLOW_ID, "source_contents": workflow_file}, + "workflow": { + "name": WORKFLOW_ID, + "source_contents": workflow_file + }, } ) - result = main.execute_workflow(PROJECT) + result = main.execute_workflow(PROJECT, LOCATION, WORKFLOW_ID) assert result.state == executions.Execution.State.SUCCEEDED - assert len(result.result) > 0 + assert result.result # Result not empty def workflow_exists() -> bool: - """Returns True if the workflow exists in this project""" + """Returns True if the workflow exists in this project.""" try: workflows_client = workflows_v1.WorkflowsClient() - workflow_name = workflows_client.workflow_path(PROJECT, LOCATION, WORKFLOW_ID) + workflow_name = workflows_client.workflow_path( + PROJECT, LOCATION, WORKFLOW_ID + ) workflows_client.get_workflow(request={"name": workflow_name}) return True except Exception as e: