Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: valohai/valohai-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 37e691de1e2138ba000d4d25b49b0c0e9bede306
Choose a base ref
..
head repository: valohai/valohai-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2bd0153724a318951f346831e0453aa4314db877
Choose a head ref
Showing with 7 additions and 8 deletions.
  1. +2 −2 tests/commands/execution/test_run.py
  2. +0 −1 valohai_cli/commands/execution/run/frontend_command.py
  3. +5 −5 valohai_cli/utils/__init__.py
4 changes: 2 additions & 2 deletions tests/commands/execution/test_run.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
import yaml

from tests.commands.run_test_utils import ALTERNATIVE_YAML, RunAPIMock, RunTestSetup
from tests.fixture_data import CONFIG_YAML, PROJECT_DATA, KUBE_RESOURCE_YAML
from tests.fixture_data import CONFIG_YAML, KUBE_RESOURCE_YAML, PROJECT_DATA
from valohai_cli.commands.execution.run import run
from valohai_cli.ctx import get_project
from valohai_cli.models.project import Project
@@ -390,4 +390,4 @@ def test_kube_step_override_device_empty(run_test_setup_kube):
}
}
}
}
}
1 change: 0 additions & 1 deletion valohai_cli/commands/execution/run/frontend_command.py
Original file line number Diff line number Diff line change
@@ -133,7 +133,6 @@ def run(
if autorestart:
runtime_config["autorestart"] = autorestart


if k8s_devices and k8s_device_none:
raise click.UsageError('--k8s-device=(...) and --k8s-device-none cannot be used together. '
'Using --k8s-device=(...) will discard all Kubernetes device default values on its own.')
10 changes: 5 additions & 5 deletions valohai_cli/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
import string
import unicodedata
import webbrowser
from typing import Any, Dict, Iterable, Iterator, Tuple, Union, TypeVar, Callable
from typing import Any, Callable, Dict, Iterable, Iterator, Tuple, Union

import click

@@ -132,13 +132,13 @@ def sanitize_option_name(name: str) -> str:
return re.sub(r'[^-a-z0-9]+', '-', name, flags=re.IGNORECASE).strip('-')


ValueType = TypeVar('ValueType', bound=str)

# Once mypy supports using TypeVars in default arguments, we can make a more specific type for coerce.
# Mypy issue: https://github.com/python/mypy/issues/3737
def parse_environment_variable_strings(
envvar_strings: Iterable[str],
*,
coerce: Callable[[str], ValueType] = str
) -> Dict[str, ValueType]:
coerce: Callable[[str], Any] = str
) -> Dict[str, Any]:
"""
Parse a list of environment variable strings into a dict.
"""