Skip to content

Commit

Permalink
fix: remove usage of distutils
Browse files Browse the repository at this point in the history
Partially fixes #2931

distutils is deprecated in Python 3.12 (https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated)

PiperOrigin-RevId: 606697684
  • Loading branch information
vertex-sdk-bot authored and copybara-github committed Feb 13, 2024
1 parent d727189 commit e35ab64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions google/cloud/aiplatform/utils/prediction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

import distutils.dir_util
import shutil
import inspect
import logging
import os
Expand Down Expand Up @@ -150,4 +150,4 @@ def download_model_artifacts(artifact_uri: str) -> None:
blob.download_to_filename(name_without_prefix)
else:
# Copy files to the current working directory.
distutils.dir_util.copy_tree(artifact_uri, ".")
shutil.copytree(artifact_uri, ".")
2 changes: 1 addition & 1 deletion tests/unit/aiplatform/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_invalid_region_does_not_raise_with_valid_region():

@pytest.fixture
def copy_tree_mock():
with mock.patch("distutils.dir_util.copy_tree") as copy_tree_mock:
with mock.patch("shutil.copytree") as copy_tree_mock:
yield copy_tree_mock


Expand Down

0 comments on commit e35ab64

Please sign in to comment.