Skip to content

Commit

Permalink
Merge from aws/aws-sam-cli/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sam-cli-bot committed Apr 30, 2024
2 parents 666b712 + 33cb698 commit 06a412f
Show file tree
Hide file tree
Showing 15 changed files with 774 additions and 713 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The AWS Serverless Application Model (SAM) CLI is an open-source CLI tool that h

* **AWS Serverless Developer Experience Workshop: A day in a life of a developer** - [This advanced workshop](https://s12d.com/aws-sde-workshop) provides you with an immersive experience as a serverless developer, with hands-on experience building a serverless solution using AWS SAM and SAM CLI.

* **The Complete SAM Workshop**- [This workshop](https://s12d.com/jKo46elk) is a great way to experience the power of SAM and SAM CLI.
* **The Complete SAM Workshop** - [This workshop](https://s12d.com/jKo46elk) is a great way to experience the power of SAM and SAM CLI.

* **Getting started with CI/CD? SAM pipelines can help you get started** - [This workshop](https://s12d.com/_JQ48d5T) walks you through the basics.

Expand Down
6 changes: 3 additions & 3 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 @@ -28,7 +28,7 @@ regex!=2021.10.8
tzlocal==5.2

#Adding cfn-lint dependency for SAM validate
cfn-lint~=0.86.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.82
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.92
16 changes: 8 additions & 8 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
-r pre-dev.txt

coverage==7.4.4
coverage==7.5.0
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
types-psutil==5.9.5.20240316
types-setuptools==69.2.0.20240317
types-psutil==5.9.5.20240423
types-setuptools==69.5.0.20240423
types-Pygments==2.17.0.20240310
types-colorama==0.4.15.20240311
types-dateparser==1.1.4.20240331
types-docutils==0.20.0.20240406
types-dateparser==1.2.0.20240420
types-docutils==0.21.0.20240423
types-jsonschema==4.21.0.20240331
types-pyOpenSSL==24.0.0.20240311
types-pyOpenSSL==24.1.0.20240425
# as of types-requests>=2.31.0.7, this now requires `urllib3>2`, pin we are able to upgrade
types-requests==2.31.0.6
types-urllib3==1.26.25.14
Expand All @@ -37,5 +37,5 @@ pytest-json-report-wip==1.5.1
filelock==3.13.4

# formatter
black==24.3.0
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.3.5
ruff==0.4.2
4 changes: 2 additions & 2 deletions requirements/pyinstaller-build.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Executable binary builder requirements
setuptools==69.2.0
pyinstaller==6.5.0
setuptools==69.5.1
pyinstaller==6.6.0
462 changes: 231 additions & 231 deletions requirements/reproducible-linux.txt

Large diffs are not rendered by default.

456 changes: 228 additions & 228 deletions requirements/reproducible-mac.txt

Large diffs are not rendered by default.

462 changes: 231 additions & 231 deletions requirements/reproducible-win.txt

Large diffs are not rendered by default.

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
1 change: 1 addition & 0 deletions samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def get_local_lambda_images_location(mapping, runtime):
"dotnet6": "dotnet6",
"dotnet8": "dotnet6",
"go1.x": "Go1",
"provided.al2": "Go1",
}

PROVIDED_RUNTIMES = ["provided.al2023", "provided.al2", "provided"]
Expand Down
6 changes: 3 additions & 3 deletions tests/end_to_end/test_runtimes_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def validate(self, command_result: CommandResult):
@parameterized_class(
("runtime", "dependency_manager"),
[
("go1.x", "mod"),
("dotnet6", "cli-package"),
("python3.11", "pip"),
],
)
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_hello_world_default_workflow(self):
@parameterized_class(
("runtime", "dependency_manager"),
[
("go1.x", "mod"),
("dotnet6", "cli-package"),
("python3.11", "pip"),
],
)
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_hello_world_workflow(self):
@parameterized_class(
("runtime", "dependency_manager"),
[
("go1.x", "mod"),
("dotnet6", "cli-package"),
("python3.11", "pip"),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def test_init_interactive_with_event_bridge_app_aws_schemas_go(self):
N
eb-app-go
Y
4
1
1
"""
with tempfile.TemporaryDirectory() as temp:
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 06a412f

Please sign in to comment.