From f63d715fe4feb177ae075f69c5852f140c3d9371 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 10:01:31 -0800 Subject: [PATCH 1/4] chore(deps-dev): bump ruff from 0.2.1 to 0.2.2 in /requirements (#617) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.1 to 0.2.2. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.2.1...v0.2.2) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 98fd3a48..441534ac 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -9,4 +9,4 @@ pyelftools~=0.30 # Used to verify the generated Go binary architecture in integr # formatter black==24.2.0 -ruff==0.2.1 +ruff==0.2.2 From ddd4adbac0dd33817aa40253115710a4394f075e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:45:49 -0800 Subject: [PATCH 2/4] chore(deps-dev): bump coverage from 7.4.1 to 7.4.3 in /requirements (#620) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.1 to 7.4.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.1...7.4.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 441534ac..0a2fb386 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -coverage==7.4.1 +coverage==7.4.3 flake8==3.8.4 pytest-cov==4.1.0 From 999ce907f1eb8f44779ca0a2345aa03706fbf75f Mon Sep 17 00:00:00 2001 From: Daniel Mil <84205762+mildaniel@users.noreply.github.com> Date: Mon, 4 Mar 2024 09:59:09 -0800 Subject: [PATCH 3/4] fix: Rename provided go binary to bootstrap (#621) * fix: Rename provided go binary to bootstrap * Format files * Windows compliant tests --- .../workflows/go_modules/workflow.py | 7 ++++++- .../integration/workflows/go_modules/test_go.py | 17 +++++++++++++++++ .../unit/workflows/go_modules/test_workflow.py | 15 +++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/aws_lambda_builders/workflows/go_modules/workflow.py b/aws_lambda_builders/workflows/go_modules/workflow.py index 9e570937..84a29a4d 100644 --- a/aws_lambda_builders/workflows/go_modules/workflow.py +++ b/aws_lambda_builders/workflows/go_modules/workflow.py @@ -32,7 +32,12 @@ def __init__( handler = options.get("artifact_executable_name", None) trim_go_path = options.get("trim_go_path", False) - output_path = osutils.joinpath(artifacts_dir, handler) + # For provided runtimes, the binary must be named "bootstrap" + output_path = ( + osutils.joinpath(artifacts_dir, handler) + if runtime != "provided" + else osutils.joinpath(artifacts_dir, "bootstrap") + ) builder = GoModulesBuilder( osutils, diff --git a/tests/integration/workflows/go_modules/test_go.py b/tests/integration/workflows/go_modules/test_go.py index 3027cae2..53bac35d 100644 --- a/tests/integration/workflows/go_modules/test_go.py +++ b/tests/integration/workflows/go_modules/test_go.py @@ -8,6 +8,8 @@ from pathlib2 import Path from unittest import TestCase +from parameterized import parameterized + from aws_lambda_builders.builder import LambdaBuilder from aws_lambda_builders.exceptions import WorkflowFailedError @@ -196,3 +198,18 @@ def test_builds_project_with_nested_dir(self): expected_files = {"helloWorld"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) + + @parameterized.expand([("provided", "bootstrap"), ("go1.x", "helloWorld")]) + def test_binary_named_bootstrap_for_provided_runtime(self, runtime, expected_binary): + source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps") + self.builder.build( + source_dir, + self.artifacts_dir, + self.scratch_dir, + os.path.join(source_dir, "go.mod"), + runtime=runtime, + options={"artifact_executable_name": "helloWorld"}, + ) + expected_files = {expected_binary} + output_files = set(os.listdir(self.artifacts_dir)) + self.assertEqual(expected_files, output_files) diff --git a/tests/unit/workflows/go_modules/test_workflow.py b/tests/unit/workflows/go_modules/test_workflow.py index 86e42e30..9efaf4a6 100644 --- a/tests/unit/workflows/go_modules/test_workflow.py +++ b/tests/unit/workflows/go_modules/test_workflow.py @@ -1,4 +1,5 @@ from unittest import TestCase +from pathlib import Path from aws_lambda_builders.workflows.go_modules.workflow import GoModulesWorkflow from aws_lambda_builders.workflows.go_modules.actions import GoModulesBuildAction @@ -24,6 +25,20 @@ def test_workflow_sets_up_builder_actions(self): self.assertEqual(len(workflow.actions), 1) self.assertIsInstance(workflow.actions[0], GoModulesBuildAction) + def test_workflow_sets_up_builder_actions_provided(self): + workflow = GoModulesWorkflow( + "source", + "artifacts", + "scratch_dir", + "manifest", + runtime="provided", + options={"artifact_executable_name": "main"}, + ) + + self.assertEqual(len(workflow.actions), 1) + self.assertIsInstance(workflow.actions[0], GoModulesBuildAction) + self.assertEqual(workflow.actions[0].output_path, str(Path("artifacts", "bootstrap"))) + def test_must_validate_architecture(self): workflow = GoModulesWorkflow( "source", From 14fce210a57a567895c307431004f3afb3583228 Mon Sep 17 00:00:00 2001 From: Daniel Mil <84205762+mildaniel@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:24:04 -0800 Subject: [PATCH 4/4] Bump version to 1.47.0 (#622) --- aws_lambda_builders/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py index 688cf091..aac6ac77 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -5,5 +5,5 @@ # Changing version will trigger a new release! # Please make the version change as the last step of your development. -__version__ = "1.46.0" +__version__ = "1.47.0" RPC_PROTOCOL_VERSION = "0.3"