Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a8f38c7
feat: Add support for python 3.12
parthea Nov 24, 2023
ec90741
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Nov 24, 2023
3e618b6
revert change to owlbot.py
parthea Nov 24, 2023
49cfd26
run post processor again
parthea Nov 24, 2023
cba36d9
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Nov 24, 2023
930d9f9
revert change to owlbot.py
parthea Nov 24, 2023
77ba96b
Additional changes for python 3.12
parthea Nov 24, 2023
8f49989
Add test configuration for python 3.12
parthea Nov 24, 2023
7be1513
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 6, 2024
532516f
making change to file to retrigger owlbot
nayaknishant Feb 6, 2024
142d094
editing file and retriggering owlbot
nayaknishant Feb 6, 2024
45850f0
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 8, 2024
dce3827
Merge branch 'main' into use-latest-post-processor-image-py312
sasha-gitg Feb 12, 2024
c1933e9
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 12, 2024
609b909
Merge branch 'main' of https://github.com/googleapis/python-aiplatfor…
nayaknishant Feb 13, 2024
62c70c9
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 15, 2024
b65f571
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 20, 2024
951bbea
Merge branch 'use-latest-post-processor-image-py312' of https://githu…
nayaknishant Feb 20, 2024
b844927
reverting changes to python3.10 and python 3.11 periodic.cfg files
nayaknishant Feb 20, 2024
8431d73
reverting change to python3.9 periodic.cfg files
nayaknishant Feb 20, 2024
2ad02f4
removing TF dependency for 3.12 testing
nayaknishant Feb 20, 2024
8727484
removing TF dependency for 3.12 testing
nayaknishant Feb 20, 2024
6802b30
removing TF dependency for all occurences of 3.12 testing
nayaknishant Feb 20, 2024
8917e4f
removing PyTorch dependency for 3.12 testing
nayaknishant Feb 20, 2024
fb84714
removing PyTorch dependency for 3.12 testing
nayaknishant Feb 20, 2024
7d3e38c
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 21, 2024
2acfb73
reverting changes to setup.py
nayaknishant Feb 21, 2024
a1af9ad
Merge branch 'use-latest-post-processor-image-py312' of https://githu…
nayaknishant Feb 21, 2024
80fcf5e
Merge branch 'main' into use-latest-post-processor-image-py312
nayaknishant Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:ddf4551385d566771dc713090feb7b4c1164fb8a698fe52bbe7670b24236565b
digest: sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5
2 changes: 1 addition & 1 deletion .github/auto-label.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ branchProtectionRules:
- 'Presubmit - Unit Tests Python 3.8'
- 'Presubmit - Unit Tests Python 3.9'
- 'Presubmit - Unit Tests Python 3.10'
- 'Presubmit - Unit Tests Python 3.11'
- 'Presubmit - Unit Tests Python 3.11'
- 'Presubmit - Unit Tests Python 3.12'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs.metadata

# Virtual environment
env/
venv/

# Test logs
coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2018 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC.
# Copyright 2023 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
13 changes: 13 additions & 0 deletions .kokoro/presubmit/unit_3-12.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Run unit tests for Python 3.12
env_vars: {
key: "NOX_SESSION"
value: "unit-3.12"
}

# Run unit tests in parallel, splitting up by file
env_vars: {
key: "PYTEST_ADDOPTS"
value: "-n=auto --dist=loadscope"
}
2 changes: 1 addition & 1 deletion .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
9 changes: 9 additions & 0 deletions .kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}

# Store the packages we uploaded to PyPI. That way, we have a record of exactly
# what we published, which we can use to generate SBOMs and attestations.
action {
define_artifacts {
regex: "github/python-aiplatform/**/*.tar.gz"
strip_prefix: "github/python-aiplatform"
}
}
535 changes: 279 additions & 256 deletions .kokoro/requirements.txt

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions .kokoro/samples/python3.12/common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.12"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-aiplatform/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-aiplatform/.kokoro/trampoline_v2.sh"
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.12/continuous.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.12/periodic-head.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.12/periodic.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.12/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
2 changes: 1 addition & 1 deletion .kokoro/test-samples-against-head.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/test-samples-impl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2021 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/test-samples.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/trampoline.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2017 Google Inc.
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/trampoline_v2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 1 addition & 3 deletions .trampolinerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Template for .trampolinerc

# Add required env vars here.
required_envvars+=(
)
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows.
3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.

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

- To run a single unit test::

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


.. note::
Expand Down Expand Up @@ -225,11 +225,13 @@ We support:
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_

.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _Python 3.11: https://docs.python.org/3.11/
.. _Python 3.12: https://docs.python.org/3.12/


Supported versions can be found in our ``noxfile.py`` `config`_.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

DEFAULT_PYTHON_VERSION = "3.8"

UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
Expand Down
4 changes: 3 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
templated_files = common.py_library(
cov_level=98,
system_test_python_versions=["3.8"],
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11"],
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12"],
unit_test_extras=["testing"],
system_test_extras=["testing"],
microgenerator=True,
Expand All @@ -119,11 +119,13 @@
".kokoro/samples/python3.9/common.cfg",
".kokoro/samples/python3.10/common.cfg",
".kokoro/samples/python3.11/common.cfg",
".kokoro/samples/python3.12/common.cfg",
".kokoro/samples/python3.7/periodic.cfg",
".kokoro/samples/python3.8/periodic.cfg",
".kokoro/samples/python3.9/periodic.cfg",
".kokoro/samples/python3.10/periodic.cfg",
".kokoro/samples/python3.11/periodic.cfg",
".kokoro/samples/python3.12/periodic.cfg",
".github/CODEOWNERS",
".github/PULL_REQUEST_TEMPLATE.md",
".github/workflows", # exclude gh actions as credentials are needed for tests
Expand Down
2 changes: 1 addition & 1 deletion samples/model-builder/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

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

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

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

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/decrypt-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2015 Google Inc. All rights reserved.
# Copyright 2023 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
18 changes: 9 additions & 9 deletions scripts/readme-gen/readme_gen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright 2016 Google Inc
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,37 +33,37 @@
autoescape=True,
)

README_TMPL = jinja_env.get_template('README.tmpl.rst')
README_TMPL = jinja_env.get_template("README.tmpl.rst")


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


def main():
parser = argparse.ArgumentParser()
parser.add_argument('source')
parser.add_argument('--destination', default='README.rst')
parser.add_argument("source")
parser.add_argument("--destination", default="README.rst")

args = parser.parse_args()

source = os.path.abspath(args.source)
root = os.path.dirname(source)
destination = os.path.join(root, args.destination)

jinja_env.globals['get_help'] = get_help
jinja_env.globals["get_help"] = get_help

with io.open(source, 'r') as f:
with io.open(source, "r") as f:
config = yaml.load(f)

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

output = README_TMPL.render(config)

with io.open(destination, 'w') as f:
with io.open(destination, "w") as f:
f.write(output)


if __name__ == '__main__':
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
],
Expand Down
Loading