Skip to content

Commit 71747e8

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- 64d6440 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add Lustre support to the Vertex Training Custom Job API docs: A comment for field `timeout` in message `.google.cloud.aiplatform.v1beta1.Scheduling` is changed docs: A comment for field `restart_job_on_worker_restart` in message `.google.cloud.aiplatform.v1beta1.Scheduling` is changed PiperOrigin-RevId: 845354898 Source-Link: googleapis/googleapis@a8e146a Source-Link: googleapis/googleapis-gen@06bf339 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDZiZjMzOTNiOGFiNWRiNWU2OWM1Y2Q4MDQ4NmIzZDYwYjRiM2I2OSJ9 feat: Add Lustre support to the Vertex Training Custom Job API docs: A comment for field `timeout` in message `.google.cloud.aiplatform.v1beta1.Scheduling` is changed docs: A comment for field `restart_job_on_worker_restart` in message `.google.cloud.aiplatform.v1beta1.Scheduling` is changed PiperOrigin-RevId: 845354898 Source-Link: googleapis/googleapis@a8e146a Source-Link: googleapis/googleapis-gen@06bf339 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDZiZjMzOTNiOGFiNWRiNWU2OWM1Y2Q4MDQ4NmIzZDYwYjRiM2I2OSJ9 -- 306ffc0 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#6199 from googleapis:owl-bot-copy d98614f PiperOrigin-RevId: 845568378
1 parent eacba2a commit 71747e8

File tree

159 files changed

+19876
-3091
lines changed

Some content is hidden

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

159 files changed

+19876
-3091
lines changed

google/cloud/aiplatform/v1/schema/predict/instance_v1/__init__.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@
1717
gapic_version as package_version,
1818
)
1919

20+
import google.api_core as api_core
21+
import sys
22+
2023
__version__ = package_version.__version__
2124

25+
if sys.version_info >= (3, 8): # pragma: NO COVER
26+
from importlib import metadata
27+
else: # pragma: NO COVER
28+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
29+
# this code path once we drop support for Python 3.7
30+
import importlib_metadata as metadata
31+
2232

2333
from .types.image_classification import ImageClassificationPredictionInstance
2434
from .types.image_object_detection import ImageObjectDetectionPredictionInstance
@@ -30,6 +40,100 @@
3040
from .types.video_classification import VideoClassificationPredictionInstance
3141
from .types.video_object_tracking import VideoObjectTrackingPredictionInstance
3242

