runway.dependency_managers.base_classes module

Base classes for dependency managers.

class runway.dependency_managers.base_classes.DependencyManager[source]

Bases: runway.mixins.CliInterfaceMixin

Dependency manager for the AWS Lambda runtime.

Dependency managers are interfaced with via subprocess to ensure that the correct version is being used. This is primarily target at Python dependency manager that we could import and use directly.

CONFIG_FILES: ClassVar[Tuple[str, ...]]

Configuration files used by the dependency manager.

__init__(context: Union[CfnginContext, RunwayContext], cwd: StrPath) None[source]

Instantiate class.

  • context – CFNgin or Runway context object.

  • cwd – Working directory where commands will be run.

ctx: Union[CfnginContext, RunwayContext]

CFNgin or Runway context object.

cwd: Path

Working directory where commands will be run.

property version: Version

Get executable version.

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

Convert string kwarg name into a CLI argument.

classmethod dir_is_project(directory: StrPath, **_DependencyManager__kwargs: Any) bool[source]

Determine if the directory contains a project for this dependency manager.


directory – Directory to check.

classmethod found_in_path() bool

Determine if executable is found in $PATH.

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

Generate command to be executed and log it.

  • command – Command to run.

  • args – Additional args to pass to the command.


The full command to be passed into a subprocess.

static list2cmdline(split_command: Iterable[str]) str

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

Handles multi-platform differences.

EXECUTABLE: ClassVar[str]

CLI executable.