Skip to content

Commit 6a0ff2c

Browse files
committed
Restore RemoteRepo repo_data argument
1 parent 5208117 commit 6a0ff2c

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/dstack/_internal/core/models/repos/remote.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
import subprocess
44
import time
55
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
77

88
import git
99
import pydantic
1010
from pydantic import Field
1111
from typing_extensions import Literal
1212

13+
from dstack._internal.core.deprecated import Deprecated
1314
from dstack._internal.core.errors import (
1415
RepoDetachedHeadError,
1516
RepoError,
@@ -19,9 +20,12 @@
1920
from dstack._internal.core.models.common import CoreConfig, generate_dual_core_model
2021
from dstack._internal.core.models.repos.base import BaseRepoInfo, Repo
2122
from dstack._internal.utils.hash import get_sha256, slugify
23+
from dstack._internal.utils.logging import get_logger
2224
from dstack._internal.utils.path import PathLike
2325
from dstack._internal.utils.ssh import get_host_config
2426

27+
logger = get_logger(__name__)
28+
2529
SCP_LOCATION_REGEX = re.compile(r"(?P<user>[^/]+)@(?P<host>[^/]+?):(?P<path>.+)", re.IGNORECASE)
2630

2731

@@ -147,7 +151,13 @@ def __init__(
147151
repo_url: Optional[str] = None,
148152
repo_branch: Optional[str] = None,
149153
repo_hash: Optional[str] = None,
154+
repo_data: Union[Deprecated, RemoteRunRepoData, None] = Deprecated.PLACEHOLDER,
150155
):
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+
)
151161
# _init_from_* methods must set repo_dir, repo_url, and run_repo_data
152162
if local_repo_dir is not None:
153163
try:

src/dstack/api/_public/runs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import dstack.api as api
1818
from dstack._internal.core.consts import DSTACK_RUNNER_HTTP_PORT, DSTACK_RUNNER_SSH_PORT
19+
from dstack._internal.core.deprecated import Deprecated
1920
from dstack._internal.core.errors import ClientError, ConfigurationError, ResourceNotExistsError
2021
from dstack._internal.core.models.backends.base import BackendType
2122
from dstack._internal.core.models.configurations import (
@@ -49,7 +50,6 @@
4950
from dstack._internal.utils.files import create_file_archive
5051
from dstack._internal.utils.logging import get_logger
5152
from dstack._internal.utils.path import PathLike
52-
from dstack.api._public.common import Deprecated
5353
from dstack.api.server import APIClient
5454

5555
logger = get_logger(__name__)

0 commit comments

Comments
 (0)