Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion aws_lambda_builders/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def _error_response(request_id, http_status_code, message):


def _parse_version(version_string):

if VERSION_REGEX.match(version_string):
return float(version_string)
else:
Expand Down
5 changes: 0 additions & 5 deletions aws_lambda_builders/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def has_value(item):

class _ActionMetaClass(type):
def __new__(mcs, name, bases, class_dict):

cls = type.__new__(mcs, name, bases, class_dict)

if cls.__name__ == "BaseAction":
Expand Down Expand Up @@ -100,7 +99,6 @@ def __repr__(self):


class CopySourceAction(BaseAction):

NAME = "CopySource"

DESCRIPTION = "Copying source code while skipping certain commonly excluded files"
Expand All @@ -117,7 +115,6 @@ def execute(self):


class LinkSourceAction(BaseAction):

NAME = "LinkSource"

DESCRIPTION = "Linking source code to the target folder"
Expand All @@ -142,7 +139,6 @@ def execute(self):


class CopyDependenciesAction(BaseAction):

NAME = "CopyDependencies"

DESCRIPTION = "Copying dependencies while skipping source file"
Expand All @@ -166,7 +162,6 @@ def execute(self):


class MoveDependenciesAction(BaseAction):

NAME = "MoveDependencies"

DESCRIPTION = "Moving dependencies while skipping source file"
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class LambdaBuilder(object):
"""

def __init__(self, language, dependency_manager, application_framework, supported_workflows=None):

"""
Initialize the builder.
:type supported_workflows: list
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class LambdaBuilderError(Exception):

MESSAGE = ""

def __init__(self, **kwargs):
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __getitem__(self, capability):
return self._data[key]

def __setitem__(self, capability, value):

key = self._make_key(capability)

try:
Expand Down
2 changes: 0 additions & 2 deletions aws_lambda_builders/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@


class BuildMode(object):

DEBUG = "debug"
RELEASE = "release"

Expand Down Expand Up @@ -376,7 +375,6 @@ def run(self):

raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
except Exception as ex:

LOG.debug("%s raised unhandled exception", action_info, exc_info=ex)

raise WorkflowUnknownError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/custom_make/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def __init__(self, osutils, make_exe=None):
self.make_exe = make_exe

def run(self, args, env=None, cwd=None):

"""
Runs the action.

Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/custom_make/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class CustomMakeWorkflow(BaseWorkflow):
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.OPTIONALLY_SUPPORTED

def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):

super(CustomMakeWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def __init__(self, executable_search_paths=None, os_utils=None):

@property
def exec_paths(self):

# look for the windows executable
paths = self.os_utils.which("dotnet.exe", executable_search_paths=self.executable_search_paths)
if not paths:
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/dotnet_clipackage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def unzip(self, zip_file_path, output_dir, permission=None):
"""

with zipfile.ZipFile(zip_file_path, "r") as zip_ref:

# For each item in the zip file, extract the file and set permissions if available
for file_info in zip_ref.infolist():
extracted_path = self._extract(file_info, output_dir, zip_ref)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DotnetCliPackageWorkflow(BaseWorkflow):
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.EXCLUSIVELY_SUPPORTED

def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, mode=None, **kwargs):

super(DotnetCliPackageWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, mode=mode, **kwargs
)
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/go_modules/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class GoModulesBuildAction(BaseAction):

NAME = "Build"
DESCRIPTION = "Building Go package with Go Modules"
PURPOSE = Purpose.COMPILE_SOURCE
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/go_modules/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def __init__(self, **kwargs):


class GoModulesBuilder(object):

LANGUAGE = "go"

def __init__(self, osutils, binaries, handler, mode=BuildMode.RELEASE, architecture=X86_64, trim_go_path=False):
Expand Down
2 changes: 0 additions & 2 deletions aws_lambda_builders/workflows/go_modules/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class GoModulesWorkflow(BaseWorkflow):

NAME = "GoModulesBuilder"

CAPABILITY = Capability(language="go", dependency_manager="modules", application_framework=None)
Expand All @@ -21,7 +20,6 @@ class GoModulesWorkflow(BaseWorkflow):
def __init__(
self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, mode=None, **kwargs
):

