8000 feat: add python 3.11 testing (#8872) · apilaskowski/python-docs-samples@66e069f · GitHub
[go: up one dir, main page]

Skip to content

Commit 66e069f

Browse files
authored
feat: add python 3.11 testing (GoogleCloudPlatform#8872)
* feat: add python 3.11 testing * update dependency scipy to 1.10.0 * update dependency psycopg2-binary to 2.9.5 * exclude python 3.11 for appengine/standard_python3/bigquery * exclude python 3.11 for tests that use google-cloud-bigquery==2.34.4 * update copyright year
1 parent 0071cd6 commit 66e069f

File tree

54 files changed

+205
-56
lines changed

Some content is hidden

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

54 files changed

+205
-56
lines changed

.kokoro/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ RUN set -ex \
117117
&& export GNUPGHOME="$(mktemp -d)" \
118118
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
119119
&& /tmp/fetch_gpg_keys.sh \
120-
&& for PYTHON_VERSION in 2.7.18 3.7.12 3.8.13 3.9.13 3.10.5 3.11.1; do \
120+
&& for PYTHON_VERSION in 2.7.18 3.7.16 3.8.16 3.9.16 3.10.9 3.11.1; do \
121121
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" \
122122< F987 /td>
&& 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" \
123123
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \

.kokoro/python3.11/common.cfg

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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.11"
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-311"
55+
}
56+
57+
# Number of test workers.
58+
env_vars: {
59+
key: "NUM_TEST_WORKERS"
60+
value: "10"
61+
}
62+
63+
env_vars: {
64+
key: "TRAMPOLINE_DOCKERFILE"
65+
value: ".kokoro/docker/Dockerfile"
66+
}

.kokoro/python3.11/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.11/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.11/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+
}

MAC_SETUP.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,25 @@ test their code.
7676
```console
7777
$ pyenv install 3.6.13
7878
```
79-
* 3.7.13 (latest 3.7.x release)
79+
* 3.7.16 (latest 3.7.x release)
8080
```console
81-
$ pyenv install 3.7.13
81+
$ pyenv install 3.7.16
8282
```
83-
* 3.8.13 (latest 3.8.x release)
83+
* 3.8.16 (latest 3.8.x release)
8484
```console
85-
$ pyenv install 3.8.13
85+
$ pyenv install 3.8.16
8686
```
87-
* 3.9.12 (latest 3.9.x release)
87+
* 3.9.16 (latest 3.9.x release)
8888
```console
89-
$ pyenv install 3.9.12
89+
$ pyenv install 3.9.16
9090
```
91-
* 3.10.4 (latest 3.10.x release)
91+
* 3.10.9 (latest 3.10.x release)
9292
```console
93-
$ pyenv install 3.10.4
93+
$ pyenv install 3.10.9
94+
```
95+
* 3.11.1 (latest 3.11.x release)
96+
```console
97+
$ pyenv install 3.11.1
9498
```
9599
96100
> ℹ️ *Note*: If you are using an M1 Mac,

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Python samples for [Google Cloud Platform products][cloud].
44

5-
[![Build Status][py-2.7-shield]][py-2.7-link] [![Build Status][py-3.7-shield]][py-3.7-link] [![Build Status][py-3.8-shield]][py-3.8-link] [![Build Status][py-3.9-shield]][py-3.9-link] [![Build Status][py-3.10-shield]][py-3.10-link]
5+
[![Build Status][py-2.7-shield]][py-2.7-link] [![Build Status][py-3.7-shield]][py-3.7-link] [![Build Status][py-3.8-shield]][py-3.8-link] [![Build Status][py-3.9-shield]][py-3.9-link] [![Build Status][py-3.10-shield]][py-3.10-link] [![Build Status][py-3.11-shield]][py-3.11-link]
66

77
## Google Cloud Samples
88

@@ -77,3 +77,5 @@ Contributions welcome! See the [Contributing Guide](CONTRIBUTING.md).
7777
[py-3.9-link]: https://storage.googleapis.com/cloud-devrel-public/python-docs-samples/badges/py-3.9.html
7878
[py-3.10-shield]: https://storage.googleapis.com/cloud-devrel-public/python-docs-samples/badges/py-310.svg
7979
[py-3.10-link]: https://storage.googleapis.com/cloud-devrel-public/python-docs-samples/badges/py-3.10.html
80+
[py-3.11-shield]: https://storage.googleapis.com/cloud-devrel-public/python-docs-samples/badges/py-311.svg
81+
[py-3.11-link]: https://storage.googleapis.com/cloud-devrel-public/python-docs-samples/badges/py-3.11.html
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Django==4.0.4; python_version >= '3.8'
22
Django==3.2.14; python_version < '3.8'
33
gunicorn==20.1.0
4-
psycopg2-binary==2.9.4
4+
psycopg2-binary==2.9.5
55
django-environ==0.9.0
66
google-cloud-secret-manager==2.12.0
77
django-storages[google]==1.13

appengine/flexible/scipy/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.6"],
25+
"ignored_versions": ["2.7", "3.6", "3.11"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": False,

appengine/flexible/scipy/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ imageio==2.14.0
55
numpy==1.22.0; python_version > "3.7"
66
numpy==1.21.4; python_version <= "3.7"
77
pillow==9.2.0
8-
scipy==1.8.0; python_version > "3.7"
8+
scipy==1.10.0; python_version > "3.7"
99
scipy==1.7.3; python_version <= "3.7"

0 commit comments

Comments
 (0)
0