Skip to content

Commit ac8d3ee

Browse files
feat: Add support for Python 3.12 (#318)
* chore(python): Add Python 3.12 Source-Link: googleapis/synthtool@af16e6d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5 * update common files to include python 3.12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix typo * fix typo * add constraints file --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent fbce656 commit ac8d3ee

File tree

12 files changed

+87
-7
lines changed

12 files changed

+87
-7
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:caffe0a9277daeccc4d1de5c9b55ebba0901b57c2f713ec9c876b0d4ec064f61
17-
# created: 2023-11-08T19:46:45.022803742Z
16+
digest: sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5
17+
# created: 2023-11-23T18:17:28.105124211Z

.github/workflows/unittest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-20.04
99
strategy:
1010
matrix:
11-
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
11+
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3

.kokoro/samples/python3.12/common.cfg

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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.12"
14+
}
15+
16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-312"
20+
}
21+
22+
env_vars: {
23+
key: "TRAMPOLINE_BUILD_FILE"
24+
value: "github/google-auth-library-python-oauthlib/.kokoro/test-samples.sh"
25+
}
26+
27+
# Configure the docker image for kokoro-trampoline.
28+
env_vars: {
29+
key: "TRAMPOLINE_IMAGE"
30+
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
31+
}
32+
33+
# Download secrets for samples
34+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
35+
36+
# Download trampoline resources.
37+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
38+
39+
# Use the trampoline script to run in docker.
40+
build_file: "google-auth-library-python-oauthlib/.kokoro/trampoline_v2.sh"
Lines 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+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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/google-auth-library-python-oauthlib/.kokoro/test-samples-against-head.sh"
11+
}
Lines 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: "False"
6+
}
Lines 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+
}

CONTRIBUTING.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.6, 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows.
25+
3.6, 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7272

7373
- To run a single unit test::
7474

75-
$ nox -s unit-3.11 -- -k <name of test>
75+
$ nox -s unit-3.12 -- -k <name of test>
7676

7777

7878
.. note::
@@ -227,13 +227,15 @@ We support:
227227
- `Python 3.9`_
228228
- `Python 3.10`_
229229
- `Python 3.11`_
230+
- `Python 3.12`_
230231

231232
.. _Python 3.6: https://docs.python.org/3.6/
232233
.. _Python 3.7: https://docs.python.org/3.7/
233234
.. _Python 3.8: https://docs.python.org/3.8/
234235
.. _Python 3.9: https://docs.python.org/3.9/
235236
.. _Python 3.10: https://docs.python.org/3.10/
236237
.. _Python 3.11: https://docs.python.org/3.11/
238+
.. _Python 3.12: https://docs.python.org/3.12/
237239

238240

239241
Supported versions can be found in our ``noxfile.py`` `config`_.

noxfile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434

3535
DEFAULT_PYTHON_VERSION = "3.8"
3636

37-
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
37+
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
38+
"3.6",
39+
"3.7",
40+
"3.8",
41+
"3.9",
42+
"3.10",
43+
"3.11",
44+
"3.12",
45+
]
3846
UNIT_TEST_STANDARD_DEPENDENCIES = [
3947
"mock",
4048
"asyncmock",

owlbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
microgenerator=True,
1111
cov_level=99,
1212
unit_test_external_dependencies=["click"],
13-
unit_test_python_versions=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"],
13+
unit_test_python_versions=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"],
1414
)
1515
s.move(templated_files, excludes=[
1616
"docs/multiprocessing.rst",

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"Programming Language :: Python :: 3.9",
5757
"Programming Language :: Python :: 3.10",
5858
"Programming Language :: Python :: 3.11",
59+
"Programming Language :: Python :: 3.12",
5960
"Development Status :: 5 - Production/Stable",
6061
"Intended Audience :: Developers",
6162
"License :: OSI Approved :: Apache Software License",

testing/constraints-3.12.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)