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 authored Oct 17, 2024
2 parents 9c33647 + c280116 commit 221e6e4
Show file tree
Hide file tree
Showing 14 changed files with 518 additions and 509 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/validate_pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.11"
- name: Build PyInstaller
run: |
chmod +x ./installer/pyinstaller/build-mac.sh
./installer/pyinstaller/build-mac.sh aws-sam-cli-macos-x86_64.zip
- name: Basic tests for PyInstaller
env:
SAM_INIT_RUNTIME: "python3.8"
SAM_INIT_RUNTIME: "python3.11"
run: |
unzip .build/output/aws-sam-cli-macos-x86_64.zip -d sam-installation
sudo ./sam-installation/install
Expand Down
10 changes: 6 additions & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ dateparser~=1.2
requests~=2.32.3
aws_lambda_builders==1.50.0
tomlkit==0.13.2
watchdog==4.0.2
rich~=13.8.1
watchdog==5.0.3; python_version>"3.8"
watchdog==4.0.2; python_version<="3.8"

rich~=13.9.2
pyopenssl~=24.2.1
# Pin to <4.18 to until SAM-T no longer uses RefResolver
jsonschema<4.24
Expand All @@ -28,7 +30,7 @@ regex!=2021.10.8
tzlocal==5.2

#Adding cfn-lint dependency for SAM validate
cfn-lint~=1.14.2
cfn-lint~=1.16.0

# Type checking boto3 objects
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.35.23
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.35.32
4 changes: 2 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ types-setuptools==75.1.0.20240917
types-Pygments==2.18.0.20240506
types-colorama==0.4.15.20240311
types-dateparser==1.2.0.20240420
types-docutils==0.21.0.20240907
types-docutils==0.21.0.20241005
types-jsonschema==4.23.0.20240813
types-pyOpenSSL==24.1.0.20240722
# lucashuy: pin `types-request` based on the Python version since newer versions of
Expand All @@ -38,7 +38,7 @@ pytest-rerunfailures==14.0
pytest-metadata==3.1.1
# NOTE (lucashuy): `pytest-json-report` was updated to `pytest-json-report-wip` as the original repository does not seem to be maintained anymore, if `-wip` is updated, validate the changes
pytest-json-report-wip==1.5.1
filelock==3.16.0
filelock==3.16.1

# formatter
black==24.8.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/pre-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruff==0.6.6
ruff==0.6.9
337 changes: 166 additions & 171 deletions requirements/reproducible-linux.txt

Large diffs are not rendered by default.

272 changes: 136 additions & 136 deletions requirements/reproducible-mac.txt

Large diffs are not rendered by default.

377 changes: 188 additions & 189 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.125.0"
__version__ = "1.126.0"
2 changes: 1 addition & 1 deletion samcli/lib/sync/watch_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def on_code_change(event: Optional[FileSystemEvent] = None) -> None:
#
# It looks like the other way a folder modified event can happen
# is if the permissions of the folder were changed
LOG.debug(f"Ignoring file system MODIFIED event for folder {event.src_path}")
LOG.debug(f"Ignoring file system MODIFIED event for folder {event.src_path!r}")
return

# sync flow factory should always exist, but guarding just incase
Expand Down
5 changes: 3 additions & 2 deletions samcli/lib/utils/file_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,15 @@ def on_change(self, event: FileSystemEvent) -> None:

LOG.debug("a %s change got detected in path %s", event.event_type, event.src_path)
for group, _observed_paths in self._observed_paths_per_group.items():
observed_paths = None
if event.event_type == EVENT_TYPE_DELETED:
observed_paths = [
path
for path in _observed_paths
if path == event.src_path
or path in self._watch_dog_observed_paths.get(f"{event.src_path}_False", [])
or path in self._watch_dog_observed_paths.get(f"{event.src_path!r}_False", [])
]
else:
elif isinstance(event.src_path, str):
observed_paths = [path for path in _observed_paths if event.src_path.startswith(path)]

if not observed_paths:
Expand Down
1 change: 1 addition & 0 deletions samcli/local/lambdafn/env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def _get_aws_variables(self):
"AWS_ACCESS_KEY_ID": self.aws_creds.get("key", self._DEFAULT_AWS_CREDS["key"]),
"AWS_SECRET_ACCESS_KEY": self.aws_creds.get("secret", self._DEFAULT_AWS_CREDS["secret"]),
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
}

# Session Token should be added **only** if the input creds have a token and the value is not empty.
Expand Down
Binary file modified samcli/local/rapid/aws-lambda-rie-arm64
Binary file not shown.
Binary file modified samcli/local/rapid/aws-lambda-rie-x86_64
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/unit/local/lambdafn/test_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def test_with_no_additional_variables(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
"AWS_REGION": "some region",
"AWS_DEFAULT_REGION": "some region",
"AWS_ACCESS_KEY_ID": "some key",
Expand Down Expand Up @@ -151,6 +152,7 @@ def test_with_only_default_values_for_variables(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
"AWS_REGION": "us-east-1",
"AWS_ACCESS_KEY_ID": "defaultkey",
"AWS_SECRET_ACCESS_KEY": "defaultsecret",
Expand Down Expand Up @@ -184,6 +186,7 @@ def test_with_shell_env_value(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
"AWS_REGION": "us-east-1",
"AWS_ACCESS_KEY_ID": "defaultkey",
"AWS_SECRET_ACCESS_KEY": "defaultsecret",
Expand Down Expand Up @@ -225,6 +228,7 @@ def test_with_overrides_value(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
"AWS_REGION": "us-east-1",
"AWS_ACCESS_KEY_ID": "defaultkey",
"AWS_SECRET_ACCESS_KEY": "defaultsecret",
Expand Down Expand Up @@ -282,6 +286,7 @@ def test_must_work_with_overridden_aws_creds(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
"AWS_SESSION_TOKEN": "some other token",
}

Expand All @@ -300,6 +305,7 @@ def test_must_work_without_any_aws_creds(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
# Default values assigned to these variables
"AWS_REGION": "us-east-1",
"AWS_DEFAULT_REGION": "us-east-1",
Expand All @@ -323,6 +329,7 @@ def test_must_work_with_partial_aws_creds(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
# Values from the input creds
"AWS_REGION": "some other region",
"AWS_DEFAULT_REGION": "some other region",
Expand All @@ -346,6 +353,7 @@ def test_must_work_with_text_logformat(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
# Default values assigned to these variables
"AWS_REGION": "us-east-1",
"AWS_DEFAULT_REGION": "us-east-1",
Expand All @@ -369,6 +377,7 @@ def test_must_work_with_default_json_logging_config(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
# Default values assigned to these variables
"AWS_REGION": "us-east-1",
"AWS_DEFAULT_REGION": "us-east-1",
Expand All @@ -393,6 +402,7 @@ def test_must_work_with_set_application_log_level(self):
"AWS_LAMBDA_LOG_GROUP_NAME": f"aws/lambda/{self.name}",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
# Default values assigned to these variables
"AWS_REGION": "us-east-1",
"AWS_DEFAULT_REGION": "us-east-1",
Expand All @@ -417,6 +427,7 @@ def test_must_work_with_custom_log_group_name(self):
"AWS_LAMBDA_LOG_GROUP_NAME": "myCustomLogGroup",
"AWS_LAMBDA_LOG_STREAM_NAME": "$LATEST",
"AWS_ACCOUNT_ID": "123456789012",
"AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand",
# Default values assigned to these variables
"AWS_REGION": "us-east-1",
"AWS_DEFAULT_REGION": "us-east-1",
Expand Down

0 comments on commit 221e6e4

Please sign in to comment.