Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/dstack/_internal/core/models/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class BaseRunConfiguration(CoreModel):
@validator("python", pre=True, always=True)
def convert_python(cls, v, values) -> Optional[PythonVersion]:
if v is not None and values.get("image"):
raise KeyError("`image` and `python` are mutually exclusive fields")
raise ValueError("`image` and `python` are mutually exclusive fields")
if isinstance(v, float):
v = str(v)
if v == "3.1":
Expand All @@ -558,11 +558,11 @@ def convert_python(cls, v, values) -> Optional[PythonVersion]:
@validator("docker", pre=True, always=True)
def _docker(cls, v, values) -> Optional[bool]:
if v is True and values.get("image"):
raise KeyError("`image` and `docker` are mutually exclusive fields")
raise ValueError("`image` and `docker` are mutually exclusive fields")
if v is True and values.get("python"):
raise KeyError("`python` and `docker` are mutually exclusive fields")
raise ValueError("`python` and `docker` are mutually exclusive fields")
if v is True and values.get("nvcc"):
raise KeyError("`nvcc` and `docker` are mutually exclusive fields")
raise ValueError("`nvcc` and `docker` are mutually exclusive fields")
# Ideally, we'd like to also prohibit privileged=False when docker=True,
# but it's not possible to do so without breaking backwards compatibility.
return v
Expand Down