|
3 | 3 | import subprocess |
4 | 4 | import time |
5 | 5 | from dataclasses import dataclass |
6 | | -from typing import Annotated, Any, BinaryIO, Callable, Dict, Optional, cast |
| 6 | +from typing import Annotated, Any, BinaryIO, Callable, Dict, Optional, Union, cast |
7 | 7 |
|
8 | 8 | import git |
9 | 9 | import pydantic |
10 | 10 | from pydantic import Field |
11 | 11 | from typing_extensions import Literal |
12 | 12 |
|
| 13 | +from dstack._internal.core.deprecated import Deprecated |
13 | 14 | from dstack._internal.core.errors import ( |
14 | 15 | RepoDetachedHeadError, |
15 | 16 | RepoError, |
|
19 | 20 | from dstack._internal.core.models.common import CoreConfig, generate_dual_core_model |
20 | 21 | from dstack._internal.core.models.repos.base import BaseRepoInfo, Repo |
21 | 22 | from dstack._internal.utils.hash import get_sha256, slugify |
| 23 | +from dstack._internal.utils.logging import get_logger |
22 | 24 | from dstack._internal.utils.path import PathLike |
23 | 25 | from dstack._internal.utils.ssh import get_host_config |
24 | 26 |
|
| 27 | +logger = get_logger(__name__) |
| 28 | + |
25 | 29 | SCP_LOCATION_REGEX = re.compile(r"(?P<user>[^/]+)@(?P<host>[^/]+?):(?P<path>.+)", re.IGNORECASE) |
26 | 30 |
|
27 | 31 |
|
@@ -147,7 +151,13 @@ def __init__( |
147 | 151 | repo_url: Optional[str] = None, |
148 | 152 | repo_branch: Optional[str] = None, |
149 | 153 | repo_hash: Optional[str] = None, |
| 154 | + repo_data: Union[Deprecated, RemoteRunRepoData, None] = Deprecated.PLACEHOLDER, |
150 | 155 | ): |
| 156 | + if repo_data is not Deprecated.PLACEHOLDER: |
| 157 | + logger.warning( |
| 158 | + "The repo_data argument is deprecated, ignored, and will be removed soon." |
| 159 | + " As it was always ignored, it's safe to remove it." |
| 160 | + ) |
151 | 161 | # _init_from_* methods must set repo_dir, repo_url, and run_repo_data |
152 | 162 | if local_repo_dir is not None: |
153 | 163 | try: |
|
0 commit comments