How to use get_runtime_split method in localstack

Best Python code snippet using localstack_python

runtime_executor.py

Source:runtime_executor.py Github

copy

Full Screen

...31COPY code/ /var/task32"""33# TODO provided runtimes34# TODO a tad hacky, might cause problems in the future.. just use mapping?35def get_runtime_split(runtime: str) -> Tuple[str, str]:36 match = re.match(RUNTIME_REGEX, runtime)37 if match:38 runtime, version = match.group("runtime"), match.group("version")39 # sad exception for .net40 if runtime == "dotnetcore":41 runtime = "dotnet"42 version = f"core{version}"43 return runtime, version44 raise ValueError(f"Unknown/unsupported runtime '{runtime}'")45def get_path_for_function(function_version: FunctionVersion) -> Path:46 return Path(47 f"{config.dirs.tmp}/lambda/{function_version.id.qualified_arn().replace(':', '_').replace('$', '_')}/"48 )49def get_code_path_for_function(function_version: FunctionVersion) -> Path:50 return get_path_for_function(function_version) / "code"51def get_image_name_for_function(function_version: FunctionVersion) -> str:52 return f"localstack/lambda-{function_version.id.qualified_arn().replace(':', '_').replace('$', '_').lower()}"53def get_image_for_runtime(runtime: str) -> str:54 runtime, version = get_runtime_split(runtime)55 return f"{IMAGE_PREFIX}{runtime}:{version}"56def get_runtime_client_path() -> Path:57 return Path(LAMBDA_RUNTIME_INIT_PATH)58def prepare_image(target_path: Path, function_version: FunctionVersion) -> None:59 if not function_version.config.runtime:60 raise NotImplementedError("Custom images are currently not supported")61 src_init = get_runtime_client_path()62 # copy init file63 target_init = target_path / "aws-lambda-rie"64 shutil.copy(src_init, target_init)65 target_init.chmod(0o755)66 # copy code67 # create dockerfile68 docker_file_path = target_path / "Dockerfile"...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful