Skip to content

Commit 2206d16

Browse files
partheacopybara-github
authored andcommitted
Copybara import of the project:
-- 532516f by nayaknishant <[email protected]>: making change to file to retrigger owlbot -- b844927 by nayaknishant <[email protected]>: reverting changes to python3.10 and python 3.11 periodic.cfg files -- 8431d73 by nayaknishant <[email protected]>: reverting change to python3.9 periodic.cfg files -- 2ad02f4 by nayaknishant <[email protected]>: removing TF dependency for 3.12 testing -- 8727484 by nayaknishant <[email protected]>: removing TF dependency for 3.12 testing -- 6802b30 by nayaknishant <[email protected]>: removing TF dependency for all occurences of 3.12 testing -- 8917e4f by nayaknishant <[email protected]>: removing PyTorch dependency for 3.12 testing -- fb84714 by nayaknishant <[email protected]>: removing PyTorch dependency for 3.12 testing -- 2acfb73 by nayaknishant <[email protected]>: reverting changes to setup.py COPYBARA_INTEGRATE_REVIEW=#3035 from googleapis:use-latest-post-processor-image-py312 80fcf5e PiperOrigin-RevId: 609445658
1 parent 686bbac commit 2206d16

35 files changed

+413
-294
lines changed

.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

.github/.OwlBot.lock.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:ddf4551385d566771dc713090feb7b4c1164fb8a698fe52bbe7670b24236565b
16+
digest: sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5

.github/auto-label.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Google LLC
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/sync-repo-settings.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ branchProtectionRules:
1818
- 'Presubmit - Unit Tests Python 3.8'
1919
- 'Presubmit - Unit Tests Python 3.9'
2020
- 'Presubmit - Unit Tests Python 3.10'
21-
- 'Presubmit - Unit Tests Python 3.11'
21+
- 'Presubmit - Unit Tests Python 3.11'
22+
- 'Presubmit - Unit Tests Python 3.12'

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ docs.metadata
5050

5151
# Virtual environment
5252
env/
53+
venv/
5354

5455
# Test logs
5556
coverage.xml

.kokoro/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2018 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/docker/docs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Google LLC
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.kokoro/populate-secrets.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2020 Google LLC.
2+
# Copyright 2023 Google LLC.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/presubmit/unit_3-12.cfg

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Run unit tests for Python 3.12
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "unit-3.12"
7+
}
8+
9+
# Run unit tests in parallel, splitting up by file
10+
env_vars: {
11+
key: "PYTEST_ADDOPTS"
12+
value: "-n=auto --dist=loadscope"
13+
}

.kokoro/publish-docs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2020 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2020 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/release/common.cfg

+9
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ env_vars: {
3838
key: "SECRET_MANAGER_KEYS"
3939
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
4040
}
41+
42+
# Store the packages we uploaded to PyPI. That way, we have a record of exactly
43+
# what we published, which we can use to generate SBOMs and attestations.
44+
action {
45+
define_artifacts {
46+
regex: "github/python-aiplatform/**/*.tar.gz"
47+
strip_prefix: "github/python-aiplatform"
48+
}
49+
}

.kokoro/requirements.txt

+279-256
Large diffs are not rendered by default.

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

+40
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: "ucaip-sample-tests"
20+
}
21+
22+
env_vars: {
23+
key: "TRAMPOLINE_BUILD_FILE"
24+
value: "github/python-aiplatform/.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: "python-aiplatform/.kokoro/trampoline_v2.sh"
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+
}
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/python-aiplatform/.kokoro/test-samples-against-head.sh"
11+
}
+6
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+
}
+6
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+
}

.kokoro/test-samples-against-head.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2020 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/test-samples-impl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2021 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/test-samples.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2020 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/trampoline.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2017 Google Inc.
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/trampoline_v2.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright 2020 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.trampolinerc

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Google LLC
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# Template for .trampolinerc
16-
1715
# Add required env vars here.
1816
required_envvars+=(
1917
)

CONTRIBUTING.rst

+4-2
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.8, 3.9, 3.10 and 3.11 on both UNIX and Windows.
25+
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::
@@ -225,11 +225,13 @@ We support:
225225
- `Python 3.9`_
226226
- `Python 3.10`_
227227
- `Python 3.11`_
228+
- `Python 3.12`_
228229

