Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7197a00

Browse filesBrowse files
authored
feat(python): add support for python 3.11 (#1742)
* feat: add support for python 3.11 * add kokoro configs for python 3.11
1 parent 91c4e39 commit 7197a00
Copy full SHA for 7197a00

File tree

Expand file treeCollapse file tree

8 files changed

+97
-3
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+97
-3
lines changed

‎synthtool/gcp/common.py

Copy file name to clipboardExpand all lines: synthtool/gcp/common.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def py_library(self, **kwargs) -> Path:
265265
if "default_python_version" not in kwargs:
266266
kwargs["default_python_version"] = "3.8"
267267
if "unit_test_python_versions" not in kwargs:
268-
kwargs["unit_test_python_versions"] = ["3.7", "3.8", "3.9", "3.10"]
268+
kwargs["unit_test_python_versions"] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
269269

270270
if "system_test_python_versions" not in kwargs:
271271
kwargs["system_test_python_versions"] = ["3.8"]
+51Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Specify which tests to run
11+
env_vars: {
12+
key: "RUN_TESTS_SESSION"
13+
value: "py-3.11"
14+
}
15+
16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-311"
20+
}
21+
22+
env_vars: {
23+
key: "TRAMPOLINE_BUILD_FILE"
24+
value: "github/{{ metadata['repo']['repo'].split('/')[1] }}/.kokoro/test-samples.sh"
25+
}
26+
{% if custom_samples_dockerfile %}
27+
env_vars: {
28+
key: "TRAMPOLINE_IMAGE"
29+
value: "gcr.io/cloud-devrel-kokoro-resources/{{ metadata['repo']['repo'].split('/')[1] }}-samples-docker"
30+
}
31+
32+
# Configure the docker image for kokoro-trampoline.
33+
env_vars: {
34+
key: "TRAMPOLINE_DOCKERFILE"
35+
value: ".kokoro/docker/samples/Dockerfile"
36+
}
37+
{% else %}
38+
# Configure the docker image for kokoro-trampoline.
39+
env_vars: {
40+
key: "TRAMPOLINE_IMAGE"
41+
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
42+
}
43+
{% endif %}
44+
# Download secrets for samples
45+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
46+
47+
# Download trampoline resources.
48+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
49+
50+
# Use the trampoline script to run in docker.
51+
build_file: "{{ metadata['repo']['repo'].split('/')[1] }}/.kokoro/trampoline_v2.sh"
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
7+
8+
env_vars: {
9+
key: "TRAMPOLINE_BUILD_FILE"
10+
value: "github/{{ metadata['repo']['repo'].split('/')[1] }}/.kokoro/test-samples-against-head.sh"
11+
}
12+
{% if custom_samples_dockerfile %}
13+
# Upload the docker image after successful builds.
14+
env_vars: {
15+
key: "TRAMPOLINE_IMAGE_UPLOAD"
16+
value: "true"
17+
}
18+
{% endif %}
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "False"
6+
}
7+
{% if custom_samples_dockerfile %}
8+
# Upload the docker image after successful builds.
9+
env_vars: {
10+
key: "TRAMPOLINE_IMAGE_UPLOAD"
11+
value: "true"
12+
}
13+
{% endif %}
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}

‎synthtool/gcp/templates/python_samples/noxfile.py.j2

Copy file name to clipboardExpand all lines: synthtool/gcp/templates/python_samples/noxfile.py.j2
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

9090
# DO NOT EDIT - automatically generated.
9191
# All versions used to test samples.
92-
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
92+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

‎synthtool/languages/python_mono_repo.py

Copy file name to clipboardExpand all lines: synthtool/languages/python_mono_repo.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def owlbot_main(package_dir: str) -> None:
195195
relative_dir=f"packages/{Path(package_dir).name}",
196196
microgenerator=True,
197197
default_python_version="3.9",
198-
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10"],
198+
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11"],
199199
cov_level=100,
200200
versions=gcp.common.detect_versions(
201201
path=f"{package_dir}/google", default_first=True

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.