super(GoModulesWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/nodejs_npm/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __init__(self, osutils, npm_exe=None):
self.npm_exe = npm_exe

def run(self, args, cwd=None):

"""
Runs the action.

Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/nodejs_npm/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class NodejsNpmWorkflow(BaseWorkflow):
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.NOT_SUPPORTED

def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):

super(NodejsNpmWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def esbuild_binary(self):
)

def run(self, args, cwd=None):

"""
Runs the action.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class NodejsNpmEsbuildWorkflow(BaseWorkflow):
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.OPTIONALLY_SUPPORTED

def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):

super(NodejsNpmEsbuildWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/python_pip/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class PythonPipBuildAction(BaseAction):

NAME = "ResolveDependencies"
DESCRIPTION = "Installing dependencies from PIP"
PURPOSE = Purpose.RESOLVE_DEPENDENCIES
Expand Down
2 changes: 0 additions & 2 deletions aws_lambda_builders/workflows/python_pip/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class PythonPipWorkflow(BaseWorkflow):

NAME = "PythonPipBuilder"

CAPABILITY = Capability(language="python", dependency_manager="pip", application_framework=None)
Expand Down Expand Up @@ -71,7 +70,6 @@ class PythonPipWorkflow(BaseWorkflow):
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.NOT_SUPPORTED

def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):

super(PythonPipWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
Expand Down
1 change: 0 additions & 1 deletion aws_lambda_builders/workflows/ruby_bundler/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class RubyBundlerWorkflow(BaseWorkflow):
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.NOT_SUPPORTED

def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):

super(RubyBundlerWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ parameterized==0.7.4
pyelftools~=0.29 # Used to verify the generated Go binary architecture in integration tests (utils.py)

# formatter
black==22.3.0
black==23.1.0
ruff==0.0.238
2 changes: 0 additions & 2 deletions tests/functional/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestBuilderWithHelloWorkflow(TestCase):

HELLO_WORKFLOW_MODULE = "hello_workflow.write_hello"
TEST_WORKFLOWS_FOLDER = os.path.join(os.path.dirname(__file__), "testdata", "workflows")

Expand Down Expand Up @@ -45,7 +44,6 @@ def tearDown(self):
sys.path.remove(self.TEST_WORKFLOWS_FOLDER)

def test_run_hello_workflow_with_exec_paths(self):

self.hello_builder.build(
self.source_dir,
self.artifacts_dir,
Expand Down
4 changes: 0 additions & 4 deletions tests/functional/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@


class TestCliWithHelloWorkflow(TestCase):

HELLO_WORKFLOW_MODULE = "hello_workflow.write_hello"
TEST_WORKFLOWS_FOLDER = os.path.join(os.path.dirname(__file__), "testdata", "workflows")

def setUp(self):

self.source_dir = tempfile.mkdtemp()
self.artifacts_dir = tempfile.mkdtemp()
self.scratch_dir = os.path.join(tempfile.mkdtemp(), "scratch")
Expand Down Expand Up @@ -57,7 +55,6 @@ def tearDown(self):
]
)
def test_run_hello_workflow_with_backcompat(self, flavor, protocol_version):

