From ab4871acfdc3fc9bbbd80aa74d49b6bf76452c00 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Wed, 11 Nov 2020 15:36:16 -0800 Subject: [PATCH 01/28] chore(Dockerfile): add Python 3.9 --- .kokoro/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/docker/Dockerfile b/.kokoro/docker/Dockerfile index 137fd45fbfca..1dd6da744a79 100644 --- a/.kokoro/docker/Dockerfile +++ b/.kokoro/docker/Dockerfile @@ -103,7 +103,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \ && /tmp/fetch_gpg_keys.sh \ - && for PYTHON_VERSION in 2.7.18 3.6.10 3.7.7 3.8.3; do \ + && for PYTHON_VERSION in 2.7.18 3.6.10 3.7.7 3.8.3 3.9.0; do \ wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \ From c0ec1155d61a751ac585cdefcf0d612975468931 Mon Sep 17 00:00:00 2001 From: ace-n Date: Wed, 11 Nov 2020 15:40:34 -0800 Subject: [PATCH 02/28] Add py3.9 kokoro dir --- .kokoro/python3.9/common.cfg | 63 ++++++++++++++++++++++++++++++++ .kokoro/python3.9/continuous.cfg | 21 +++++++++++ .kokoro/python3.9/periodic.cfg | 32 ++++++++++++++++ .kokoro/python3.9/presubmit.cfg | 21 +++++++++++ 4 files changed, 137 insertions(+) create mode 100644 .kokoro/python3.9/common.cfg create mode 100644 .kokoro/python3.9/continuous.cfg create mode 100644 .kokoro/python3.9/periodic.cfg create mode 100644 .kokoro/python3.9/presubmit.cfg diff --git a/.kokoro/python3.9/common.cfg b/.kokoro/python3.9/common.cfg new file mode 100644 index 000000000000..b57cc273daf2 --- /dev/null +++ b/.kokoro/python3.9/common.cfg @@ -0,0 +1,63 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +timeout_mins: 300 + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-docs-samples/.kokoro/trampoline_v2.sh" + +# Download secrets from Cloud Storage. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Copy results for Resultstore +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.8" +} + +# Declare build specific Cloud project. It still uses the common one, +# but we'll update the value once we have more Cloud projects. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-py38" +} + +# Number of test workers. +env_vars: { + key: "NUM_TEST_WORKERS" + value: "10" +} + +env_vars: { + key: "TRAMPOLINE_DOCKERFILE" + value: ".kokoro/docker/Dockerfile" +} diff --git a/.kokoro/python3.9/continuous.cfg b/.kokoro/python3.9/continuous.cfg new file mode 100644 index 000000000000..cfbe29058c88 --- /dev/null +++ b/.kokoro/python3.9/continuous.cfg @@ -0,0 +1,21 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: ".kokoro/tests/run_tests_diff_head.sh" +} diff --git a/.kokoro/python3.9/periodic.cfg b/.kokoro/python3.9/periodic.cfg new file mode 100644 index 000000000000..86f13817c222 --- /dev/null +++ b/.kokoro/python3.9/periodic.cfg @@ -0,0 +1,32 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: ".kokoro/tests/run_tests.sh" +} + +env_vars: { + key: "REPORT_TO_BUILD_COP_BOT" + value: "true" +} + +# Tell Trampoline to upload the Docker image after successfull build. +env_vars: { + key: "TRAMPOLINE_IMAGE_UPLOAD" + value: "true" +} diff --git a/.kokoro/python3.9/presubmit.cfg b/.kokoro/python3.9/presubmit.cfg new file mode 100644 index 000000000000..1cf6a4b7382a --- /dev/null +++ b/.kokoro/python3.9/presubmit.cfg @@ -0,0 +1,21 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: ".kokoro/tests/run_tests_diff_master.sh" +} From 0f1881a2b16c8a0c84060a0b92b9c3dfd351d1c0 Mon Sep 17 00:00:00 2001 From: ace-n Date: Wed, 11 Nov 2020 18:45:37 -0800 Subject: [PATCH 03/28] fix typo --- .kokoro/python3.9/common.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/python3.9/common.cfg b/.kokoro/python3.9/common.cfg index b57cc273daf2..a5d914d566c5 100644 --- a/.kokoro/python3.9/common.cfg +++ b/.kokoro/python3.9/common.cfg @@ -41,7 +41,7 @@ action { # Specify which tests to run env_vars: { key: "RUN_TESTS_SESSION" - value: "py-3.8" + value: "py-3.9" } # Declare build specific Cloud project. It still uses the common one, From ce4eed8f369707ac089c2b92bc533cc94a28e5fa Mon Sep 17 00:00:00 2001 From: ace-n Date: Thu, 7 Jan 2021 13:42:02 -0800 Subject: [PATCH 04/28] Add GPG keys --- .kokoro/docker/fetch_gpg_keys.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.kokoro/docker/fetch_gpg_keys.sh b/.kokoro/docker/fetch_gpg_keys.sh index bec72f622d26..57aba1fdb96f 100755 --- a/.kokoro/docker/fetch_gpg_keys.sh +++ b/.kokoro/docker/fetch_gpg_keys.sh @@ -44,6 +44,10 @@ retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D -# 3.8.0 (Łukasz Langa) +# 3.8.0, 3.9.0 (Łukasz Langa) retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ E3FF2839C048B25C084DEBE9B26995E310250568 + +# 3.10.x and 3.11.x (Pablo Galindo Salgado) +retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ + A035C8C19219BA821ECEA86B64E628F8D684696D From 3eb5329fe76699d8b9912ce253c4a892f7675c79 Mon Sep 17 00:00:00 2001 From: ace-n Date: Fri, 8 Jan 2021 20:45:42 -0800 Subject: [PATCH 05/28] Add 3.9 to noxfiles --- appengine/flexible/memcache/noxfile.py | 2 +- cloud-sql/mysql/sqlalchemy/noxfile.py | 2 +- cloud-sql/postgres/sqlalchemy/noxfile.py | 2 +- cloud-sql/sql-server/sqlalchemy/noxfile.py | 2 +- dataflow/encryption-keys/noxfile.py | 2 +- dataflow/flex-templates/streaming_beam/noxfile.py | 2 +- eventarc/noxfile.py | 2 +- ml_engine/online_prediction/noxfile.py | 2 +- noxfile-template.py | 2 +- pubsub/streaming-analytics/noxfile.py | 2 +- run/markdown-preview/editor/noxfile.py | 2 +- run/markdown-preview/renderer/noxfile.py | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/appengine/flexible/memcache/noxfile.py b/appengine/flexible/memcache/noxfile.py index 0e3979cdca56..e3bf811ab994 100644 --- a/appengine/flexible/memcache/noxfile.py +++ b/appengine/flexible/memcache/noxfile.py @@ -22,7 +22,7 @@ # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = ["2.7", "3.8"] diff --git a/cloud-sql/mysql/sqlalchemy/noxfile.py b/cloud-sql/mysql/sqlalchemy/noxfile.py index a30e4a6baf7d..27d6f7ca9688 100644 --- a/cloud-sql/mysql/sqlalchemy/noxfile.py +++ b/cloud-sql/mysql/sqlalchemy/noxfile.py @@ -81,7 +81,7 @@ 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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/cloud-sql/postgres/sqlalchemy/noxfile.py b/cloud-sql/postgres/sqlalchemy/noxfile.py index a30e4a6baf7d..27d6f7ca9688 100644 --- a/cloud-sql/postgres/sqlalchemy/noxfile.py +++ b/cloud-sql/postgres/sqlalchemy/noxfile.py @@ -81,7 +81,7 @@ 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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/cloud-sql/sql-server/sqlalchemy/noxfile.py b/cloud-sql/sql-server/sqlalchemy/noxfile.py index a30e4a6baf7d..27d6f7ca9688 100644 --- a/cloud-sql/sql-server/sqlalchemy/noxfile.py +++ b/cloud-sql/sql-server/sqlalchemy/noxfile.py @@ -81,7 +81,7 @@ 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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/dataflow/encryption-keys/noxfile.py b/dataflow/encryption-keys/noxfile.py index 0e3979cdca56..e3bf811ab994 100644 --- a/dataflow/encryption-keys/noxfile.py +++ b/dataflow/encryption-keys/noxfile.py @@ -22,7 +22,7 @@ # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = ["2.7", "3.8"] diff --git a/dataflow/flex-templates/streaming_beam/noxfile.py b/dataflow/flex-templates/streaming_beam/noxfile.py index 0e3979cdca56..e3bf811ab994 100644 --- a/dataflow/flex-templates/streaming_beam/noxfile.py +++ b/dataflow/flex-templates/streaming_beam/noxfile.py @@ -22,7 +22,7 @@ # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = ["2.7", "3.8"] diff --git a/eventarc/noxfile.py b/eventarc/noxfile.py index a30e4a6baf7d..27d6f7ca9688 100644 --- a/eventarc/noxfile.py +++ b/eventarc/noxfile.py @@ -81,7 +81,7 @@ 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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/ml_engine/online_prediction/noxfile.py b/ml_engine/online_prediction/noxfile.py index 0e3979cdca56..e3bf811ab994 100644 --- a/ml_engine/online_prediction/noxfile.py +++ b/ml_engine/online_prediction/noxfile.py @@ -22,7 +22,7 @@ # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = ["2.7", "3.8"] diff --git a/noxfile-template.py b/noxfile-template.py index 9c28d5a0050e..1b11728e6f53 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -86,7 +86,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/pubsub/streaming-analytics/noxfile.py b/pubsub/streaming-analytics/noxfile.py index 0e3979cdca56..e3bf811ab994 100644 --- a/pubsub/streaming-analytics/noxfile.py +++ b/pubsub/streaming-analytics/noxfile.py @@ -22,7 +22,7 @@ # DO NOT EDIT - automatically generated. # All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = ["2.7", "3.8"] diff --git a/run/markdown-preview/editor/noxfile.py b/run/markdown-preview/editor/noxfile.py index a30e4a6baf7d..27d6f7ca9688 100644 --- a/run/markdown-preview/editor/noxfile.py +++ b/run/markdown-preview/editor/noxfile.py @@ -81,7 +81,7 @@ 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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/run/markdown-preview/renderer/noxfile.py b/run/markdown-preview/renderer/noxfile.py index 824b5166f411..85f87c6616a5 100644 --- a/run/markdown-preview/renderer/noxfile.py +++ b/run/markdown-preview/renderer/noxfile.py @@ -81,7 +81,7 @@ 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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] From 2e03c44dabc4dfb6af9a25b947dd4688e6d50486 Mon Sep 17 00:00:00 2001 From: ace-n Date: Fri, 8 Jan 2021 21:55:24 -0800 Subject: [PATCH 06/28] Update composer dep to avoid deprecation spam --- composer/workflows/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/workflows/requirements.txt b/composer/workflows/requirements.txt index fcaaed95ce10..a39735a24e84 100644 --- a/composer/workflows/requirements.txt +++ b/composer/workflows/requirements.txt @@ -3,5 +3,5 @@ cattrs==1.0.0 #this has to be explicitly pinned to 1.0.0 until airflow 1.10.13 w kubernetes==12.0.1 scipy==1.4.1; python_version > '3.0' scipy==1.2.3; python_version < '3.0' -numpy==1.17.4; python_version > '3.0' +numpy==1.19.5; python_version > '3.0' numpy==1.16.6; python_version < '3.0' From 50e20a7c88181c1d604a89d775df1564078caeb8 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Tue, 12 Jan 2021 19:05:37 +0000 Subject: [PATCH 07/28] fix(storage): add py-3.9 specific key --- storage/cloud-client/noxfile_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/cloud-client/noxfile_config.py b/storage/cloud-client/noxfile_config.py index edcea1530b63..a0e0cc9bb007 100644 --- a/storage/cloud-client/noxfile_config.py +++ b/storage/cloud-client/noxfile_config.py @@ -55,6 +55,9 @@ def get_cloud_kms_key(): if session == 'py-3.8': return ('projects/python-docs-samples-tests-py38/locations/us/' 'keyRings/gcs-kms-key-ring/cryptoKeys/gcs-kms-key') + if session == 'py-3.9': + return ('projects/python-docs-samples-tests-py39/locations/us/' + 'keyRings/gcs-kms-key-ring/cryptoKeys/gcs-kms-key') return os.environ['CLOUD_KMS_KEY'] From e39e75624d3c219b053ec2872a7995b9dca46248 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 00:28:21 +0000 Subject: [PATCH 08/28] update psycopg2-binary, only run test in py-3.9 build --- run/deployment-previews/noxfile_config.py | 2 +- run/django/noxfile_config.py | 2 +- run/django/requirements.txt | 2 +- run/hello-broken/noxfile_config.py | 2 +- run/helloworld/noxfile_config.py | 2 +- run/image-processing/noxfile_config.py | 2 +- run/logging-manual/noxfile_config.py | 2 +- run/markdown-preview/noxfile_config.py | 2 +- run/pubsub/noxfile_config.py | 2 +- run/system-package/noxfile_config.py | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/run/deployment-previews/noxfile_config.py b/run/deployment-previews/noxfile_config.py index 7b8aa473a34f..1a727d4c9dc3 100644 --- a/run/deployment-previews/noxfile_config.py +++ b/run/deployment-previews/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], "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/run/django/noxfile_config.py b/run/django/noxfile_config.py index 118cf9fa5c5f..70a0e31cfb6f 100644 --- a/run/django/noxfile_config.py +++ b/run/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.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # Old samples are opted out of enforcing Python type hints # All new samples should feature the "enforce_type_hints": True, diff --git a/run/django/requirements.txt b/run/django/requirements.txt index f7bce8496735..624ece46b9f0 100644 --- a/run/django/requirements.txt +++ b/run/django/requirements.txt @@ -1,6 +1,6 @@ Django==3.1.5 django-storages[google]==1.11.1 django-environ==0.4.5 -psycopg2-binary==2.8.4 +psycopg2-binary==2.8.6 gunicorn==20.0.4 google-cloud-secret-manager==2.1.0 diff --git a/run/hello-broken/noxfile_config.py b/run/hello-broken/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/hello-broken/noxfile_config.py +++ b/run/hello-broken/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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/run/helloworld/noxfile_config.py b/run/helloworld/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/helloworld/noxfile_config.py +++ b/run/helloworld/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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/run/image-processing/noxfile_config.py b/run/image-processing/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/image-processing/noxfile_config.py +++ b/run/image-processing/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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/run/logging-manual/noxfile_config.py b/run/logging-manual/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/logging-manual/noxfile_config.py +++ b/run/logging-manual/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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/run/markdown-preview/noxfile_config.py b/run/markdown-preview/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/markdown-preview/noxfile_config.py +++ b/run/markdown-preview/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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/run/pubsub/noxfile_config.py b/run/pubsub/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/pubsub/noxfile_config.py +++ b/run/pubsub/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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/run/system-package/noxfile_config.py b/run/system-package/noxfile_config.py index 3778d8a677f5..3955ff5283b9 100644 --- a/run/system-package/noxfile_config.py +++ b/run/system-package/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 py38 session. - "ignored_versions": ["2.7", "3.6", "3.7"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], # 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 From c9a2233e226c6166574406e3cf6ed4120ff553d0 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 01:13:35 +0000 Subject: [PATCH 09/28] add libmemcached-dev to the Dockerfile --- .kokoro/docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/docker/Dockerfile b/.kokoro/docker/Dockerfile index 1dd6da744a79..ca0e4325a6bb 100644 --- a/.kokoro/docker/Dockerfile +++ b/.kokoro/docker/Dockerfile @@ -45,6 +45,7 @@ RUN apt-get update \ libffi-dev \ liblzma-dev \ libmagickwand-dev \ + libmemcached-dev \ libpython3-dev \ libreadline-dev \ libsnappy-dev \ From 1d0b50f501793131195a18a778875e6b48566e57 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 01:15:37 +0000 Subject: [PATCH 10/28] disable appengine standard test in py-3.9 build --- appengine/standard/noxfile-template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appengine/standard/noxfile-template.py b/appengine/standard/noxfile-template.py index b7fa361d97a4..4379a081ebf3 100644 --- a/appengine/standard/noxfile-template.py +++ b/appengine/standard/noxfile-template.py @@ -81,10 +81,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"] +ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = ["3.6", "3.7", "3.8"] +IGNORED_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) From 9a7579e2451faae89019125076b76d6de9bbca63 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 01:19:56 +0000 Subject: [PATCH 11/28] disable py-3.9 build for appengine cloud_debugger --- .../cloud_debugger/noxfile_config.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 appengine/standard_python3/cloud_debugger/noxfile_config.py diff --git a/appengine/standard_python3/cloud_debugger/noxfile_config.py b/appengine/standard_python3/cloud_debugger/noxfile_config.py new file mode 100644 index 000000000000..ec2d79d0ed1a --- /dev/null +++ b/appengine/standard_python3/cloud_debugger/noxfile_config.py @@ -0,0 +1,40 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # google-python-cloud-debugger doesn't support Python 3.9. + # https://github.com/GoogleCloudPlatform/cloud-debug-python/issues/22 + "ignored_versions": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} From 976832f094e2e110c45b50b13db4f36687b5817f Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 20:52:56 +0000 Subject: [PATCH 12/28] skip py-3.9 build for composer/workflows --- composer/workflows/noxfile_config.py | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 composer/workflows/noxfile_config.py diff --git a/composer/workflows/noxfile_config.py b/composer/workflows/noxfile_config.py new file mode 100644 index 000000000000..99dc2f9aa10b --- /dev/null +++ b/composer/workflows/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # Skipping for Python 3.9 due to numpy compilation failure. + "ignored_versions": ["2.7", "3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} From b05f3401cb668fa1a38303120b5c9424a8815c98 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 22:14:05 +0000 Subject: [PATCH 13/28] skip tests with pyarrow for py-3.9 build --- bigquery/bqml/noxfile_config.py | 39 +++++++++++++++++++ bigquery/datalab-migration/noxfile_config.py | 39 +++++++++++++++++++ .../pandas-gbq-migration/noxfile_config.py | 39 +++++++++++++++++++ .../data-cleaning/noxfile_config.py | 39 +++++++++++++++++++ dataflow/encryption-keys/noxfile_config.py | 39 +++++++++++++++++++ .../streaming_beam/noxfile_config.py | 39 +++++++++++++++++++ notebooks/noxfile_config.py | 39 +++++++++++++++++++ pubsub/streaming-analytics/noxfile_config.py | 39 +++++++++++++++++++ 8 files changed, 312 insertions(+) create mode 100644 bigquery/bqml/noxfile_config.py create mode 100644 bigquery/datalab-migration/noxfile_config.py create mode 100644 bigquery/pandas-gbq-migration/noxfile_config.py create mode 100644 data-science-onramp/data-cleaning/noxfile_config.py create mode 100644 dataflow/encryption-keys/noxfile_config.py create mode 100644 dataflow/flex-templates/streaming_beam/noxfile_config.py create mode 100644 notebooks/noxfile_config.py create mode 100644 pubsub/streaming-analytics/noxfile_config.py diff --git a/bigquery/bqml/noxfile_config.py b/bigquery/bqml/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/bigquery/bqml/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/bigquery/datalab-migration/noxfile_config.py b/bigquery/datalab-migration/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/bigquery/datalab-migration/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/bigquery/pandas-gbq-migration/noxfile_config.py b/bigquery/pandas-gbq-migration/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/bigquery/pandas-gbq-migration/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/data-science-onramp/data-cleaning/noxfile_config.py b/data-science-onramp/data-cleaning/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/data-science-onramp/data-cleaning/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/dataflow/encryption-keys/noxfile_config.py b/dataflow/encryption-keys/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/dataflow/encryption-keys/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/dataflow/flex-templates/streaming_beam/noxfile_config.py b/dataflow/flex-templates/streaming_beam/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/dataflow/flex-templates/streaming_beam/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/notebooks/noxfile_config.py b/notebooks/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/notebooks/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/pubsub/streaming-analytics/noxfile_config.py b/pubsub/streaming-analytics/noxfile_config.py new file mode 100644 index 000000000000..52905e7e1fa9 --- /dev/null +++ b/pubsub/streaming-analytics/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +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": ["3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} From f5b8a84bc9476d5e34b75c8ae4a5cfd13b86faf4 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 23:41:05 +0000 Subject: [PATCH 14/28] avoid ReferenceError in iot builds --- iot/api-client/manager/manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iot/api-client/manager/manager.py b/iot/api-client/manager/manager.py index 3f763ac8a422..d3bbec55213a 100644 --- a/iot/api-client/manager/manager.py +++ b/iot/api-client/manager/manager.py @@ -268,8 +268,11 @@ def get_state(service_account_json, project_id, cloud_region, registry_id, devic print("State history") states = client.list_device_states(request={"name": device_path}).device_states - for state in states: - print("State: {}".format(state)) + + # Avoid ReferenceError in py-3.9 builds. + if states: + for state in states: + print("State: {}".format(state)) return states From bfc3b5182e3e82d82ea1061a13c0d58c0bd64c5a Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 13 Jan 2021 23:52:28 +0000 Subject: [PATCH 15/28] skip some tests due to pip error --- ml_engine/online_prediction/noxfile.py | 2 +- .../app/noxfile_config.py | 40 +++++++++++++++++++ .../app/noxfile_config.py | 40 +++++++++++++++++++ .../noxfile_config.py | 40 +++++++++++++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py create mode 100644 trace/cloud-trace-demo-app/app/noxfile_config.py create mode 100644 trace/trace-python-sample-opentelemetry/noxfile_config.py diff --git a/ml_engine/online_prediction/noxfile.py b/ml_engine/online_prediction/noxfile.py index e3bf811ab994..c917ea77ced0 100644 --- a/ml_engine/online_prediction/noxfile.py +++ b/ml_engine/online_prediction/noxfile.py @@ -25,7 +25,7 @@ ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = ["2.7", "3.8"] +IGNORED_VERSIONS = ["2.7", "3.8", "3.9"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) diff --git a/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py new file mode 100644 index 000000000000..13d919db0e57 --- /dev/null +++ b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py @@ -0,0 +1,40 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # Skipping for Python 3.9 due to pip failure around + # opentelemetry-auto-instrumentation. + "ignored_versions": ["2.7", "3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/trace/cloud-trace-demo-app/app/noxfile_config.py b/trace/cloud-trace-demo-app/app/noxfile_config.py new file mode 100644 index 000000000000..182af8038ed8 --- /dev/null +++ b/trace/cloud-trace-demo-app/app/noxfile_config.py @@ -0,0 +1,40 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # Skipping for Python 3.9 due to pip failure around + # opencensus-ext-stackdriver. + "ignored_versions": ["2.7", "3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/trace/trace-python-sample-opentelemetry/noxfile_config.py b/trace/trace-python-sample-opentelemetry/noxfile_config.py new file mode 100644 index 000000000000..13d919db0e57 --- /dev/null +++ b/trace/trace-python-sample-opentelemetry/noxfile_config.py @@ -0,0 +1,40 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # Skipping for Python 3.9 due to pip failure around + # opentelemetry-auto-instrumentation. + "ignored_versions": ["2.7", "3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} From 50c13966a2f7375f6c15fab61f119f906b9cea1f Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Thu, 14 Jan 2021 05:26:37 +0000 Subject: [PATCH 16/28] add a temporary statement for debugging --- storage/cloud-client/snippets_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/cloud-client/snippets_test.py b/storage/cloud-client/snippets_test.py index edcf779391cb..24ba2b21ed80 100644 --- a/storage/cloud-client/snippets_test.py +++ b/storage/cloud-client/snippets_test.py @@ -66,6 +66,8 @@ def test_enable_default_kms_key(test_bucket): + # For debugging on Kokoro... + print(f"using CLOUD_KMS_KEY: {CLOUD_KMS_KEY}") storage_set_bucket_default_kms_key.enable_default_kms_key( bucket_name=test_bucket.name, kms_key_name=KMS_KEY ) From 55e75b4fe9334101474e94d78b2b21129395248a Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Thu, 14 Jan 2021 05:27:14 +0000 Subject: [PATCH 17/28] fix lint --- appengine/standard_python3/cloud_debugger/noxfile_config.py | 2 +- bigquery/bqml/noxfile_config.py | 2 +- bigquery/datalab-migration/noxfile_config.py | 2 +- bigquery/pandas-gbq-migration/noxfile_config.py | 2 +- composer/workflows/noxfile_config.py | 2 +- data-science-onramp/data-cleaning/noxfile_config.py | 2 +- trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py | 2 +- trace/cloud-trace-demo-app/app/noxfile_config.py | 2 +- trace/trace-python-sample-opentelemetry/noxfile_config.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/appengine/standard_python3/cloud_debugger/noxfile_config.py b/appengine/standard_python3/cloud_debugger/noxfile_config.py index ec2d79d0ed1a..e70f22010c76 100644 --- a/appengine/standard_python3/cloud_debugger/noxfile_config.py +++ b/appengine/standard_python3/cloud_debugger/noxfile_config.py @@ -27,7 +27,7 @@ "ignored_versions": ["3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/bigquery/bqml/noxfile_config.py b/bigquery/bqml/noxfile_config.py index 52905e7e1fa9..eee9f04cbdc5 100644 --- a/bigquery/bqml/noxfile_config.py +++ b/bigquery/bqml/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/bigquery/datalab-migration/noxfile_config.py b/bigquery/datalab-migration/noxfile_config.py index 52905e7e1fa9..eee9f04cbdc5 100644 --- a/bigquery/datalab-migration/noxfile_config.py +++ b/bigquery/datalab-migration/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/bigquery/pandas-gbq-migration/noxfile_config.py b/bigquery/pandas-gbq-migration/noxfile_config.py index 52905e7e1fa9..eee9f04cbdc5 100644 --- a/bigquery/pandas-gbq-migration/noxfile_config.py +++ b/bigquery/pandas-gbq-migration/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/composer/workflows/noxfile_config.py b/composer/workflows/noxfile_config.py index 99dc2f9aa10b..4f28c9975418 100644 --- a/composer/workflows/noxfile_config.py +++ b/composer/workflows/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/data-science-onramp/data-cleaning/noxfile_config.py b/data-science-onramp/data-cleaning/noxfile_config.py index 52905e7e1fa9..eee9f04cbdc5 100644 --- a/data-science-onramp/data-cleaning/noxfile_config.py +++ b/data-science-onramp/data-cleaning/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py index 13d919db0e57..75fd7fcc8b00 100644 --- a/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py +++ b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py @@ -27,7 +27,7 @@ "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/trace/cloud-trace-demo-app/app/noxfile_config.py b/trace/cloud-trace-demo-app/app/noxfile_config.py index 182af8038ed8..ee3df8f79f40 100644 --- a/trace/cloud-trace-demo-app/app/noxfile_config.py +++ b/trace/cloud-trace-demo-app/app/noxfile_config.py @@ -27,7 +27,7 @@ "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/trace/trace-python-sample-opentelemetry/noxfile_config.py b/trace/trace-python-sample-opentelemetry/noxfile_config.py index 13d919db0e57..75fd7fcc8b00 100644 --- a/trace/trace-python-sample-opentelemetry/noxfile_config.py +++ b/trace/trace-python-sample-opentelemetry/noxfile_config.py @@ -27,7 +27,7 @@ "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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 From 8b5b6b48c98f10466eac4e71a5103c14ccf3334f Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Thu, 14 Jan 2021 16:58:12 +0000 Subject: [PATCH 18/28] use correct constant --- storage/cloud-client/snippets_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/cloud-client/snippets_test.py b/storage/cloud-client/snippets_test.py index 24ba2b21ed80..980d0fff79f4 100644 --- a/storage/cloud-client/snippets_test.py +++ b/storage/cloud-client/snippets_test.py @@ -67,7 +67,7 @@ def test_enable_default_kms_key(test_bucket): # For debugging on Kokoro... - print(f"using CLOUD_KMS_KEY: {CLOUD_KMS_KEY}") + print(f"using KMS_KEY: {KMS_KEY}") storage_set_bucket_default_kms_key.enable_default_kms_key( bucket_name=test_bucket.name, kms_key_name=KMS_KEY ) From 421db0828242e78551413f59e64224fed1dda3ec Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Thu, 14 Jan 2021 21:56:50 +0000 Subject: [PATCH 19/28] disable 2.7 builds --- appengine/standard_python3/cloud_debugger/noxfile_config.py | 2 +- bigquery/bqml/noxfile_config.py | 2 +- bigquery/datalab-migration/noxfile_config.py | 2 +- bigquery/pandas-gbq-migration/noxfile_config.py | 2 +- data-science-onramp/data-cleaning/noxfile_config.py | 2 +- notebooks/noxfile_config.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appengine/standard_python3/cloud_debugger/noxfile_config.py b/appengine/standard_python3/cloud_debugger/noxfile_config.py index e70f22010c76..df34661d3ce9 100644 --- a/appengine/standard_python3/cloud_debugger/noxfile_config.py +++ b/appengine/standard_python3/cloud_debugger/noxfile_config.py @@ -24,7 +24,7 @@ # You can opt out from the test for specific Python versions. # google-python-cloud-debugger doesn't support Python 3.9. # https://github.com/GoogleCloudPlatform/cloud-debug-python/issues/22 - "ignored_versions": ["3.9"], + "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/bigquery/bqml/noxfile_config.py b/bigquery/bqml/noxfile_config.py index eee9f04cbdc5..29e372f7a944 100644 --- a/bigquery/bqml/noxfile_config.py +++ b/bigquery/bqml/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": ["3.9"], + "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/bigquery/datalab-migration/noxfile_config.py b/bigquery/datalab-migration/noxfile_config.py index eee9f04cbdc5..29e372f7a944 100644 --- a/bigquery/datalab-migration/noxfile_config.py +++ b/bigquery/datalab-migration/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": ["3.9"], + "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/bigquery/pandas-gbq-migration/noxfile_config.py b/bigquery/pandas-gbq-migration/noxfile_config.py index eee9f04cbdc5..29e372f7a944 100644 --- a/bigquery/pandas-gbq-migration/noxfile_config.py +++ b/bigquery/pandas-gbq-migration/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": ["3.9"], + "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/data-science-onramp/data-cleaning/noxfile_config.py b/data-science-onramp/data-cleaning/noxfile_config.py index eee9f04cbdc5..29e372f7a944 100644 --- a/data-science-onramp/data-cleaning/noxfile_config.py +++ b/data-science-onramp/data-cleaning/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": ["3.9"], + "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/notebooks/noxfile_config.py b/notebooks/noxfile_config.py index 52905e7e1fa9..ae4a429b9e41 100644 --- a/notebooks/noxfile_config.py +++ b/notebooks/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": ["3.9"], + "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": True, From 28f638d8ada01ca800db57f5088d47f35be51a47 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Thu, 14 Jan 2021 22:01:58 +0000 Subject: [PATCH 20/28] disable builds due to pip conflict The conflict is between google-cloud-monitoring==2.0.0 and opencensus-ext-stackdriver. --- trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py | 2 +- trace/cloud-trace-demo-app/app/noxfile_config.py | 2 +- trace/trace-python-sample-opentelemetry/noxfile_config.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py index 75fd7fcc8b00..b9bee692317a 100644 --- a/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py +++ b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py @@ -24,7 +24,7 @@ # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pip failure around # opentelemetry-auto-instrumentation. - "ignored_versions": ["2.7", "3.9"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/trace/cloud-trace-demo-app/app/noxfile_config.py b/trace/cloud-trace-demo-app/app/noxfile_config.py index ee3df8f79f40..6eb748d9bb11 100644 --- a/trace/cloud-trace-demo-app/app/noxfile_config.py +++ b/trace/cloud-trace-demo-app/app/noxfile_config.py @@ -24,7 +24,7 @@ # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pip failure around # opencensus-ext-stackdriver. - "ignored_versions": ["2.7", "3.9"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/trace/trace-python-sample-opentelemetry/noxfile_config.py b/trace/trace-python-sample-opentelemetry/noxfile_config.py index 75fd7fcc8b00..b9bee692317a 100644 --- a/trace/trace-python-sample-opentelemetry/noxfile_config.py +++ b/trace/trace-python-sample-opentelemetry/noxfile_config.py @@ -24,7 +24,7 @@ # You can opt out from the test for specific Python versions. # Skipping for Python 3.9 due to pip failure around # opentelemetry-auto-instrumentation. - "ignored_versions": ["2.7", "3.9"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, From eb00bf61ab67e68a32440e0255598bd4b026f5b7 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 00:59:46 +0000 Subject: [PATCH 21/28] remove temporary debugging statement --- storage/cloud-client/snippets_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/storage/cloud-client/snippets_test.py b/storage/cloud-client/snippets_test.py index 980d0fff79f4..edcf779391cb 100644 --- a/storage/cloud-client/snippets_test.py +++ b/storage/cloud-client/snippets_test.py @@ -66,8 +66,6 @@ def test_enable_default_kms_key(test_bucket): - # For debugging on Kokoro... - print(f"using KMS_KEY: {KMS_KEY}") storage_set_bucket_default_kms_key.enable_default_kms_key( bucket_name=test_bucket.name, kms_key_name=KMS_KEY ) From 257d86df5f037ddbd533ff366ae6d40529cc800b Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 01:19:12 +0000 Subject: [PATCH 22/28] really skip py-3.9 build for pubsub/streaming-analytics --- pubsub/streaming-analytics/noxfile.py | 2 +- pubsub/streaming-analytics/noxfile_config.py | 39 -------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 pubsub/streaming-analytics/noxfile_config.py diff --git a/pubsub/streaming-analytics/noxfile.py b/pubsub/streaming-analytics/noxfile.py index e3bf811ab994..c917ea77ced0 100644 --- a/pubsub/streaming-analytics/noxfile.py +++ b/pubsub/streaming-analytics/noxfile.py @@ -25,7 +25,7 @@ ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = ["2.7", "3.8"] +IGNORED_VERSIONS = ["2.7", "3.8", "3.9"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) diff --git a/pubsub/streaming-analytics/noxfile_config.py b/pubsub/streaming-analytics/noxfile_config.py deleted file mode 100644 index 52905e7e1fa9..000000000000 --- a/pubsub/streaming-analytics/noxfile_config.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -# Default TEST_CONFIG_OVERRIDE for python repos. - -# You can copy this file into your directory, then it will be inported from -# the noxfile.py. - -# The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py - -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": ["3.9"], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "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 - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} From daee0dcc1ec3a79ea069573931b7b3d501f30504 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 01:31:46 +0000 Subject: [PATCH 23/28] copyright year fix --- appengine/standard_python3/cloud_debugger/noxfile_config.py | 2 +- bigquery/bqml/noxfile_config.py | 2 +- bigquery/datalab-migration/noxfile_config.py | 2 +- bigquery/pandas-gbq-migration/noxfile_config.py | 2 +- composer/workflows/noxfile_config.py | 2 +- data-science-onramp/data-cleaning/noxfile_config.py | 2 +- dataflow/encryption-keys/noxfile_config.py | 2 +- dataflow/flex-templates/streaming_beam/noxfile_config.py | 2 +- notebooks/noxfile_config.py | 2 +- trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py | 2 +- trace/cloud-trace-demo-app/app/noxfile_config.py | 2 +- trace/trace-python-sample-opentelemetry/noxfile_config.py | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/appengine/standard_python3/cloud_debugger/noxfile_config.py b/appengine/standard_python3/cloud_debugger/noxfile_config.py index df34661d3ce9..9a7ec8ded333 100644 --- a/appengine/standard_python3/cloud_debugger/noxfile_config.py +++ b/appengine/standard_python3/cloud_debugger/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bigquery/bqml/noxfile_config.py b/bigquery/bqml/noxfile_config.py index 29e372f7a944..da81697c595d 100644 --- a/bigquery/bqml/noxfile_config.py +++ b/bigquery/bqml/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bigquery/datalab-migration/noxfile_config.py b/bigquery/datalab-migration/noxfile_config.py index 29e372f7a944..da81697c595d 100644 --- a/bigquery/datalab-migration/noxfile_config.py +++ b/bigquery/datalab-migration/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bigquery/pandas-gbq-migration/noxfile_config.py b/bigquery/pandas-gbq-migration/noxfile_config.py index 29e372f7a944..da81697c595d 100644 --- a/bigquery/pandas-gbq-migration/noxfile_config.py +++ b/bigquery/pandas-gbq-migration/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/composer/workflows/noxfile_config.py b/composer/workflows/noxfile_config.py index 4f28c9975418..4400d71d381d 100644 --- a/composer/workflows/noxfile_config.py +++ b/composer/workflows/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/data-science-onramp/data-cleaning/noxfile_config.py b/data-science-onramp/data-cleaning/noxfile_config.py index 29e372f7a944..da81697c595d 100644 --- a/data-science-onramp/data-cleaning/noxfile_config.py +++ b/data-science-onramp/data-cleaning/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dataflow/encryption-keys/noxfile_config.py b/dataflow/encryption-keys/noxfile_config.py index 52905e7e1fa9..2e13380c8a91 100644 --- a/dataflow/encryption-keys/noxfile_config.py +++ b/dataflow/encryption-keys/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dataflow/flex-templates/streaming_beam/noxfile_config.py b/dataflow/flex-templates/streaming_beam/noxfile_config.py index 52905e7e1fa9..2e13380c8a91 100644 --- a/dataflow/flex-templates/streaming_beam/noxfile_config.py +++ b/dataflow/flex-templates/streaming_beam/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/notebooks/noxfile_config.py b/notebooks/noxfile_config.py index ae4a429b9e41..22d06bc8f683 100644 --- a/notebooks/noxfile_config.py +++ b/notebooks/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py index b9bee692317a..96d7d48a998c 100644 --- a/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py +++ b/trace/cloud-trace-demo-app-opentelemetry/app/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/trace/cloud-trace-demo-app/app/noxfile_config.py b/trace/cloud-trace-demo-app/app/noxfile_config.py index 6eb748d9bb11..ccd7f9499a5f 100644 --- a/trace/cloud-trace-demo-app/app/noxfile_config.py +++ b/trace/cloud-trace-demo-app/app/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/trace/trace-python-sample-opentelemetry/noxfile_config.py b/trace/trace-python-sample-opentelemetry/noxfile_config.py index b9bee692317a..96d7d48a998c 100644 --- a/trace/trace-python-sample-opentelemetry/noxfile_config.py +++ b/trace/trace-python-sample-opentelemetry/noxfile_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 09f90c867b7d0e41bb6ba721373055aa2709beb9 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 18:22:20 +0000 Subject: [PATCH 24/28] fix(storage): explicitly use the test project for the test bucket --- storage/cloud-client/snippets_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/cloud-client/snippets_test.py b/storage/cloud-client/snippets_test.py index edcf779391cb..acd2f618f856 100644 --- a/storage/cloud-client/snippets_test.py +++ b/storage/cloud-client/snippets_test.py @@ -97,9 +97,11 @@ def test_remove_bucket_label(test_bucket, capsys): def test_bucket(): """Yields a bucket that is deleted after the test completes.""" bucket = None + project = os.environ["GOOGLE_CLOUD_PROJECT"] while bucket is None or bucket.exists(): bucket_name = "storage-snippets-test-{}".format(uuid.uuid4()) - bucket = storage.Client().bucket(bucket_name) + # Make sure we create the bucket in the test project. + bucket = storage.Client(project=project).bucket(bucket_name) bucket.create() yield bucket bucket.delete(force=True) From 915b4c60312d01b982b65f2b311860883bdce69c Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 18:38:12 +0000 Subject: [PATCH 25/28] fix(storage): use correct cloud project --- .kokoro/python3.9/common.cfg | 2 +- storage/cloud-client/snippets_test.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.kokoro/python3.9/common.cfg b/.kokoro/python3.9/common.cfg index a5d914d566c5..b5e3a94fcba4 100644 --- a/.kokoro/python3.9/common.cfg +++ b/.kokoro/python3.9/common.cfg @@ -48,7 +48,7 @@ env_vars: { # but we'll update the value once we have more Cloud projects. env_vars: { key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests-py38" + value: "python-docs-samples-tests-py39" } # Number of test workers. diff --git a/storage/cloud-client/snippets_test.py b/storage/cloud-client/snippets_test.py index acd2f618f856..edcf779391cb 100644 --- a/storage/cloud-client/snippets_test.py +++ b/storage/cloud-client/snippets_test.py @@ -97,11 +97,9 @@ def test_remove_bucket_label(test_bucket, capsys): def test_bucket(): """Yields a bucket that is deleted after the test completes.""" bucket = None - project = os.environ["GOOGLE_CLOUD_PROJECT"] while bucket is None or bucket.exists(): bucket_name = "storage-snippets-test-{}".format(uuid.uuid4()) - # Make sure we create the bucket in the test project. - bucket = storage.Client(project=project).bucket(bucket_name) + bucket = storage.Client().bucket(bucket_name) bucket.create() yield bucket bucket.delete(force=True) From a4ccfb3e6cc61df3af65503f7b00112e39e6d7c2 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 19:30:18 +0000 Subject: [PATCH 26/28] fix: disable py-3.9 builds - appengine/standard_python3/bigquery - data-science-onramp/data-ingestion --- .../bigquery/noxfile_config.py | 39 +++++++++++++++++++ .../data-ingestion/noxfile_config.py | 39 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 appengine/standard_python3/bigquery/noxfile_config.py create mode 100644 data-science-onramp/data-ingestion/noxfile_config.py diff --git a/appengine/standard_python3/bigquery/noxfile_config.py b/appengine/standard_python3/bigquery/noxfile_config.py new file mode 100644 index 000000000000..527d9fd989d6 --- /dev/null +++ b/appengine/standard_python3/bigquery/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # There's no google-cloud-bigquery package for Python 3.9. + "ignored_versions": ["2.7", "3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} diff --git a/data-science-onramp/data-ingestion/noxfile_config.py b/data-science-onramp/data-ingestion/noxfile_config.py new file mode 100644 index 000000000000..527d9fd989d6 --- /dev/null +++ b/data-science-onramp/data-ingestion/noxfile_config.py @@ -0,0 +1,39 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # There's no google-cloud-bigquery package for Python 3.9. + "ignored_versions": ["2.7", "3.9"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "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 + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} From 4f4bbf08977f2acb3241a87067feff78fee39969 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 19:36:15 +0000 Subject: [PATCH 27/28] disable py-3.9 build - dataflow/encryption-keys - dataflow/flex-templates/streaming_beam --- dataflow/encryption-keys/noxfile.py | 2 +- dataflow/encryption-keys/noxfile_config.py | 39 ------------------- .../flex-templates/streaming_beam/noxfile.py | 2 +- .../streaming_beam/noxfile_config.py | 39 ------------------- 4 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 dataflow/encryption-keys/noxfile_config.py delete mode 100644 dataflow/flex-templates/streaming_beam/noxfile_config.py diff --git a/dataflow/encryption-keys/noxfile.py b/dataflow/encryption-keys/noxfile.py index e3bf811ab994..c917ea77ced0 100644 --- a/dataflow/encryption-keys/noxfile.py +++ b/dataflow/encryption-keys/noxfile.py @@ -25,7 +25,7 @@ ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = ["2.7", "3.8"] +IGNORED_VERSIONS = ["2.7", "3.8", "3.9"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) diff --git a/dataflow/encryption-keys/noxfile_config.py b/dataflow/encryption-keys/noxfile_config.py deleted file mode 100644 index 2e13380c8a91..000000000000 --- a/dataflow/encryption-keys/noxfile_config.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -# Default TEST_CONFIG_OVERRIDE for python repos. - -# You can copy this file into your directory, then it will be inported from -# the noxfile.py. - -# The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py - -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": ["3.9"], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "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 - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} diff --git a/dataflow/flex-templates/streaming_beam/noxfile.py b/dataflow/flex-templates/streaming_beam/noxfile.py index e3bf811ab994..c917ea77ced0 100644 --- a/dataflow/flex-templates/streaming_beam/noxfile.py +++ b/dataflow/flex-templates/streaming_beam/noxfile.py @@ -25,7 +25,7 @@ ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = ["2.7", "3.8"] +IGNORED_VERSIONS = ["2.7", "3.8", "3.9"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) diff --git a/dataflow/flex-templates/streaming_beam/noxfile_config.py b/dataflow/flex-templates/streaming_beam/noxfile_config.py deleted file mode 100644 index 2e13380c8a91..000000000000 --- a/dataflow/flex-templates/streaming_beam/noxfile_config.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -# Default TEST_CONFIG_OVERRIDE for python repos. - -# You can copy this file into your directory, then it will be inported from -# the noxfile.py. - -# The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py - -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": ["3.9"], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "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 - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} From 6c5c13e4a18046f9fc294361e077150598beda8b Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 15 Jan 2021 20:55:08 +0000 Subject: [PATCH 28/28] disable type hint checks --- appengine/standard_python3/bigquery/noxfile_config.py | 2 +- data-science-onramp/data-ingestion/noxfile_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appengine/standard_python3/bigquery/noxfile_config.py b/appengine/standard_python3/bigquery/noxfile_config.py index 527d9fd989d6..17fd0b01bf24 100644 --- a/appengine/standard_python3/bigquery/noxfile_config.py +++ b/appengine/standard_python3/bigquery/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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/data-science-onramp/data-ingestion/noxfile_config.py b/data-science-onramp/data-ingestion/noxfile_config.py index 527d9fd989d6..17fd0b01bf24 100644 --- a/data-science-onramp/data-ingestion/noxfile_config.py +++ b/data-science-onramp/data-ingestion/noxfile_config.py @@ -26,7 +26,7 @@ "ignored_versions": ["2.7", "3.9"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - "enforce_type_hints": True, + "enforce_type_hints": False, # 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