229230
.. _Python 3.8: https://docs.python.org/3.8/
230231
.. _Python 3.9: https://docs.python.org/3.9/
231232
.. _Python 3.10: https://docs.python.org/3.10/
232233
.. _Python 3.11: https://docs.python.org/3.11/
234+
.. _Python 3.12: https://docs.python.org/3.12/
233235

234236

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

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
DEFAULT_PYTHON_VERSION = "3.8"
3434

35-
UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
35+
UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
3636
UNIT_TEST_STANDARD_DEPENDENCIES = [
3737
"mock",
3838
"asyncmock",

owlbot.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
templated_files = common.py_library(
9898
cov_level=98,
9999
system_test_python_versions=["3.8"],
100-
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11"],
100+
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12"],
101101
unit_test_extras=["testing"],
102102
system_test_extras=["testing"],
103103
microgenerator=True,
@@ -119,11 +119,13 @@
119119
".kokoro/samples/python3.9/common.cfg",
120120
".kokoro/samples/python3.10/common.cfg",
121121
".kokoro/samples/python3.11/common.cfg",
122+
".kokoro/samples/python3.12/common.cfg",
122123
".kokoro/samples/python3.7/periodic.cfg",
123124
".kokoro/samples/python3.8/periodic.cfg",
124125
".kokoro/samples/python3.9/periodic.cfg",
125126
".kokoro/samples/python3.10/periodic.cfg",
126127
".kokoro/samples/python3.11/periodic.cfg",
128+
".kokoro/samples/python3.12/periodic.cfg",
127129
".github/CODEOWNERS",
128130
".github/PULL_REQUEST_TEMPLATE.md",
129131
".github/workflows", # exclude gh actions as credentials are needed for tests

samples/model-builder/noxfile.py

+1-1
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", "3.11"]
92+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
9393

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

samples/snippets/noxfile.py

+1-1
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", "3.11"]
92+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
9393

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

scripts/decrypt-secrets.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Copyright 2015 Google Inc. All rights reserved.
3+
# Copyright 2023 Google LLC All rights reserved.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

scripts/readme-gen/readme_gen.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# Copyright 2016 Google Inc
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -33,37 +33,37 @@
3333
autoescape=True,
3434
)
3535

36-
README_TMPL = jinja_env.get_template('README.tmpl.rst')
36+
README_TMPL = jinja_env.get_template("README.tmpl.rst")
3737

3838

3939
def get_help(file):
40-
return subprocess.check_output(['python', file, '--help']).decode()
40+
return subprocess.check_output(["python", file, "--help"]).decode()
4141

4242

4343
def main():
4444
parser = argparse.ArgumentParser()
45-
parser.add_argument('source')
46-
parser.add_argument('--destination', default='README.rst')
45+
parser.add_argument("source")
46+
parser.add_argument("--destination", default="README.rst")
4747

4848
args = parser.parse_args()
4949

5050
source = os.path.abspath(args.source)
5151
root = os.path.dirname(source)
5252
destination = os.path.join(root, args.destination)
5353

54-
jinja_env.globals['get_help'] = get_help
54+
jinja_env.globals["get_help"] = get_help
5555

56-
with io.open(source, 'r') as f:
56+
with io.open(source, "r") as f:
5757
config = yaml.load(f)
5858

5959
# This allows get_help to execute in the right directory.
6060
os.chdir(root)
6161

6262
output = README_TMPL.render(config)
6363

64-
with io.open(destination, 'w') as f:
64+
with io.open(destination, "w") as f:
6565
f.write(output)
6666

6767

68-
if __name__ == '__main__':
68+
if __name__ == "__main__":
6969
main()

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213
"Programming Language :: Python :: 3.9",
214214
"Programming Language :: Python :: 3.10",
215215
"Programming Language :: Python :: 3.11",
216+
"Programming Language :: Python :: 3.12",
216217
"Topic :: Internet",
217218
"Topic :: Software Development :: Libraries :: Python Modules",
218219
],

0 commit comments

Comments
 (0)