-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from awslabs/develop
Release: v0.1.0
- Loading branch information
Showing
140 changed files
with
4,080 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
AWS Lambda Builders | ||
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
The function "which" at aws_lambda_builders/utils.py was copied from https://github.com/python/cpython/blob/3.7/Lib/shutil.py | ||
SPDX-License-Identifier: Python-2.0 | ||
Copyright 2019 by the Python Software Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
AWS Lambda Builder Library | ||
""" | ||
__version__ = '0.0.5' | ||
RPC_PROTOCOL_VERSION = "0.1" | ||
__version__ = '0.1.0' | ||
RPC_PROTOCOL_VERSION = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Class containing resolved path of binary given a validator and a resolver and the name of the binary. | ||
""" | ||
|
||
|
||
class BinaryPath(object): | ||
|
||
def __init__(self, resolver, validator, binary, binary_path=None): | ||
self.resolver = resolver | ||
self.validator = validator | ||
self.binary = binary | ||
self._binary_path = binary_path | ||
self.path_provided = True if self._binary_path else False | ||
|
||
@property | ||
def binary_path(self): | ||
return self._binary_path | ||
|
||
@binary_path.setter | ||
def binary_path(self, binary_path): | ||
self._binary_path = binary_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Basic Path Resolver that looks for the executable by runtime first, before proceeding to 'language' in PATH. | ||
""" | ||
|
||
from aws_lambda_builders.utils import which | ||
|
||
|
||
class PathResolver(object): | ||
|
||
def __init__(self, binary, runtime, executable_search_paths=None): | ||
self.binary = binary | ||
self.runtime = runtime | ||
self.executables = [self.runtime, self.binary] | ||
self.executable_search_paths = executable_search_paths | ||
|
||
def _which(self): | ||
exec_paths = [] | ||
for executable in [executable for executable in self.executables if executable is not None]: | ||
paths = which(executable, executable_search_paths=self.executable_search_paths) | ||
exec_paths.extend(paths) | ||
|
||
if not exec_paths: | ||
raise ValueError("Path resolution for runtime: {} of binary: " | ||
"{} was not successful".format(self.runtime, self.binary)) | ||
return exec_paths | ||
|
||
@property | ||
def exec_paths(self): | ||
return self._which() |
Oops, something went wrong.