Skip to content

Commit 514031f

Browse files
authored
fix: use version.py for versioning (#804)
1 parent 33add34 commit 514031f

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

google/cloud/aiplatform/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,33 @@
1515
# limitations under the License.
1616
#
1717

18-
from google.cloud.aiplatform import gapic
19-
from google.cloud.aiplatform import explain
18+
19+
from google.cloud.aiplatform import version as aiplatform_version
20+
21+
__version__ = aiplatform_version.__version__
22+
2023

2124
from google.cloud.aiplatform import initializer
25+
2226
from google.cloud.aiplatform.datasets import (
2327
ImageDataset,
2428
TabularDataset,
2529
TextDataset,
2630
TimeSeriesDataset,
2731
VideoDataset,
2832
)
33+
from google.cloud.aiplatform import explain
34+
from google.cloud.aiplatform import gapic
2935
from google.cloud.aiplatform import hyperparameter_tuning
3036
from google.cloud.aiplatform.metadata import metadata
3137
from google.cloud.aiplatform.models import Endpoint
3238
from google.cloud.aiplatform.models import Model
33-
from google.cloud.aiplatform.pipeline_jobs import PipelineJob
3439
from google.cloud.aiplatform.jobs import (
3540
BatchPredictionJob,
3641
CustomJob,
3742
HyperparameterTuningJob,
3843
)
44+
from google.cloud.aiplatform.pipeline_jobs import PipelineJob
3945
from google.cloud.aiplatform.tensorboard import Tensorboard
4046
from google.cloud.aiplatform.training_jobs import (
4147
CustomTrainingJob,

google/cloud/aiplatform/version.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Copyright 2021 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
__version__ = "1.6.1"

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@
2121
import setuptools # type: ignore
2222

2323
name = "google-cloud-aiplatform"
24-
version = "1.6.1"
25-
description = "Cloud AI Platform API client library"
24+
description = "Vertex AI API client library"
2625

2726
package_root = os.path.abspath(os.path.dirname(__file__))
2827
readme_filename = os.path.join(package_root, "README.rst")
2928
with io.open(readme_filename, encoding="utf-8") as readme_file:
3029
readme = readme_file.read()
3130

31+
version = {}
32+
with open(os.path.join(package_root, "google/cloud/aiplatform/version.py")) as fp:
33+
exec(fp.read(), version)
34+
version = version["__version__"]
35+
3236
tensorboard_extra_require = ["tensorflow >=2.3.0, <=2.5.0"]
3337
metadata_extra_require = ["pandas >= 1.0.0"]
3438
xai_extra_require = ["tensorflow >=2.3.0, <=2.5.0"]

0 commit comments

Comments
 (0)