runway.mixins module

Class mixins.

class runway.mixins.CliInterfaceMixin[source]

Bases: object

Mixin for adding CLI interface methods.

EXECUTABLE: ClassVar[str]

CLI executable.

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

Convert string kwarg name into a CLI argument.

ctx: CfnginContext | RunwayContext

CFNgin or Runway context object.

cwd: Path

Working directory where commands will be run.

classmethod found_in_path() bool[source]

Determine if executable is found in $PATH.

classmethod generate_command(command: list[str] | str, **kwargs: bool | Iterable[str] | str | None) list[str][source]

Generate command to be executed and log it.

Parameters:
  • command – Command to run.

  • args – Additional args to pass to the command.

  • **kwargs – Arbitrary keyword arguments.

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.

class runway.mixins.DelCachedPropMixin[source]

Bases: object

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