Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5b42b9c
Merge pull request #5358 from aws/bump_version
mndeveci Jun 13, 2023
f5a3a2b
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 20, 2023
8c9dbeb
Merge pull request #5396 from aws/develop
mndeveci Jun 21, 2023
2826d0a
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 26, 2023
025357d
chore: use amazon ecr credential helper in windows appveyor (#5446)
moelasmar Jul 5, 2023
b6b4e39
chore: bump version to 1.90.0 (#5448)
moelasmar Jul 5, 2023
822d19e
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 5, 2023
3603e12
fix: Handler path mapping for layer-wrapped esbuild functions (#5450)
mildaniel Jul 5, 2023
cee2d3d
fix: fix macos reproducable task and gh actions (#5455)
mndeveci Jul 6, 2023
16a1740
feat(sync): support build-image option (#5441)
elvishp2006 Jul 6, 2023
58faff0
fix: Avoid Certain Depedendency Version (#5460)
mildaniel Jul 7, 2023
cca9f93
Fix broken e2e test (#5459)
mildaniel Jul 7, 2023
0bd4c58
add pip check after all pip install in pyinstaller scripts (#5463)
hawflau Jul 7, 2023
f07e80d
chore: fix typo in help text of `pipeline bootstrap` (#5467)
efekarakus Jul 7, 2023
055b727
chore: update aws-sam-translator to 1.71.0 (#5462)
github-actions[bot] Jul 7, 2023
c78c617
chore(deps): bump cryptography from 41.0.0 to 41.0.1 in /requirements…
dependabot[bot] Jul 10, 2023
cb5e46b
fix: E2E test can't find esbuild binary (#5476)
mildaniel Jul 10, 2023
d5ce6d5
fix(invoke): Write in UTF-8 string instead of bytes (#5427)
jfuss Jul 10, 2023
7efaac1
feat: Add remote invoke implementation for step functions (#5458)
hnnasit Jul 11, 2023
f508c57
fix: use images.build rather than low level build API to catch errors…
mndeveci Jul 11, 2023
df526d8
Relax document version check for authorizers (#5477)
lucashuy Jul 11, 2023
577d0d4
fix: use StringIO instead of BytesIO with StreamWriter (#5485)
mndeveci Jul 12, 2023
50c04dd
chore: Update dependabot config (#5491)
mildaniel Jul 12, 2023
baff742
feat: Support YAML file formats for config files (#5469)
lucashuy Jul 12, 2023
f358403
chore(deps): bump cryptography from 41.0.1 to 41.0.2 in /requirements…
dependabot[bot] Jul 12, 2023
24a541c
chore(deps): bump rich from 13.3.3 to 13.4.2 in /requirements (#5495)
dependabot[bot] Jul 13, 2023
eb18ec1
Allow greater versions of typing_extensions (#5489)
berzi Jul 13, 2023
c59e3d5
chore: bump version to 1.91.0 (#5506)
lucashuy Jul 13, 2023
eedd1ee
fix: Pin click to be < 8.1.4 temporarily (#5511)
mildaniel Jul 13, 2023
36f8bf9
fix: Revert UTF-8 fixes #5485 and #5427 (#5512)
lucashuy Jul 13, 2023
dd96898
fix: Bump timeout (#5510)
mildaniel Jul 13, 2023
8418494
chore(deps): bump botocore from 1.29.135 to 1.31.2 in /requirements (…
dependabot[bot] Jul 13, 2023
bf33e0d
Merge branch 'develop' into feat/json-schema
Jul 14, 2023
412f283
Fix failing tests
Jul 14, 2023
d7d95b2
chore(deps): bump importlib-metadata in /requirements (#5520)
dependabot[bot] Jul 14, 2023
02e9478
chore(deps-dev): update pytest requirement in /requirements (#5517)
dependabot[bot] Jul 14, 2023
da96a9a
chore(deps): bump pyinstaller from 5.10.1 to 5.13.0 in /requirements …
dependabot[bot] Jul 14, 2023
b536b83
Convert paths to POSIX paths before saving (#5525)
lucashuy Jul 14, 2023
7679f33
Merge branch 'feat/json-schema' of github.com:aws/aws-sam-cli into fe…
Jul 14, 2023
0e83cf8
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 14, 2023
db5b7f3
test: Step functions remote invoke integ tests (#5502)
hnnasit Jul 14, 2023
88dfdd5
chore: update aws_lambda_builders to 1.35.0 (#5515)
github-actions[bot] Jul 15, 2023
c81d729
feat: add python3.11 support (#5526)
moelasmar Jul 15, 2023
116070f
fix(providers): typo (#5541)
tinti Jul 17, 2023
2753b0d
Pin cython to a version less than 3.0.0
lucashuy Jul 17, 2023
203b45b
Moved install location to be inside of virtual env
lucashuy Jul 17, 2023
737605f
Install cython and pyyaml together
lucashuy Jul 17, 2023
34c9223
Moved uninstall logic to after custom build
lucashuy Jul 17, 2023
b965160
Add auto confirm to uninstall
lucashuy Jul 17, 2023
602189d
Merge pull request #5545 from lucashuy/pin_cython
lucashuy Jul 18, 2023
c8812e3
feat: updating app templates repo hash with (70788081366ff232a25a8b31…
github-actions[bot] Jul 18, 2023
34cd0ba
Merge branch 'develop' into feat/json-schema
Jul 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ jobs:
with:
# These are the versions of Python that correspond to the supported Lambda runtimes
python-version: |
3.11
3.10
3.9
3.8
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
SAM_CLI_TELEMETRY ?= 0

init:
pip install wheel
pip install "cython<3.0.0" pyyaml==5.4.1 --no-build-isolation
pip uninstall wheel cython --yes
SAM_CLI_DEV=1 pip install -e '.[dev]'

test:
Expand Down
10 changes: 10 additions & 0 deletions installer/pyinstaller/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ cd ..
echo "Installing Python Libraries"
python3 -m venv venv
./venv/bin/pip install --upgrade pip

# https://github.com/yaml/pyyaml/issues/724
echo "Force cython package version to be lower than 3.x.x"
./venv/bin/pip install wheel
./venv/bin/pip install --no-build-isolation "cython<3.0.0" pyyaml==5.4.1

echo "Uninstall local cython package"
./venv/bin/pip uninstall wheel cython --yes
# end cython work around

./venv/bin/pip install -r src/requirements/reproducible-linux.txt

echo "Copying All Python Libraries"
Expand Down
10 changes: 10 additions & 0 deletions installer/pyinstaller/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ cd ..
echo "Installing Python Libraries"
/usr/local/bin/python3.8 -m venv venv
./venv/bin/pip install --upgrade pip

# https://github.com/yaml/pyyaml/issues/724
echo "Force cython package version to be lower than 3.x.x"
./venv/bin/pip install wheel
./venv/bin/pip install --no-build-isolation "cython<3.0.0" pyyaml==5.4.1

echo "Uninstall local cython package"
./venv/bin/pip uninstall wheel cython --yes
# end cython work around

./venv/bin/pip install -r src/requirements/reproducible-mac.txt

echo "Copying All Python Libraries"
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker~=6.1.0
dateparser~=1.1
requests~=2.31.0
serverlessrepo==0.1.10
aws_lambda_builders==1.34.0
aws_lambda_builders==1.35.0
tomlkit==0.11.8
watchdog==2.1.2
rich~=13.4.2
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ types-requests==2.31.0.1
types-urllib3==1.26.25.13

# Test requirements
pytest~=7.2.2
pytest~=7.4.0
parameterized==0.9.0
pytest-xdist==3.2.0
pytest-forked==1.6.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/pyinstaller-build.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Executable binary builder requirements
setuptools==67.7.2
pyinstaller==5.10.1
pyinstaller==5.13.0
6 changes: 3 additions & 3 deletions requirements/reproducible-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ attrs==23.1.0 \
# jschema-to-python
# jsonschema
# sarif-om
aws-lambda-builders==1.34.0 \
--hash=sha256:0790f7e9b7ee7286b96fbcf49450c5be0341bb7cb852ca7d74beae190139eb48 \
--hash=sha256:20456a942a417407b42ecf8ab7fce6a47306fd063051e7cb09d02d1be24d5cf3
aws-lambda-builders==1.35.0 \
--hash=sha256:419d766e60ac2a7303a23889b354d108a4244ce8d467dcf9dc71a62461895780 \
--hash=sha256:cf462961ec8c9d493f82b955d6b76630dc0ed356b166caddd5436719ce599586
# via aws-sam-cli (setup.py)
aws-sam-translator==1.71.0 \
--hash=sha256:17fb87c8137d8d49e7a978396b2b3b279211819dee44618415aab1e99c2cb659 \
Expand Down
12 changes: 6 additions & 6 deletions requirements/reproducible-mac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ attrs==23.1.0 \
# jschema-to-python
# jsonschema
# sarif-om
aws-lambda-builders==1.34.0 \
--hash=sha256:0790f7e9b7ee7286b96fbcf49450c5be0341bb7cb852ca7d74beae190139eb48 \
--hash=sha256:20456a942a417407b42ecf8ab7fce6a47306fd063051e7cb09d02d1be24d5cf3
aws-lambda-builders==1.35.0 \
--hash=sha256:419d766e60ac2a7303a23889b354d108a4244ce8d467dcf9dc71a62461895780 \
--hash=sha256:cf462961ec8c9d493f82b955d6b76630dc0ed356b166caddd5436719ce599586
# via aws-sam-cli (setup.py)
aws-sam-translator==1.71.0 \
--hash=sha256:17fb87c8137d8d49e7a978396b2b3b279211819dee44618415aab1e99c2cb659 \
Expand Down Expand Up @@ -271,9 +271,9 @@ idna==3.4 \
--hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \
--hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2
# via requests
importlib-metadata==6.7.0 \
--hash=sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4 \
--hash=sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5
importlib-metadata==6.8.0 \
--hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \
--hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743
# via flask
importlib-resources==5.12.0 \
--hash=sha256:4be82589bf5c1d7999aedf2a45159d10cb3ca4f19b2271f8792bc8e6da7b22f6 \
Expand Down
2 changes: 1 addition & 1 deletion samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
\b
Supported Runtimes
------------------
1. Python 3.7, 3.8, 3.9, 3.10 using PIP\n
1. Python 3.7, 3.8, 3.9, 3.10, 3.11 using PIP\n
2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM\n
3. Ruby 2.7, 3.2 using Bundler\n
4. Java 8, Java 11, Java 17 using Gradle and Maven\n
Expand Down
3 changes: 2 additions & 1 deletion samcli/lib/build/bundler.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ def _get_path_and_filename_from_handler(handler: str) -> Optional[str]:
:return: string path to built handler file
"""
try:
path = str(Path(handler).parent / Path(handler).stem) + ".js"
path = (Path(handler).parent / Path(handler).stem).as_posix()
path = path + ".js"
except (AttributeError, TypeError):
return None
return path
Expand Down
2 changes: 2 additions & 0 deletions samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def get_layer_subfolder(build_workflow: str) -> str:
"python3.8": "python",
"python3.9": "python",
"python3.10": "python",
"python3.11": "python",
"nodejs4.3": "nodejs",
"nodejs6.10": "nodejs",
"nodejs8.10": "nodejs",
Expand Down Expand Up @@ -155,6 +156,7 @@ def get_workflow_config(
"python3.8": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"python3.9": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"python3.10": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"python3.11": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"nodejs12.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
"nodejs14.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
"nodejs16.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/providers/cfn_api_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def _extract_cfn_gateway_v2_stage(
api_resource_type = resources.get(api_id, {}).get("Type")
if api_resource_type != AWS_APIGATEWAY_V2_API:
raise InvalidSamTemplateException(
"The AWS::ApiGatewayV2::Stag must have a valid ApiId that points to Api resource {}".format(api_id)
"The AWS::ApiGatewayV2::Stage must have a valid ApiId that points to Api resource {}".format(api_id)
)

collector.stage_name = stage_name
Expand Down
6 changes: 3 additions & 3 deletions samcli/lib/remote_invoke/lambda_invoke_executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ class DefaultConvertToJSON(RemoteInvokeRequestResponseMapper[RemoteInvokeExecuti
def map(self, test_input: RemoteInvokeExecutionInfo) -> RemoteInvokeExecutionInfo:
if not test_input.is_file_provided():
if not test_input.payload:
LOG.debug("Input event not found, invoking Lambda Function with an empty event")
LOG.debug("Input event not found, invoking resource with an empty event")
test_input.payload = "{}"
LOG.debug("Mapping input Payload to JSON string object")
LOG.debug("Mapping input event to JSON string object")
try:
_ = json.loads(cast(str, test_input.payload))
except JSONDecodeError:
json_value = json.dumps(test_input.payload)
LOG.info(
"Auto converting value '%s' into JSON '%s'. "
"If you don't want auto-conversion, please provide a JSON string as payload",
"If you don't want auto-conversion, please provide a JSON string as event",
test_input.payload,
json_value,
)
Expand Down
1 change: 1 addition & 0 deletions samcli/lib/utils/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"python3.8": [ARM64, X86_64],
"python3.9": [ARM64, X86_64],
"python3.10": [ARM64, X86_64],
"python3.11": [ARM64, X86_64],
"ruby2.7": [ARM64, X86_64],
"ruby3.2": [ARM64, X86_64],
"java8": [X86_64],
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/preview_runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"""
from typing import Set

PREVIEW_RUNTIMES: Set[str] = set()
PREVIEW_RUNTIMES: Set[str] = {"python3.11"}
5 changes: 4 additions & 1 deletion samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
RUNTIME_DEP_TEMPLATE_MAPPING = {
"python": [
{
"runtimes": ["python3.10", "python3.9", "python3.8", "python3.7"],
"runtimes": ["python3.11", "python3.10", "python3.9", "python3.8", "python3.7"],
"dependency_manager": "pip",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-python"),
"build": True,
Expand Down Expand Up @@ -113,6 +113,7 @@ def get_local_lambda_images_location(mapping, runtime):
"provided.al2",
"provided",
# python runtimes in descending order
"python3.11",
"python3.10",
"python3.9",
"python3.8",
Expand All @@ -135,6 +136,7 @@ def get_local_lambda_images_location(mapping, runtime):
"nodejs16.x": "amazon/nodejs16.x-base",
"nodejs14.x": "amazon/nodejs14.x-base",
"nodejs12.x": "amazon/nodejs12.x-base",
"python3.11": "amazon/python3.11-base",
"python3.10": "amazon/python3.10-base",
"python3.9": "amazon/python3.9-base",
"python3.8": "amazon/python3.8-base",
Expand All @@ -156,6 +158,7 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.8": "Python36",
"python3.9": "Python36",
"python3.10": "Python36",
"python3.11": "Python36",
"dotnet6": "dotnet6",
"go1.x": "Go1",
}
Expand Down
4 changes: 4 additions & 0 deletions samcli/local/docker/lambda_debug_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime
entry + ["/var/lang/bin/python3.10"] + debug_args_list + ["/var/runtime/bootstrap.py"],
container_env_vars=_container_env_vars,
),
Runtime.python311.value: lambda: DebugSettings(
entry + ["/var/lang/bin/python3.11"] + debug_args_list + ["/var/runtime/bootstrap.py"],
container_env_vars=_container_env_vars,
),
}
try:
return entrypoint_mapping[runtime]()
Expand Down
1 change: 1 addition & 0 deletions samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Runtime(Enum):
python38 = "python3.8"
python39 = "python3.9"
python310 = "python3.10"
python311 = "python3.11"
ruby27 = "ruby2.7"
ruby32 = "ruby3.2"
java8 = "java8"
Expand Down
2 changes: 1 addition & 1 deletion samcli/runtime_config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"app_template_repo_commit": "bb905c379830c3d8edbc196bda731076549028e3"
"app_template_repo_commit": "70788081366ff232a25a8b31961f59d27103e449"
}
2 changes: 2 additions & 0 deletions tests/integration/buildcmd/test_build_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ def _validate_skipped_built_function(
("template.yaml", "Function", True, "python3.8", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.9", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.10", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.11", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.7", "PythonPEP600", False, "CodeUri"),
("template.yaml", "Function", True, "python3.8", "PythonPEP600", False, "CodeUri"),
],
Expand Down Expand Up @@ -479,6 +480,7 @@ def test_with_default_requirements(self):
("template.yaml", "Function", True, "python3.8", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.9", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.10", "Python", False, "CodeUri"),
("template.yaml", "Function", True, "python3.11", "Python", False, "CodeUri"),
],
)
class TestBuildCommand_PythonFunctions_WithDocker(BuildIntegPythonBase):
Expand Down
17 changes: 9 additions & 8 deletions tests/integration/remote/invoke/remote_invoke_integ_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
run_command,
)
from tests.integration.deploy.deploy_integ_base import DeployIntegBase
from samcli.lib.remote_invoke.remote_invoke_executor_factory import RemoteInvokeExecutorFactory

from samcli.lib.utils.boto_utils import get_boto_resource_provider_with_config, get_boto_client_provider_with_config
from samcli.lib.utils.cloudformation import get_resource_summaries
Expand Down Expand Up @@ -47,17 +48,17 @@ def remote_invoke_deploy_stack(stack_name, template_path):
@classmethod
def create_resources_and_boto_clients(cls):
cls.remote_invoke_deploy_stack(cls.stack_name, cls.template_path)
stack_resource_summaries = get_resource_summaries(
boto_client_provider = get_boto_client_provider_with_config()
cls.stack_resource_summaries = get_resource_summaries(
get_boto_resource_provider_with_config(),
get_boto_client_provider_with_config(),
boto_client_provider,
cls.stack_name,
)
cls.stack_resources = {
resource_full_path: stack_resource_summary.physical_resource_id
for resource_full_path, stack_resource_summary in stack_resource_summaries.items()
}
cls.cfn_client = get_boto_client_provider_with_config()("cloudformation")
cls.lambda_client = get_boto_client_provider_with_config()("lambda")
cls.supported_resources = RemoteInvokeExecutorFactory.REMOTE_INVOKE_EXECUTOR_MAPPING.keys()
cls.cfn_client = boto_client_provider("cloudformation")
cls.lambda_client = boto_client_provider("lambda")
cls.stepfunctions_client = boto_client_provider("stepfunctions")
cls.xray_client = boto_client_provider("xray")

@staticmethod
def get_command_list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestInvokeResponseStreamingLambdas(RemoteInvokeIntegBase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.stack_name = f"{TestInvokeResponseStreamingLambdas.__name__}-{uuid.uuid4().hex}"
cls.stack_name = f"{cls.__name__}-{uuid.uuid4().hex}"
cls.create_resources_and_boto_clients()

def test_invoke_empty_event_provided(self):
Expand Down
Loading