GeezerVison is showing github.com — feat: add support for Python v3.13 · sabastinjtest/python-aiplatform@db286c4
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/sync-repo-settings.yaml +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,11 +20,14 @@ branchProtectionRules: | 20 | 20 | - 'Presubmit - Unit Tests Python 3.10' | 21 | 21 | - 'Presubmit - Unit Tests Python 3.11' | 22 | 22 | - 'Presubmit - Unit Tests Python 3.12' | | 23 | + - 'Presubmit - Unit Tests Python 3.13' | 23 | 24 | - 'Presubmit - Unit Tests Ray 2.9.3' | 24 | 25 | - 'Presubmit - Unit Tests Ray 2.33.0' | 25 | 26 | - 'Presubmit - Unit Tests Ray 2.42.0 (Python 3.10)' | 26 | 27 | - 'Presubmit - Unit Tests Ray 2.42.0 (Python 3.11)' | 27 | 28 | - 'Presubmit - Unit Tests Ray 2.47.1 (Python 3.11)' | 28 | 29 | - 'Presubmit - Unit Tests LangChain (Python 3.9)' | 29 | 30 | - 'Presubmit - Unit Tests LangChain (Python 3.10)' | 30 | | - - 'Presubmit - Unit Tests LangChain (Python 3.11)' | | 31 | + - 'Presubmit - Unit Tests LangChain (Python 3.11)' | | 32 | + - 'Presubmit - Unit Tests LangChain (Python 3.12)' | | 33 | + - 'Presubmit - Unit Tests LangChain (Python 3.13)' |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/mypy.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | runs-on: ubuntu-latest | 17 | 17 | strategy: | 18 | 18 | matrix: | 19 | | - python-version: ['3.9', '3.10', '3.11', '3.12'] | | 19 | + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | 20 | 20 |
| 21 | 21 | steps: | 22 | 22 | - name: Checkout code | |
Collapse file Copy file name to clipboardExpand all lines: noxfile.py +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 51 | 51 | "recommonmark", | 52 | 52 | ) | 53 | 53 |
| 54 | | -UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"] | 55 | | -UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"] | 56 | | -UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"] | 57 | | -UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"] | | 54 | +UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] | | 55 | +UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] | | 56 | +UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] | | 57 | +UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] | 58 | 58 | PYTHON_TO_RAY_VERSIONS = { | 59 | 59 | "3.10": ["2.9.3", "2.33.0", "2.42.0"], | 60 | 60 | "3.11": ["2.42.0", "2.47.1"], | |
Collapse file Copy file name to clipboardExpand all lines: owlbot.py +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 99 | 99 | templated_files = common.py_library( | 100 | 100 | cov_level=98, | 101 | 101 | system_test_python_versions=["3.9"], | 102 | | - unit_test_python_versions=["3.9", "3.10", "3.11", "3.12"], | | 102 | + unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13"], | 103 | 103 | unit_test_extras=["testing"], | 104 | 104 | system_test_extras=["testing"], | 105 | 105 | microgenerator=True, | | 126 | 126 | ".kokoro/samples/python3.10/common.cfg", | 127 | 127 | ".kokoro/samples/python3.11/common.cfg", | 128 | 128 | ".kokoro/samples/python3.12/common.cfg", | | 129 | + ".kokoro/samples/python3.13/common.cfg", | 129 | 130 | ".kokoro/samples/python3.9/periodic.cfg", | 130 | 131 | ".kokoro/samples/python3.10/periodic.cfg", | 131 | 132 | ".kokoro/samples/python3.11/periodic.cfg", | 132 | 133 | ".kokoro/samples/python3.12/periodic.cfg", | | 134 | + ".kokoro/samples/python3.13/periodic.cfg", | 133 | 135 | ".github/auto-label.yaml", | 134 | 136 | ".github/blunderbuss.yml", | 135 | 137 | ".github/CODEOWNERS", | |
Collapse file Copy file name to clipboardExpand all lines: setup.py +13-8Lines changed: 13 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 53 | 53 | tensorboard_extra_require = profiler_extra_require | 54 | 54 |
| 55 | 55 | metadata_extra_require = ["pandas >= 1.0.0", "numpy>=1.15.0"] | 56 | | -xai_extra_require = ["tensorflow >=2.3.0, <3.0.0"] | | 56 | +xai_extra_require = ["tensorflow >=2.3.0, <3.0.0; python_version<'3.13'"] | 57 | 57 | lit_extra_require = [ | 58 | | - "tensorflow >= 2.3.0, <3.0.0", | | 58 | + "tensorflow >= 2.3.0, <3.0.0; python_version<'3.13'", | 59 | 59 | "pandas >= 1.0.0", | 60 | 60 | "lit-nlp == 0.4.0", | 61 | | - "explainable-ai-sdk >= 1.0.0", | | 61 | + "explainable-ai-sdk >= 1.0.0; python_version<'3.13'", | 62 | 62 | ] | 63 | 63 | featurestore_extra_require = [ | 64 | 64 | "google-cloud-bigquery-storage", | | 131 | 131 | "ray[train]", | 132 | 132 | # Framework version constraints copied from testing_extra_require | 133 | 133 | "scikit-learn<1.6.0", | 134 | | - "tensorflow", | | 134 | + "tensorflow; python_version<'3.13'", | 135 | 135 | "torch >= 2.0.0, < 2.1.0", | 136 | 136 | "xgboost", | 137 | 137 | "xgboost_ray", | | 250 | 250 | # google-api-core 2.x is required since kfp requires protobuf > 4 | 251 | 251 | "google-api-core >= 2.11, < 3.0.0", | 252 | 252 | "grpcio-testing", | | 253 | + "grpcio-tools >= 1.63.0; python_version>='3.13'", | 253 | 254 | "ipython", | 254 | | - "kfp >= 2.6.0, < 3.0.0", | | 255 | + "kfp >= 2.6.0, < 3.0.0; python_version<'3.13'", | 255 | 256 | "pytest-asyncio", | | 257 | + "pytest-cov", | | 258 | + "mock", | 256 | 259 | "pytest-xdist", | 257 | 260 | "scikit-learn<1.6.0; python_version<='3.10'", | 258 | 261 | "scikit-learn; python_version>'3.10'", | 259 | 262 | # Lazy import requires > 2.12.0 | 260 | 263 | "tensorflow == 2.14.1; python_version<='3.11'", | 261 | | - "tensorflow == 2.19.0; python_version>'3.11'", | | 264 | + "tensorflow == 2.19.0; python_version>'3.11' and python_version<'3.13'", | 262 | 265 | "protobuf <= 5.29.4", | 263 | 266 | # TODO(jayceeli) torch 2.1.0 has conflict with pyfakefs, will check if | 264 | 267 | # future versions fix this issue | 265 | 268 | "torch >= 2.0.0, < 2.1.0; python_version<='3.11'", | 266 | | - "torch >= 2.2.0; python_version>'3.11'", | | 269 | + "torch >= 2.2.0; python_version>'3.11' and python_version<'3.13'", | 267 | 270 | "requests-toolbelt <= 1.0.0", | 268 | 271 | "immutabledict", | 269 | 272 | "xgboost", | | 300 | 303 | "proto-plus >= 1.22.3, <2.0.0", | 301 | 304 | "protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", | 302 | 305 | "packaging >= 14.3", | 303 | | - "google-cloud-storage >= 1.32.0, < 3.0.0", | | 306 | + "google-cloud-storage >= 1.32.0, < 3.0.0; python_version<'3.13'", | | 307 | + "google-cloud-storage >= 2.10.0, < 3.0.0; python_version>='3.13'", | 304 | 308 | "google-cloud-bigquery >= 1.15.0, < 4.0.0, !=3.20.0", | 305 | 309 | "google-cloud-resource-manager >= 1.3.3, < 3.0.0", | 306 | 310 | "shapely < 3.0.0", | | 348 | 352 | "Programming Language :: Python :: 3.10", | 349 | 353 | "Programming Language :: Python :: 3.11", | 350 | 354 | "Programming Language :: Python :: 3.12", | | 355 | + "Programming Language :: Python :: 3.13", | 351 | 356 | "Topic :: Internet", | 352 | 357 | "Topic :: Software Development :: Libraries :: Python Modules", | 353 | 358 | ], | |
Collapse file Copy file name to clipboard +15Lines changed: 15 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# -*- coding: utf-8 -*- | | 2 | +# This constraints file is required for unit tests. | | 3 | +# List all library dependencies and extras in this file. | | 4 | +google-api-core==2.21.0 # Tests google-api-core with rest async support | | 5 | +google-auth==2.35.0 # Tests google-auth with rest async support | | 6 | +proto-plus | | 7 | +mock==4.0.2 | | 8 | +google-cloud-storage==2.10.0 # Increased for kfp 2.0 compatibility | | 9 | +packaging==24.1 # Increased to unbreak canonicalize_version error (b/377774673) | | 10 | +pytest-xdist==3.3.1 # Pinned to unbreak unit tests | | 11 | +ray==2.5.0 # Pinned until 2.9.3 is verified for Ray tests | | 12 | +ipython==8.22.2 # Pinned to unbreak TypeAliasType import error | | 13 | +google-adk==0.0.2 | | 14 | +google-genai>=1.10.0 | | 15 | +google-vizier==0.1.21 |
Collapse file Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_explain_saved_model_metadata_builder_tf1_test.py +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | # | 17 | 17 |
| 18 | 18 | import pytest | | 19 | +import sys | | 20 | + | | 21 | +if sys.version_info >= (3, 13): | | 22 | + pytest.skip("Tensorflow not available for Python 3.13+", allow_module_level=True) | | 23 | + | 19 | 24 | import tensorflow.compat.v1 as tf | 20 | 25 |
| 21 | 26 | from google.cloud.aiplatform import models | | 27 | 32 |
| 28 | 33 |
| 29 | 34 | @pytest.mark.usefixtures("google_auth_mock") | | 35 | +@pytest.mark.skipif(tf is None, reason="Tensorflow not available for Python 3.13+") | 30 | 36 | class SavedModelMetadataBuilderTF1Test(tf.test.TestCase): | 31 | 37 | def _set_up(self): | 32 | 38 | self.sess = tf.Session(graph=tf.Graph()) | |
Collapse file Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_explain_saved_model_metadata_builder_tf2_test.py +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | # | 17 | 17 |
| 18 | 18 | import pytest | | 19 | +import sys | | 20 | + | | 21 | +if sys.version_info >= (3, 13): | | 22 | + pytest.skip("Tensorflow not available for Python 3.13+", allow_module_level=True) | | 23 | + | 19 | 24 | import tensorflow as tf | 20 | 25 | import numpy as np | 21 | 26 |
| |
Collapse file Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_logdir_loader.py +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | import shutil | 22 | 22 | import tempfile | 23 | 23 |
| | 24 | +import sys | | 25 | + | | 26 | +import pytest | | 27 | + | | 28 | +if sys.version_info >= (3, 13): | | 29 | + pytest.skip("Tensorflow not available for Python 3.13+", allow_module_level=True) | | 30 | + | 24 | 31 | from google.cloud.aiplatform.tensorboard import logdir_loader | 25 | 32 | import tensorflow as tf | 26 | 33 |
| |
Collapse file Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_uploader_utils.py +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 20 | 20 | from unittest import mock | 21 | 21 |
| 22 | 22 | from absl.testing import absltest | | 23 | +import sys | | 24 | + | | 25 | +import pytest | | 26 | + | | 27 | +if sys.version_info >= (3, 13): | | 28 | + pytest.skip("Tensorboard not available for Python 3.13+", allow_module_level=True) | | 29 | + | 23 | 30 | from google.cloud.aiplatform.tensorboard import uploader_utils | 24 | 31 |
| 25 | 32 |
| |
|