request = {
"jsonschema": "2.0",
"id": 1234,
Expand Down Expand Up @@ -123,7 +120,6 @@ def test_run_hello_workflow_with_backcompat(self, flavor, protocol_version):

@parameterized.expand([("request_through_stdin"), ("request_through_argument")])
def test_run_hello_workflow_incompatible(self, flavor):

request_json = json.dumps(
{
"jsonschema": "2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def execute(self):


class WriteHelloWorkflow(BaseWorkflow):

NAME = "WriteHelloWorkflow"
CAPABILITY = Capability(language="python", dependency_manager="test", application_framework="test")
DEFAULT_BUILD_DIR = BuildDirectory.SCRATCH
Expand Down
10 changes: 0 additions & 10 deletions tests/functional/workflows/nodejs_npm/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

class TestOSUtils(TestCase):
def setUp(self):

self.osutils = utils.OSUtils()

def test_copy_file_copies_existing_file_into_a_dir(self):

test_file = os.path.join(os.path.dirname(__file__), "test_data", "test.tgz")

test_dir = tempfile.mkdtemp()
Expand All @@ -28,7 +26,6 @@ def test_copy_file_copies_existing_file_into_a_dir(self):
self.assertEqual({"test.tgz"}, output_files)

def test_copy_file_copies_existing_file_into_a_file(self):

test_file = os.path.join(os.path.dirname(__file__), "test_data", "test.tgz")

test_dir = tempfile.mkdtemp()
Expand All @@ -42,7 +39,6 @@ def test_copy_file_copies_existing_file_into_a_file(self):
self.assertEqual({"copied_test.tgz"}, output_files)

def test_remove_file_removes_existing_file(self):

test_file = os.path.join(os.path.dirname(__file__), "test_data", "test.tgz")

test_dir = tempfile.mkdtemp()
Expand All @@ -56,7 +52,6 @@ def test_remove_file_removes_existing_file(self):
self.assertFalse(os.path.isfile(copied_file))

def test_file_exists_checking_if_file_exists_in_a_dir(self):

existing_file = os.path.join(os.path.dirname(__file__), "test_data", "test.tgz")

nonexisting_file = os.path.join(os.path.dirname(__file__), "test_data", "nonexisting.tgz")
Expand All @@ -71,21 +66,18 @@ def test_dirname_returns_directory_for_path(self):
self.assertEqual(dirname, os.path.dirname(sys.executable))

def test_abspath_returns_absolute_path(self):

result = self.osutils.abspath(".")

self.assertTrue(os.path.isabs(result))

self.assertEqual(result, os.path.abspath("."))

def test_joinpath_joins_path_components(self):

result = self.osutils.joinpath("a", "b", "c")

self.assertEqual(result, os.path.join("a", "b", "c"))

def test_popen_runs_a_process_and_returns_outcome(self):

cwd_py = os.path.join(os.path.dirname(__file__), "..", "..", "testdata", "cwd.py")

p = self.osutils.popen([sys.executable, cwd_py], stdout=self.osutils.pipe, stderr=self.osutils.pipe)
Expand All @@ -97,7 +89,6 @@ def test_popen_runs_a_process_and_returns_outcome(self):
self.assertEqual(out.decode("utf8").strip(), os.getcwd())

def test_popen_can_accept_cwd(self):

testdata_dir = os.path.join(os.path.dirname(__file__), "..", "..", "testdata")

p = self.osutils.popen(
Expand All @@ -111,7 +102,6 @@ def test_popen_can_accept_cwd(self):
self.assertEqual(out.decode("utf8").strip(), os.path.abspath(testdata_dir))

def test_parse_json_reads_json_contents_into_memory(self):

json_file = os.path.join(os.path.dirname(__file__), "test_data", "test.json")
json_contents = self.osutils.parse_json(json_file)
self.assertEqual(json_contents["a"], 1)
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/workflows/provided_make/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

class TestOSUtils(TestCase):
def setUp(self):

self.osutils = utils.OSUtils()

def test_popen_runs_a_process_and_returns_outcome(self):

cwd_py = os.path.join(os.path.dirname(__file__), "..", "..", "testdata", "cwd.py")

p = self.osutils.popen([sys.executable, cwd_py], stdout=self.osutils.pipe, stderr=self.osutils.pipe)
Expand All @@ -24,7 +22,6 @@ def test_popen_runs_a_process_and_returns_outcome(self):
self.assertEqual(out.decode("utf8").strip(), os.getcwd())

def test_popen_can_accept_cwd_and_env(self):

testdata_dir = os.path.join(os.path.dirname(__file__), "..", "..", "testdata")
env = os.environ.copy()
env.update({"SOME_ENV": "SOME_VALUE"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def test_must_resolve_local_dependency(self):
self.assertIn(f, output_files)

def test_must_fail_to_resolve_dependencies(self):

with self.assertRaises(WorkflowFailedError) as ctx:
self.builder.build(
self.source_dir,
Expand Down
Loading