runway.mixins module

Class mixins.

class runway.mixins.CliInterfaceMixin[source]

Bases: object

Mixin for adding CLI interface methods.

EXECUTABLE: ClassVar[str]

CLI executable.

ctx: Union[CfnginContext, RunwayContext]

CFNgin or Runway context object.

cwd: Path

Working directory where commands will be run.

static convert_to_cli_arg(arg_name: str, *, prefix: str = '--') str[source]

Convert string kwarg name into a CLI argument.

classmethod found_in_path() bool[source]

Determine if executable is found in $PATH.

classmethod generate_command(command: Union[List[str], str], **kwargs: Optional[Union[bool, Iterable[str], str]]) List[str][source]

Generate command to be executed and log it.

Parameters
  • command – Command to run.

  • args – Additional args to pass to the command.

Returns

The full command to be passed into a subprocess.

static list2cmdline(split_command: Iterable[str]) str[source]

Combine a list of strings into a string that can be run as a command.

Handles multi-platform differences.

__init__()
__new__(**kwargs)
class runway.mixins.DelCachedPropMixin[source]

Bases: object

Mixin to handle safely clearing the value of functools.cached_property().

__init__()
__new__(**kwargs)