Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/pip/requirements/develop/blink…
Browse files Browse the repository at this point in the history
…er-1.8.1
  • Loading branch information
mildaniel authored May 1, 2024
2 parents 6fd3d74 + 33cb698 commit 5faa20d
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate_pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

build-for-mac:
name: build-pyinstaller-macos
runs-on: macos-latest
runs-on: macos-13
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aws-sam-translator==1.87.0
docker~=7.0.0
dateparser~=1.2
requests~=2.31.0
aws_lambda_builders==1.48.0
aws_lambda_builders==1.49.0
tomlkit==0.12.4
watchdog==4.0.0
rich~=13.7.1
Expand Down
6 changes: 3 additions & 3 deletions requirements/reproducible-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ attrs==23.2.0 \
# jsonschema
# referencing
# sarif-om
aws-lambda-builders==1.48.0 \
--hash=sha256:01a2f41a49c118066a05428a924f08b65112565b155e43beb980517a6d295ae4 \
--hash=sha256:683155f44f373aa72eba0ea74dd324d688881de65984e9ca391ca1ec10aee6ed
aws-lambda-builders==1.49.0 \
--hash=sha256:49fd4a313b9b5da9686b07b190939cf0d6863edd3f06f511ba91cc45c131fb19 \
--hash=sha256:7387247f45effc8104b32ae00176340593577e09c5f6d8e381ef2f8f03b666a5
# via aws-sam-cli (setup.py)
aws-sam-translator==1.87.0 \
--hash=sha256:40cef8980d656107406dafe30aef34b67be33929d2b9492e93f8e9ce07ece1c1 \
Expand Down
6 changes: 3 additions & 3 deletions requirements/reproducible-mac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ attrs==23.2.0 \
# jsonschema
# referencing
# sarif-om
aws-lambda-builders==1.48.0 \
--hash=sha256:01a2f41a49c118066a05428a924f08b65112565b155e43beb980517a6d295ae4 \
--hash=sha256:683155f44f373aa72eba0ea74dd324d688881de65984e9ca391ca1ec10aee6ed
aws-lambda-builders==1.49.0 \
--hash=sha256:49fd4a313b9b5da9686b07b190939cf0d6863edd3f06f511ba91cc45c131fb19 \
--hash=sha256:7387247f45effc8104b32ae00176340593577e09c5f6d8e381ef2f8f03b666a5
# via aws-sam-cli (setup.py)
aws-sam-translator==1.87.0 \
--hash=sha256:40cef8980d656107406dafe30aef34b67be33929d2b9492e93f8e9ce07ece1c1 \
Expand Down
6 changes: 3 additions & 3 deletions requirements/reproducible-win.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ attrs==23.2.0 \
# jsonschema
# referencing
# sarif-om
aws-lambda-builders==1.48.0 \
--hash=sha256:01a2f41a49c118066a05428a924f08b65112565b155e43beb980517a6d295ae4 \
--hash=sha256:683155f44f373aa72eba0ea74dd324d688881de65984e9ca391ca1ec10aee6ed
aws-lambda-builders==1.49.0 \
--hash=sha256:49fd4a313b9b5da9686b07b190939cf0d6863edd3f06f511ba91cc45c131fb19 \
--hash=sha256:7387247f45effc8104b32ae00176340593577e09c5f6d8e381ef2f8f03b666a5
# via aws-sam-cli (setup.py)
aws-sam-translator==1.87.0 \
--hash=sha256:40cef8980d656107406dafe30aef34b67be33929d2b9492e93f8e9ce07ece1c1 \
Expand Down
2 changes: 1 addition & 1 deletion samcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
SAM CLI version
"""

__version__ = "1.115.0"
__version__ = "1.116.0"
5 changes: 3 additions & 2 deletions samcli/lib/build/app_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,15 +866,16 @@ def _build_function_in_process(
application_framework=config.application_framework,
)

runtime = patch_runtime(runtime)
runtime_patched = patch_runtime(runtime)

try:
builder.build(
source_dir,
artifacts_dir,
scratch_dir,
manifest_path,
runtime=runtime,
runtime=runtime_patched,
unpatched_runtime=runtime,
executable_search_paths=config.executable_search_paths,
mode=self._mode,
options=options,
Expand Down
59 changes: 59 additions & 0 deletions tests/unit/lib/build_module/test_app_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2559,6 +2559,7 @@ def test_must_use_lambda_builder(
"scratch_dir",
"manifest_path",
runtime="runtime",
unpatched_runtime="runtime",
executable_search_paths=config_mock.executable_search_paths,
mode="mode",
options=None,
Expand All @@ -2573,6 +2574,63 @@ def test_must_use_lambda_builder(

patch_runtime_mock.assert_called_with("runtime")

@parameterized.expand([("provided.al2",), ("provided.al2023",)])
@patch("samcli.lib.telemetry.event.EventType.get_accepted_values")
@patch("samcli.lib.build.app_builder.LambdaBuilder")
@patch("samcli.lib.build.app_builder.get_enabled_experimental_flags")
def test_pass_unpatched_runtime_to_lambda_builder(
self,
runtime,
experimental_flags_mock,
lambda_builder_mock,
event_mock,
):
experimental_flags_mock.return_value = ["experimental_flags"]
config_mock = Mock()
builder_instance_mock = lambda_builder_mock.return_value = Mock()
event_mock.return_value = [runtime]

result = self.builder._build_function_in_process(
config_mock,
"source_dir",
"artifacts_dir",
"scratch_dir",
"manifest_path",
runtime,
X86_64,
None,
None,
True,
True,
is_building_layer=False,
)
self.assertEqual(result, "artifacts_dir")

lambda_builder_mock.assert_called_with(
language=config_mock.language,
dependency_manager=config_mock.dependency_manager,
application_framework=config_mock.application_framework,
)

builder_instance_mock.build.assert_called_with(
"source_dir",
"artifacts_dir",
"scratch_dir",
"manifest_path",
runtime="provided",
unpatched_runtime=runtime,
executable_search_paths=config_mock.executable_search_paths,
mode="mode",
options=None,
architecture=X86_64,
dependencies_dir=None,
download_dependencies=True,
combine_dependencies=True,
is_building_layer=False,
experimental_flags=["experimental_flags"],
build_in_source=False,
)

@patch("samcli.lib.build.app_builder.LambdaBuilder")
def test_must_raise_on_error(self, lambda_builder_mock):
config_mock = Mock()
Expand Down Expand Up @@ -2626,6 +2684,7 @@ def test_building_with_experimental_flags(
"scratch_dir",
"manifest_path",
runtime="runtime",
unpatched_runtime="runtime",
executable_search_paths=ANY,
mode="mode",
options=None,
Expand Down

0 comments on commit 5faa20d

Please sign in to comment.