Skip to content

Commit

Permalink
Merge branch 'develop' into feat/imageuri-as-image-archive
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhujus authored Apr 30, 2024
2 parents 9d65e81 + 33cb698 commit b6e84d4
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 63 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
4 changes: 2 additions & 2 deletions 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 All @@ -31,4 +31,4 @@ tzlocal==5.2
cfn-lint~=0.86.4

# Type checking boto3 objects
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.91
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.92
4 changes: 2 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pytest-cov==5.0.0
# type checking and related stubs
# mypy adds new rules in new minor versions, which could cause our PR check to fail
# here we fix its version and upgrade it manually in the future
mypy==1.9.0
mypy==1.10.0
types-pywin32==306.0.0.20240408
types-PyYAML==6.0.12.20240311
types-chevron==0.14.2.20240310
Expand Down Expand Up @@ -37,5 +37,5 @@ pytest-json-report-wip==1.5.1
filelock==3.13.4

# formatter
black==24.4.1
black==24.4.2
psutil==5.9.8
2 changes: 1 addition & 1 deletion requirements/pre-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruff==0.4.1
ruff==0.4.2
36 changes: 18 additions & 18 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 All @@ -38,25 +38,25 @@ blinker==1.7.0 \
--hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \
--hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182
# via flask
boto3==1.34.91 \
--hash=sha256:5077917041adaaae15eeca340289547ef905ca7e11516e9bd22d394fb5057d2a \
--hash=sha256:97fac686c47647db4b44e4789317e4aeecd38511d71e84f8d20abe33eb630ff1
boto3==1.34.92 \
--hash=sha256:684cba753d64978a486e8ea9645d53de0d4e3b4a3ab1495b26bd04b9541cea2d \
--hash=sha256:db7bbb1c6059e99b74dcf634e497b04addcac4c527ae2b2696e47c39eccc6c50
# via
# aws-sam-cli (setup.py)
# aws-sam-translator
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.91 \
--hash=sha256:01cfbda95d55285eba2f9fdf9694d26b939130ccad36d3b2fd5283b9a995934d \
--hash=sha256:708316539fe8fe5aabae10304ac80c4684fc0a226523386ff9a86869b89316bc
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.92 \
--hash=sha256:1d48a61d5ab6ba53fb980fc88cd24b47db6b59ac3d837f369b217e09fbaf1f9e \
--hash=sha256:c75af22607b458292ed7bf79d82a3c53c865ab04f26d89f3245ddb076a948e07
# via aws-sam-cli (setup.py)
botocore==1.34.91 \
--hash=sha256:4d1b13f2b1c28ce1743b1e5895ae62bb7e67f892b51882164ea19c27a130852b \
--hash=sha256:93ef7071292a1b2b9fc26537f8ae3a8227da1177969241939ea3fbdb1a1a1d0c
botocore==1.34.92 \
--hash=sha256:4211a22a1f6c6935e70cbb84c2cd93b29f9723eaf5036d59748dd104f389a681 \
--hash=sha256:d1ca4886271f184445ec737cd2e752498648cca383887c5a37b2e01c8ab94039
# via
# boto3
# s3transfer
botocore-stubs==1.34.91 \
--hash=sha256:c87a70d86107564f79f02058122f0dee7d1b18874e5b2dfdcab7ef0af39230aa \
--hash=sha256:debedbf0aa52bfb62791750eb0f3695aeb0dc6f3a4b06feb3c834731a77d9d4d
botocore-stubs==1.34.92 \
--hash=sha256:a69e6ded170a3978d39993686403c94db35a7cfe74aa647afba508ff09de303a \
--hash=sha256:b92df47155ccc9d9c1e83217b7bacc9c86a8ae66919eac252d065ddcedf05573
# via boto3-stubs
certifi==2024.2.2 \
--hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \
Expand Down Expand Up @@ -449,9 +449,9 @@ mypy-boto3-sqs==1.34.0 \
--hash=sha256:0bf8995f58919ab295398100e72eaa7da898adcfd9d339a42f3c48ce473419d5 \
--hash=sha256:94d8aea4ae75605f70e58e440d706e04d5c614101ddb2f0c73d306d776d10995
# via boto3-stubs
mypy-boto3-stepfunctions==1.34.0 \
--hash=sha256:06d2296cee750d17cb62171420eea4614f20f29be45ee361854f8b599a6e8110 \
--hash=sha256:ecc1e674c1c89e0559e8dbf3fda81295642b13766db30d42968a986ae6a5e952
mypy-boto3-stepfunctions==1.34.92 \
--hash=sha256:499a5de2f854e5ecf45fee00a5ec20478b4130af1d9d61721e176a787970394c \
--hash=sha256:e92da1c245ef29b8ed784e5a70fcaef63ac754fa73de614324c30e4562bec8fd
# via boto3-stubs
mypy-boto3-sts==1.34.0 \
--hash=sha256:3ba1875c2792b4f35fd918dca957ce09ad197beb7cfbda61f42144ffa9cda05d \
Expand Down
36 changes: 18 additions & 18 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 Expand Up @@ -56,25 +56,25 @@ blinker==1.7.0 \
--hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \
--hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182
# via flask
boto3==1.34.91 \
--hash=sha256:5077917041adaaae15eeca340289547ef905ca7e11516e9bd22d394fb5057d2a \
--hash=sha256:97fac686c47647db4b44e4789317e4aeecd38511d71e84f8d20abe33eb630ff1
boto3==1.34.92 \
--hash=sha256:684cba753d64978a486e8ea9645d53de0d4e3b4a3ab1495b26bd04b9541cea2d \
--hash=sha256:db7bbb1c6059e99b74dcf634e497b04addcac4c527ae2b2696e47c39eccc6c50
# via
# aws-sam-cli (setup.py)
# aws-sam-translator
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.91 \
--hash=sha256:01cfbda95d55285eba2f9fdf9694d26b939130ccad36d3b2fd5283b9a995934d \
--hash=sha256:708316539fe8fe5aabae10304ac80c4684fc0a226523386ff9a86869b89316bc
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.92 \
--hash=sha256:1d48a61d5ab6ba53fb980fc88cd24b47db6b59ac3d837f369b217e09fbaf1f9e \
--hash=sha256:c75af22607b458292ed7bf79d82a3c53c865ab04f26d89f3245ddb076a948e07
# via aws-sam-cli (setup.py)
botocore==1.34.91 \
--hash=sha256:4d1b13f2b1c28ce1743b1e5895ae62bb7e67f892b51882164ea19c27a130852b \
--hash=sha256:93ef7071292a1b2b9fc26537f8ae3a8227da1177969241939ea3fbdb1a1a1d0c
botocore==1.34.92 \
--hash=sha256:4211a22a1f6c6935e70cbb84c2cd93b29f9723eaf5036d59748dd104f389a681 \
--hash=sha256:d1ca4886271f184445ec737cd2e752498648cca383887c5a37b2e01c8ab94039
# via
# boto3
# s3transfer
botocore-stubs==1.34.91 \
--hash=sha256:c87a70d86107564f79f02058122f0dee7d1b18874e5b2dfdcab7ef0af39230aa \
--hash=sha256:debedbf0aa52bfb62791750eb0f3695aeb0dc6f3a4b06feb3c834731a77d9d4d
botocore-stubs==1.34.92 \
--hash=sha256:a69e6ded170a3978d39993686403c94db35a7cfe74aa647afba508ff09de303a \
--hash=sha256:b92df47155ccc9d9c1e83217b7bacc9c86a8ae66919eac252d065ddcedf05573
# via boto3-stubs
certifi==2024.2.2 \
--hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \
Expand Down Expand Up @@ -477,9 +477,9 @@ mypy-boto3-sqs==1.34.0 \
--hash=sha256:0bf8995f58919ab295398100e72eaa7da898adcfd9d339a42f3c48ce473419d5 \
--hash=sha256:94d8aea4ae75605f70e58e440d706e04d5c614101ddb2f0c73d306d776d10995
# via boto3-stubs
mypy-boto3-stepfunctions==1.34.0 \
--hash=sha256:06d2296cee750d17cb62171420eea4614f20f29be45ee361854f8b599a6e8110 \
--hash=sha256:ecc1e674c1c89e0559e8dbf3fda81295642b13766db30d42968a986ae6a5e952
mypy-boto3-stepfunctions==1.34.92 \
--hash=sha256:499a5de2f854e5ecf45fee00a5ec20478b4130af1d9d61721e176a787970394c \
--hash=sha256:e92da1c245ef29b8ed784e5a70fcaef63ac754fa73de614324c30e4562bec8fd
# via boto3-stubs
mypy-boto3-sts==1.34.0 \
--hash=sha256:3ba1875c2792b4f35fd918dca957ce09ad197beb7cfbda61f42144ffa9cda05d \
Expand Down
36 changes: 18 additions & 18 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 All @@ -38,25 +38,25 @@ blinker==1.7.0 \
--hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \
--hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182
# via flask
boto3==1.34.91 \
--hash=sha256:5077917041adaaae15eeca340289547ef905ca7e11516e9bd22d394fb5057d2a \
--hash=sha256:97fac686c47647db4b44e4789317e4aeecd38511d71e84f8d20abe33eb630ff1
boto3==1.34.92 \
--hash=sha256:684cba753d64978a486e8ea9645d53de0d4e3b4a3ab1495b26bd04b9541cea2d \
--hash=sha256:db7bbb1c6059e99b74dcf634e497b04addcac4c527ae2b2696e47c39eccc6c50
# via
# aws-sam-cli (setup.py)
# aws-sam-translator
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.91 \
--hash=sha256:01cfbda95d55285eba2f9fdf9694d26b939130ccad36d3b2fd5283b9a995934d \
--hash=sha256:708316539fe8fe5aabae10304ac80c4684fc0a226523386ff9a86869b89316bc
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.92 \
--hash=sha256:1d48a61d5ab6ba53fb980fc88cd24b47db6b59ac3d837f369b217e09fbaf1f9e \
--hash=sha256:c75af22607b458292ed7bf79d82a3c53c865ab04f26d89f3245ddb076a948e07
# via aws-sam-cli (setup.py)
botocore==1.34.91 \
--hash=sha256:4d1b13f2b1c28ce1743b1e5895ae62bb7e67f892b51882164ea19c27a130852b \
--hash=sha256:93ef7071292a1b2b9fc26537f8ae3a8227da1177969241939ea3fbdb1a1a1d0c
botocore==1.34.92 \
--hash=sha256:4211a22a1f6c6935e70cbb84c2cd93b29f9723eaf5036d59748dd104f389a681 \
--hash=sha256:d1ca4886271f184445ec737cd2e752498648cca383887c5a37b2e01c8ab94039
# via
# boto3
# s3transfer
botocore-stubs==1.34.91 \
--hash=sha256:c87a70d86107564f79f02058122f0dee7d1b18874e5b2dfdcab7ef0af39230aa \
--hash=sha256:debedbf0aa52bfb62791750eb0f3695aeb0dc6f3a4b06feb3c834731a77d9d4d
botocore-stubs==1.34.92 \
--hash=sha256:a69e6ded170a3978d39993686403c94db35a7cfe74aa647afba508ff09de303a \
--hash=sha256:b92df47155ccc9d9c1e83217b7bacc9c86a8ae66919eac252d065ddcedf05573
# via boto3-stubs
certifi==2024.2.2 \
--hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \
Expand Down Expand Up @@ -453,9 +453,9 @@ mypy-boto3-sqs==1.34.0 \
--hash=sha256:0bf8995f58919ab295398100e72eaa7da898adcfd9d339a42f3c48ce473419d5 \
--hash=sha256:94d8aea4ae75605f70e58e440d706e04d5c614101ddb2f0c73d306d776d10995
# via boto3-stubs
mypy-boto3-stepfunctions==1.34.0 \
--hash=sha256:06d2296cee750d17cb62171420eea4614f20f29be45ee361854f8b599a6e8110 \
--hash=sha256:ecc1e674c1c89e0559e8dbf3fda81295642b13766db30d42968a986ae6a5e952
mypy-boto3-stepfunctions==1.34.92 \
--hash=sha256:499a5de2f854e5ecf45fee00a5ec20478b4130af1d9d61721e176a787970394c \
--hash=sha256:e92da1c245ef29b8ed784e5a70fcaef63ac754fa73de614324c30e4562bec8fd
# via boto3-stubs
mypy-boto3-sts==1.34.0 \
--hash=sha256:3ba1875c2792b4f35fd918dca957ce09ad197beb7cfbda61f42144ffa9cda05d \
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 @@ -884,15 +884,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 @@ -2676,6 +2676,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 @@ -2690,6 +2691,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 @@ -2743,6 +2801,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 b6e84d4

Please sign in to comment.