43+
if hasattr(api_core, "check_python_version") and hasattr(
44+
api_core, "check_dependency_versions"
45+
): # pragma: NO COVER
46+
api_core.check_python_version("google.cloud.aiplatform.v1.schema.predict.instance_v1") # type: ignore
47+
api_core.check_dependency_versions("google.cloud.aiplatform.v1.schema.predict.instance_v1") # type: ignore
48+
else: # pragma: NO COVER
49+
# An older version of api_core is installed which does not define the
50+
# functions above. We do equivalent checks manually.
51+
try:
52+
import warnings
53+
import sys
54+
55+
_py_version_str = sys.version.split()[0]
56+
_package_label = "google.cloud.aiplatform.v1.schema.predict.instance_v1"
57+
if sys.version_info < (3, 9):
58+
warnings.warn(
59+
"You are using a non-supported Python version "
60+
+ f"({_py_version_str}). Google will not post any further "
61+
+ f"updates to {_package_label} supporting this Python version. "
62+
+ "Please upgrade to the latest Python version, or at "
63+
+ f"least to Python 3.9, and then update {_package_label}.",
64+
FutureWarning,
65+
)
66+
if sys.version_info[:2] == (3, 9):
67+
warnings.warn(
68+
f"You are using a Python version ({_py_version_str}) "
69+
+ f"which Google will stop supporting in {_package_label} in "
70+
+ "January 2026. Please "
71+
+ "upgrade to the latest Python version, or at "
72+
+ "least to Python 3.10, before then, and "
73+
+ f"then update {_package_label}.",
74+
FutureWarning,
75+
)
76+
77+
def parse_version_to_tuple(version_string: str):
78+
"""Safely converts a semantic version string to a comparable tuple of integers.
79+
Example: "4.25.8" -> (4, 25, 8)
80+
Ignores non-numeric parts and handles common version formats.
81+
Args:
82+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
83+
Returns:
84+
Tuple of integers for the parsed version string.
85+
"""
86+
parts = []
87+
for part in version_string.split("."):
88+
try:
89+
parts.append(int(part))
90+
except ValueError:
91+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
92+
# This is a simplification compared to 'packaging.parse_version', but sufficient
93+
# for comparing strictly numeric semantic versions.
94+
break
95+
return tuple(parts)
96+
97+
def _get_version(dependency_name):
98+
try:
99+
version_string: str = metadata.version(dependency_name)
100+
parsed_version = parse_version_to_tuple(version_string)
101+
return (parsed_version, version_string)
102+
except Exception:
103+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
104+
# or errors during parse_version_to_tuple
105+
return (None, "--")
106+
107+
_dependency_package = "google.protobuf"
108+
_next_supported_version = "4.25.8"
109+
_next_supported_version_tuple = (4, 25, 8)
110+
_recommendation = " (we recommend 6.x)"
111+
(_version_used, _version_used_string) = _get_version(_dependency_package)
112+
if _version_used and _version_used < _next_supported_version_tuple:
113+
warnings.warn(
114+
f"Package {_package_label} depends on "
115+
+ f"{_dependency_package}, currently installed at version "
116+
+ f"{_version_used_string}. Future updates to "
117+
+ f"{_package_label} will require {_dependency_package} at "
118+
+ f"version {_next_supported_version} or higher{_recommendation}."
119+
+ " Please ensure "
120+
+ "that either (a) your Python environment doesn't pin the "
121+
+ f"version of {_dependency_package}, so that updates to "
122+
+ f"{_package_label} can require the higher version, or "
123+
+ "(b) you manually update your Python environment to use at "
124+
+ f"least version {_next_supported_version} of "
125+
+ f"{_dependency_package}.",
126+
FutureWarning,
127+
)
128+
except Exception:
129+
warnings.warn(
130+
"Could not determine the version of Python "
131+
+ "currently being used. To continue receiving "
132+
+ "updates for {_package_label}, ensure you are "
133+
+ "using a supported version of Python; see "
134+
+ "https://devguide.python.org/versions/"
135+
)
136+
33137
__all__ = (
34138
"ImageClassificationPredictionInstance",
35139
"ImageObjectDetectionPredictionInstance",

google/cloud/aiplatform/v1/schema/predict/params_v1/__init__.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@
1717
gapic_version as package_version,
1818
)
1919

20+
import google.api_core as api_core
21+
import sys
22+
2023
__version__ = package_version.__version__
2124

25+
if sys.version_info >= (3, 8): # pragma: NO COVER
26+
from importlib import metadata
27+
else: # pragma: NO COVER
28+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
29+
# this code path once we drop support for Python 3.7
30+
import importlib_metadata as metadata
31+
2232

2333
from .types.image_classification import ImageClassificationPredictionParams
2434
from .types.image_object_detection import ImageObjectDetectionPredictionParams
@@ -27,6 +37,100 @@
2737
from .types.video_classification import VideoClassificationPredictionParams
2838
from .types.video_object_tracking import VideoObjectTrackingPredictionParams
2939

