Source code for runway.dependency_managers.base_classes
"""Base classes for dependency managers."""from__future__importannotationsfrompathlibimportPathfromtypingimportTYPE_CHECKING,Any,ClassVarfrom..compatimportcached_propertyfrom..mixinsimportCliInterfaceMixinifTYPE_CHECKING:from_typeshedimportStrPathfrom..contextimportCfnginContext,RunwayContextfrom..utilsimportVersion
[docs]classDependencyManager(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."""
[docs]def__init__(self,context:CfnginContext|RunwayContext,cwd:StrPath)->None:"""Instantiate class. Args: context: CFNgin or Runway context object. cwd: Working directory where commands will be run. """self.ctx=contextself.cwd=cwdifisinstance(cwd,Path)elsePath(cwd)
[docs]@classmethoddefdir_is_project(cls,directory:StrPath,**__kwargs:Any)->bool:"""Determine if the directory contains a project for this dependency manager. Args: directory: Directory to check. """raiseNotImplementedError