Skip to content

Commit 0f0def7

Browse files
Adding Python 3.12 support (GoogleCloudPlatform#10946)
* feat: Adding Python3.12 support to the repository * feat: Adding Python 3.12 testing support * Disabling Py3.12 testing for app enginge for now * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Updating grpcio package to support Python 3.12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Disable Python3.11 for airflow_1_samples * Fixing couple things * Turning back to 3.11 testing for translate samples * Still fixing tests * Still fixing tests * Media translate is also non compatible with 3.12 * Reverting composer/workflow scipy req change --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 04ec207 commit 0f0def7

File tree

158 files changed

+540
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+540
-410
lines changed

.github/sync-repo-settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ branchProtectionRules:
4545
- "Kokoro CI - Lint"
4646
- "Kokoro CI - Python 2.7 (App Engine Standard Only)"
4747
- "Kokoro CI - Python 3.8"
48-
- "Kokoro CI - Python 3.11"
48+
- "Kokoro CI - Python 3.12"
4949
- "cla/google"
5050
- "snippet-bot check"
5151
# List of explicit permissions to add (additive only)

.kokoro/python3.12/common.cfg

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
timeout_mins: 300
18+
19+
# Configure the docker image for kokoro-trampoline.
20+
env_vars: {
21+
key: "TRAMPOLINE_IMAGE"
22+
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
23+
}
24+
25+
# Download trampoline resources.
26+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
27+
28+
# Use the trampoline script to run in docker.
29+
build_file: "python-docs-samples/.kokoro/trampoline_v2.sh"
30+
31+
# Download secrets from Cloud Storage.
32+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
33+
34+
# Access btlr binaries used in the tests
35+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/btlr"
36+
37+
# Copy results for Resultstore
38+
action {
39+
define_artifacts {
40+
regex: "**/*sponge_log.xml"
41+
}
42+
}
43+
44+
# Specify which tests to run
45+
env_vars: {
46+
key: "RUN_TESTS_SESSION"
47+
value: "py-3.12"
48+
}
49+
50+
# Declare build specific Cloud project. It still uses the common one,
51+
# but we'll update the value once we have more Cloud projects.
52+
env_vars: {
53+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
54+
value: "python-docs-samples-tests-312"
55+
}
56+
57+
# Number of test workers.
58+
env_vars: {
59+
key: "NUM_TEST_WORKERS"
60+
value: "10"
61+
}

.kokoro/python3.12/continuous.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: ".kokoro/tests/run_tests_diff_head.sh"
21+
}

.kokoro/python3.12/periodic.cfg

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: ".kokoro/tests/run_tests.sh"
21+
}
22+
23+
env_vars: {
24+
key: "REPORT_TO_BUILD_COP_BOT"
25+
value: "true"
26+
}
27+
28+
# Tell Trampoline to upload the Docker image after successfull build.
29+
env_vars: {
30+
key: "TRAMPOLINE_IMAGE_UPLOAD"
31+
value: "true"
32+
}

.kokoro/python3.12/presubmit.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: ".kokoro/tests/run_tests_diff_main.sh"
21+
}

AUTHORING_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ Add the new environment variables to the `envs` dictionary.
923923
```py
924924
TEST_CONFIG_OVERRIDE = {
925925
# You can opt out from the test for specific Python versions.
926-
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
926+
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11"],
927927
# Old samples are opted out of enforcing Python type hints
928928
# All new samples should feature them
929929
"enforce_type_hints": True,

appengine/flexible/django_cloudsql/noxfile_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
25+
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"],
2626
# An envvar key for determining the project id to use. Change it
2727
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
2828
# build specific Cloud project. You can also use your own string

appengine/standard/noxfile-template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
TEST_CONFIG = {
3939
# You can opt out from the test for specific Python versions.
40-
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
40+
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"],
4141
# An envvar key for determining the project id to use. Change it
4242
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
4343
# build specific Cloud project. You can also use your own string
@@ -79,10 +79,10 @@ def get_pytest_env_vars():
7979

8080
# DO NOT EDIT - automatically generated.
8181
# All versions used to tested samples.
82-
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
82+
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
8383

8484
# Any default versions that should be ignored.
85-
IGNORED_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
85+
IGNORED_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
8686

8787
TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS])
8888

appengine/standard_python3/bundled-services/blobstore/django/noxfile_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
25+
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": False,

appengine/standard_python3/bundled-services/blobstore/flask/noxfile_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
25+
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": False,

0 commit comments

Comments
 (0)