40+
if hasattr(api_core, "check_python_version") and hasattr(
41+
api_core, "check_dependency_versions"
42+
): # pragma: NO COVER
43+
api_core.check_python_version("google.cloud.aiplatform.v1.schema.predict.params_v1") # type: ignore
44+
api_core.check_dependency_versions("google.cloud.aiplatform.v1.schema.predict.params_v1") # type: ignore
45+
else: # pragma: NO COVER
46+
# An older version of api_core is installed which does not define the
47+
# functions above. We do equivalent checks manually.
48+
try:
49+
import warnings
50+
import sys
51+
52+
_py_version_str = sys.version.split()[0]
53+
_package_label = "google.cloud.aiplatform.v1.schema.predict.params_v1"
54+
if sys.version_info < (3, 9):
55+
warnings.warn(
56+
"You are using a non-supported Python version "
57+
+ f"({_py_version_str}). Google will not post any further "
58+
+ f"updates to {_package_label} supporting this Python version. "
59+
+ "Please upgrade to the latest Python version, or at "
60+
+ f"least to Python 3.9, and then update {_package_label}.",
61+
FutureWarning,
62+
)
63+
if sys.version_info[:2] == (3, 9):
64+
warnings.warn(
65+
f"You are using a Python version ({_py_version_str}) "
66+
+ f"which Google will stop supporting in {_package_label} in "
67+
+ "January 2026. Please "
68+
+ "upgrade to the latest Python version, or at "
69+
+ "least to Python 3.10, before then, and "
70+
+ f"then update {_package_label}.",
71+
FutureWarning,
72+
)
73+
74+
def parse_version_to_tuple(version_string: str):
75+
"""Safely converts a semantic version string to a comparable tuple of integers.
76+
Example: "4.25.8" -> (4, 25, 8)
77+
Ignores non-numeric parts and handles common version formats.
78+
Args:
79+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
80+
Returns:
81+
Tuple of integers for the parsed version string.
82+
"""
83+
parts = []
84+
for part in version_string.split("."):
85+
try:
86+
parts.append(int(part))
87+
except ValueError:
88+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
89+
# This is a simplification compared to 'packaging.parse_version', but sufficient
90+
# for comparing strictly numeric semantic versions.
91+
break
92+
return tuple(parts)
93+
94+
def _get_version(dependency_name):
95+
try:
96+
version_string: str = metadata.version(dependency_name)
97+
parsed_version = parse_version_to_tuple(version_string)
98+
return (parsed_version, version_string)
99+
except Exception:
100+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
101+
# or errors during parse_version_to_tuple
102+
return (None, "--")
103+
104+
_dependency_package = "google.protobuf"
105+
_next_supported_version = "4.25.8"
106+
_next_supported_version_tuple = (4, 25, 8)
107+
_recommendation = " (we recommend 6.x)"
108+
(_version_used, _version_used_string) = _get_version(_dependency_package)
109+
if _version_used and _version_used < _next_supported_version_tuple:
110+
warnings.warn(
111+
f"Package {_package_label} depends on "
112+
+ f"{_dependency_package}, currently installed at version "
113+
+ f"{_version_used_string}. Future updates to "
114+
+ f"{_package_label} will require {_dependency_package} at "
115+
+ f"version {_next_supported_version} or higher{_recommendation}."
116+
+ " Please ensure "
117+
+ "that either (a) your Python environment doesn't pin the "
118+
+ f"version of {_dependency_package}, so that updates to "
119+
+ f"{_package_label} can require the higher version, or "
120+
+ "(b) you manually update your Python environment to use at "
121+
+ f"least version {_next_supported_version} of "
122+
+ f"{_dependency_package}.",
123+
FutureWarning,
124+
)
125+
except Exception:
126+
warnings.warn(
127+
"Could not determine the version of Python "
128+
+ "currently being used. To continue receiving "
129+
+ "updates for {_package_label}, ensure you are "
130+
+ "using a supported version of Python; see "
131+
+ "https://devguide.python.org/versions/"
132+
)
133+
30134
__all__ = (
31135
"ImageClassificationPredictionParams",
32136
"ImageObjectDetectionPredictionParams",

google/cloud/aiplatform/v1/schema/predict/prediction_v1/__init__.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@
1717
gapic_version as package_version,
1818
)
1919

20+
import google.api_core as api_core
21+
import sys
22+
2023
__version__ = package_version.__version__
2124

25+
if sys.version_info >= (3, 8): # pragma: NO COVER
26+
from importlib import metadata
27+
else: # pragma: NO COVER
28+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
29+
# this code path once we drop support for Python 3.7
30+
import importlib_metadata as metadata
31+
2232

2333
from .types.classification import ClassificationPredictionResult
2434
from .types.image_object_detection import ImageObjectDetectionPredictionResult
@@ -31,6 +41,100 @@
3141
from .types.video_classification import VideoClassificationPredictionResult
3242
from .types.video_object_tracking import VideoObjectTrackingPredictionResult
3343

