in sagemaker_image_builder/utils.py [0:0]
def get_match_specs(file_path) -> dict[str, MatchSpec]:
if not os.path.isfile(file_path):
return {}
requirement_spec = read_env_file(file_path)
assert len(requirement_spec.environment.dependencies) == 1
assert "conda" in requirement_spec.environment.dependencies
return {MatchSpec(i).get("name"): MatchSpec(i) for i in requirement_spec.environment.dependencies["conda"]}