diff --git a/requirements/base.txt b/requirements/base.txt index 5da6d74ca6..64f1880ecc 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -12,5 +12,5 @@ dateparser~=0.7 python-dateutil~=2.6 pathlib2~=2.3.2; python_version<"3.4" requests==2.20.1 -aws_lambda_builders==0.2.0 +aws_lambda_builders==0.2.1 serverlessrepo==0.1.8 diff --git a/samcli/__init__.py b/samcli/__init__.py index 3deaf99f01..b100f008dd 100644 --- a/samcli/__init__.py +++ b/samcli/__init__.py @@ -2,4 +2,4 @@ SAM CLI version """ -__version__ = '0.13.0' +__version__ = '0.14.0' diff --git a/samcli/local/common/runtime_template.py b/samcli/local/common/runtime_template.py index bcfaa20a55..731410a1df 100644 --- a/samcli/local/common/runtime_template.py +++ b/samcli/local/common/runtime_template.py @@ -56,7 +56,7 @@ { "runtimes": ["go1.x"], "dependency_manager": None, - "init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-go"), + "init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-golang"), "build": False } ], diff --git a/samcli/local/docker/lambda_container.py b/samcli/local/docker/lambda_container.py index f4a2a715e6..1ebb9806d0 100644 --- a/samcli/local/docker/lambda_container.py +++ b/samcli/local/docker/lambda_container.py @@ -2,6 +2,7 @@ Represents Lambda runtime containers. """ import logging +import json from .container import Container from .lambda_image import Runtime @@ -157,7 +158,7 @@ def _get_image(image_builder, runtime, layers): return image_builder.build(runtime, layers) @staticmethod - def _get_entry_point(runtime, debug_options=None): + def _get_entry_point(runtime, debug_options=None): # pylint: disable=too-many-branches """ Returns the entry point for the container. The default value for the entry point is already configured in the Dockerfile. We override this default specifically when enabling debugging. The overridden entry point includes @@ -293,13 +294,21 @@ def _get_entry_point(runtime, debug_options=None): "/var/runtime/awslambda/bootstrap.py" ] + elif runtime == Runtime.python37.value: + entrypoint = ["/var/rapid/init", + "--bootstrap", + "/var/lang/bin/python3.7", + "--bootstrap-args", + json.dumps(debug_args_list + ["/var/runtime/bootstrap"]) + ] + return entrypoint @staticmethod def _supported_runtimes(): return {Runtime.java8.value, Runtime.dotnetcore20.value, Runtime.dotnetcore21.value, Runtime.go1x.value, Runtime.nodejs.value, Runtime.nodejs43.value, Runtime.nodejs610.value, Runtime.nodejs810.value, - Runtime.python27.value, Runtime.python36.value} + Runtime.python27.value, Runtime.python36.value, Runtime.python37.value} class DebuggingNotSupported(Exception): diff --git a/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-gradle/{{cookiecutter.project_name}}/HelloWorldFunction/gradle/wrapper/gradle-wrapper.jar b/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-gradle/{{cookiecutter.project_name}}/HelloWorldFunction/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..87b738cbd0 Binary files /dev/null and b/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-gradle/{{cookiecutter.project_name}}/HelloWorldFunction/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tests/integration/local/invoke/test_integrations_cli.py b/tests/integration/local/invoke/test_integrations_cli.py index fbbb03441f..6be7ab7e70 100644 --- a/tests/integration/local/invoke/test_integrations_cli.py +++ b/tests/integration/local/invoke/test_integrations_cli.py @@ -2,8 +2,8 @@ import shutil import os import copy -from unittest import skipIf import tempfile +from unittest import skipIf from nose_parameterized import parameterized from subprocess import Popen, PIPE @@ -13,10 +13,11 @@ from tests.integration.local.invoke.layer_utils import LayerUtils from .invoke_integ_base import InvokeIntegBase +from tests.testing_utils import IS_WINDOWS, RUNNING_ON_TRAVIS, RUNNING_TEST_FOR_MASTER_ON_TRAVIS # Layers tests require credentials and Travis will only add credentials to the env if the PR is from the same repo. # This is to restrict layers tests to run outside of Travis and when the branch is not master. -SKIP_LAYERS_TESTS = os.environ.get("TRAVIS", False) and os.environ.get("TRAVIS_BRANCH", "master") != "master" +SKIP_LAYERS_TESTS = RUNNING_ON_TRAVIS and RUNNING_TEST_FOR_MASTER_ON_TRAVIS try: from pathlib import Path @@ -233,6 +234,8 @@ def test_invoke_with_docker_network_of_host(self): self.assertEquals(return_code, 0) + @skipIf(IS_WINDOWS, + "The test hangs on Windows due to trying to attach to a non-existing network") def test_invoke_with_docker_network_of_host_in_env_var(self): command_list = self.get_command_list("HelloWorldServerlessFunction", template_path=self.template_path, diff --git a/tests/testing_utils.py b/tests/testing_utils.py new file mode 100644 index 0000000000..3724c94306 --- /dev/null +++ b/tests/testing_utils.py @@ -0,0 +1,6 @@ +import os +import platform + +IS_WINDOWS = platform.system().lower() == 'windows' +RUNNING_ON_TRAVIS = os.environ.get("TRAVIS", False) +RUNNING_TEST_FOR_MASTER_ON_TRAVIS = os.environ.get("TRAVIS_BRANCH", "master") != "master" \ No newline at end of file