44+
if hasattr(api_core, "check_python_version") and hasattr(
45+
api_core, "check_dependency_versions"
46+
): # pragma: NO COVER
47+
api_core.check_python_version("google.cloud.aiplatform.v1.schema.predict.prediction_v1") # type: ignore
48+
api_core.check_dependency_versions("google.cloud.aiplatform.v1.schema.predict.prediction_v1") # type: ignore
49+
else: # pragma: NO COVER
50+
# An older version of api_core is installed which does not define the
51+
# functions above. We do equivalent checks manually.
52+
try:
53+
import warnings
54+
import sys
55+
56+
_py_version_str = sys.version.split()[0]
57+
_package_label = "google.cloud.aiplatform.v1.schema.predict.prediction_v1"
58+
if sys.version_info < (3, 9):
59+
warnings.warn(
60+
"You are using a non-supported Python version "
61+
+ f"({_py_version_str}). Google will not post any further "
62+
+ f"updates to {_package_label} supporting this Python version. "
63+
+ "Please upgrade to the latest Python version, or at "
64+
+ f"least to Python 3.9, and then update {_package_label}.",
65+
FutureWarning,
66+
)
67+
if sys.version_info[:2] == (3, 9):
68+
warnings.warn(
69+
f"You are using a Python version ({_py_version_str}) "
70+
+ f"which Google will stop supporting in {_package_label} in "
71+
+ "January 2026. Please "
72+
+ "upgrade to the latest Python version, or at "
73+
+ "least to Python 3.10, before then, and "
74+
+ f"then update {_package_label}.",
75+
FutureWarning,
76+
)
77+
78+
def parse_version_to_tuple(version_string: str):
79+
"""Safely converts a semantic version string to a comparable tuple of integers.
80+
Example: "4.25.8" -> (4, 25, 8)
81+
Ignores non-numeric parts and handles common version formats.
82+
Args:
83+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
84+
Returns:
85+
Tuple of integers for the parsed version string.
86+
"""
87+
parts = []
88+
for part in version_string.split("."):
89+
try:
90+
parts.append(int(part))
91+
except ValueError:
92+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
93+
# This is a simplification compared to 'packaging.parse_version', but sufficient
94+
# for comparing strictly numeric semantic versions.
95+
break
96+
return tuple(parts)
97+
98+
def _get_version(dependency_name):
99+
try:
100+
version_string: str = metadata.version(dependency_name)
101+
parsed_version = parse_version_to_tuple(version_string)
102+
return (parsed_version, version_string)
103+
except Exception:
104+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
105+
# or errors during parse_version_to_tuple
106+
return (None, "--")
107+
108+
_dependency_package = "google.protobuf"
109+
_next_supported_version = "4.25.8"
110+
_next_supported_version_tuple = (4, 25, 8)
111+
_recommendation = " (we recommend 6.x)"
112+
(_version_used, _version_used_string) = _get_version(_dependency_package)
113+
if _version_used and _version_used < _next_supported_version_tuple:
114+
warnings.warn(
115+
f"Package {_package_label} depends on "
116+
+ f"{_dependency_package}, currently installed at version "
117+
+ f"{_version_used_string}. Future updates to "
118+
+ f"{_package_label} will require {_dependency_package} at "
119+
+ f"version {_next_supported_version} or higher{_recommendation}."
120+
+ " Please ensure "
121+
+ "that either (a) your Python environment doesn't pin the "
122+
+ f"version of {_dependency_package}, so that updates to "
123+
+ f"{_package_label} can require the higher version, or "
124+
+ "(b) you manually update your Python environment to use at "
125+
+ f"least version {_next_supported_version} of "
126+
+ f"{_dependency_package}.",
127+
FutureWarning,
128+
)
129+
except Exception:
130+
warnings.warn(
131+
"Could not determine the version of Python "
132+
+ "currently being used. To continue receiving "
133+
+ "updates for {_package_label}, ensure you are "
134+
+ "using a supported version of Python; see "
135+
+ "https://devguide.python.org/versions/"
136+
)
137+
34138
__all__ = (
35139
"ClassificationPredictionResult",
36140
"ImageObjectDetectionPredictionResult",

0 commit comments

Comments
 (0)