diff --git a/.appveyor.yml b/.appveyor.yml
index 67aa9f515..857195a3f 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -51,7 +51,6 @@ for:
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\bin;%PATH%"
- "%PYTHON%\\python.exe -m pip install -r requirements/dev.txt"
- "%PYTHON%\\python.exe -m pip install -e ."
- - "set PATH=C:\\Ruby25-x64\\bin;%PATH%"
- "gem --version"
- "gem install bundler -v 1.17.3"
- "bundler --version"
@@ -91,7 +90,6 @@ for:
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
- sh: "PATH=$JAVA_HOME/bin:$PATH"
- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
- - sh: "rvm use 2.5"
- sh: "nvm install ${nodejs_version}"
- sh: "npm install npm@7.24.2 -g"
- sh: "npm -v"
diff --git a/aws_lambda_builders/validator.py b/aws_lambda_builders/validator.py
index ac0c99b6d..f501e32fd 100644
--- a/aws_lambda_builders/validator.py
+++ b/aws_lambda_builders/validator.py
@@ -11,20 +11,16 @@
LOG = logging.getLogger(__name__)
SUPPORTED_RUNTIMES = {
- "nodejs10.x": [X86_64],
"nodejs12.x": [ARM64, X86_64],
"nodejs14.x": [ARM64, X86_64],
- "python2.7": [X86_64],
"python3.6": [X86_64],
"python3.7": [X86_64],
"python3.8": [ARM64, X86_64],
"python3.9": [ARM64, X86_64],
- "ruby2.5": [X86_64],
"ruby2.7": [ARM64, X86_64],
"java8": [ARM64, X86_64],
"java11": [ARM64, X86_64],
"go1.x": [ARM64, X86_64],
- "dotnetcore2.1": [X86_64],
"dotnetcore3.1": [ARM64, X86_64],
"provided": [ARM64, X86_64],
}
diff --git a/aws_lambda_builders/workflows/python_pip/DESIGN.md b/aws_lambda_builders/workflows/python_pip/DESIGN.md
index 1d9da131a..7513c25f1 100644
--- a/aws_lambda_builders/workflows/python_pip/DESIGN.md
+++ b/aws_lambda_builders/workflows/python_pip/DESIGN.md
@@ -49,8 +49,8 @@ def build_dependencies(artifacts_dir_path,
:type runtime: str
:param runtime: Python version to build dependencies for. This can
- either be python2.7 or python3.6. These are currently the only
- supported values.
+ either be python3.6, python3.7, python3.8 or python3.9. These are
+ currently the only supported values.
:type ui: :class:`lambda_builders.actions.python_pip.utils.UI`
:param ui: A class that traps all progress information such as status
diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py
index 1f7864d47..4b33f2d5c 100644
--- a/aws_lambda_builders/workflows/python_pip/packager.py
+++ b/aws_lambda_builders/workflows/python_pip/packager.py
@@ -81,7 +81,6 @@ def __init__(self, version):
def get_lambda_abi(runtime):
supported = {
- "python2.7": "cp27mu",
"python3.6": "cp36m",
"python3.7": "cp37m",
"python3.8": "cp38",
@@ -100,7 +99,7 @@ def __init__(self, runtime, osutils=None, dependency_builder=None, architecture=
:type runtime: str
:param runtime: Python version to build dependencies for. This can
- either be python2.7, python3.6 or python3.7. These are currently the
+ either be python3.6, python3.7, python3.8 or python3.9. These are currently the
only supported values.
:type osutils: :class:`lambda_builders.utils.OSUtils`
diff --git a/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md b/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md
index dde60f11f..433df21c5 100644
--- a/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md
+++ b/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md
@@ -64,7 +64,7 @@ bundle install --deployment
### sam build --use-container
-This command would use some sort of container, such as `lambci/lambda:build-ruby2.5`.
+This command would use some sort of container, such as `public.ecr.aws/sam/build-ruby2.7`.
```shell
# exit with error if vendor/bundle and/or .bundle directory exists and is non-empty
diff --git a/tests/integration/workflows/dotnet_clipackage/test_dotnet.py b/tests/integration/workflows/dotnet_clipackage/test_dotnet.py
index eb6e6cf46..678a55c24 100644
--- a/tests/integration/workflows/dotnet_clipackage/test_dotnet.py
+++ b/tests/integration/workflows/dotnet_clipackage/test_dotnet.py
@@ -25,7 +25,7 @@ def setUp(self):
self.artifacts_dir = tempfile.mkdtemp()
self.scratch_dir = tempfile.mkdtemp()
self.builder = LambdaBuilder(language="dotnet", dependency_manager="cli-package", application_framework=None)
- self.runtime = "dotnetcore2.1" # default to 2.1
+ self.runtime = "dotnetcore3.1"
def tearDown(self):
shutil.rmtree(self.artifacts_dir)
@@ -46,59 +46,6 @@ def verify_architecture(self, deps_file_name, expected_architecture):
self.assertEqual(target, target_name)
-class TestDotnet21(TestDotnetBase):
- """
- Tests for dotnetcore 2.1
- """
-
- def test_with_defaults_file(self):
- source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile2.1")
-
- self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime)
-
- expected_files = {
- "Amazon.Lambda.Core.dll",
- "Amazon.Lambda.Serialization.Json.dll",
- "Newtonsoft.Json.dll",
- "WithDefaultsFile.deps.json",
- "WithDefaultsFile.dll",
- "WithDefaultsFile.pdb",
- "WithDefaultsFile.runtimeconfig.json",
- }
-
- output_files = set(os.listdir(self.artifacts_dir))
-
- self.assertEqual(expected_files, output_files)
- self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64")
-
- def test_require_parameters(self):
- source_dir = os.path.join(self.TEST_DATA_FOLDER, "RequireParameters")
-
- self.builder.build(
- source_dir,
- self.artifacts_dir,
- self.scratch_dir,
- source_dir,
- runtime=self.runtime,
- options={"--framework": "netcoreapp2.1", "--configuration": "Debug"},
- )
-
- expected_files = {
- "Amazon.Lambda.Core.dll",
- "Amazon.Lambda.Serialization.Json.dll",
- "Newtonsoft.Json.dll",
- "RequireParameters.deps.json",
- "RequireParameters.dll",
- "RequireParameters.pdb",
- "RequireParameters.runtimeconfig.json",
- }
-
- output_files = set(os.listdir(self.artifacts_dir))
-
- self.assertEqual(expected_files, output_files)
- self.verify_architecture("RequireParameters.deps.json", "linux-x64")
-
-
class TestDotnet31(TestDotnetBase):
"""
Tests for dotnetcore 3.1
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/Function.cs b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/Function.cs
deleted file mode 100644
index 23fc86994..000000000
--- a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/Function.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-using Amazon.Lambda.Core;
-
-// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
-[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
-
-namespace WithDefaultsFile
-{
- public class Function
- {
-
- ///
- /// A simple function that takes a string and does a ToUpper
- ///
- ///
- ///
- ///
- public string FunctionHandler(string input, ILambdaContext context)
- {
- return input?.ToUpper();
- }
- }
-}
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/WithDefaultsFile.csproj b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/WithDefaultsFile.csproj
deleted file mode 100644
index 45c85fd29..000000000
--- a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/WithDefaultsFile.csproj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- netcoreapp2.1
- true
- Lambda
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/aws-lambda-tools-defaults.json b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/aws-lambda-tools-defaults.json
deleted file mode 100644
index 862ac189b..000000000
--- a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/aws-lambda-tools-defaults.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "Information" : [
- "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
- "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",
-
- "dotnet lambda help",
-
- "All the command line options for the Lambda command can be specified in this file."
- ],
-
- "profile":"",
- "region" : "",
- "configuration" : "Release",
- "framework" : "netcoreapp2.1",
- "function-runtime":"dotnetcore2.1",
- "function-memory-size" : 256,
- "function-timeout" : 30,
- "function-handler" : "WithDefaultsFile::WithDefaultsFile.Function::FunctionHandler"
-}
diff --git a/tests/integration/workflows/python_pip/test_python_pip.py b/tests/integration/workflows/python_pip/test_python_pip.py
index de759be47..3c4d86c9e 100644
--- a/tests/integration/workflows/python_pip/test_python_pip.py
+++ b/tests/integration/workflows/python_pip/test_python_pip.py
@@ -43,11 +43,10 @@ def setUp(self):
language=self.builder.capability.language, major=sys.version_info.major, minor=sys.version_info.minor
)
self.runtime_mismatch = {
- "python3.6": "python2.7",
- "python3.7": "python2.7",
- "python2.7": "python3.8",
- "python3.8": "python2.7",
- "python3.9": "python2.7",
+ "python3.6": "python3.7",
+ "python3.7": "python3.8",
+ "python3.8": "python3.9",
+ "python3.9": "python3.7",
}
def tearDown(self):
@@ -70,18 +69,12 @@ def check_architecture_in(self, library, architectures):
)
)
- # Temporarily skipping this test in Windows
- # Fails and we are not sure why: pip version/multiple Python versions in path/os/pypa issue?
- # TODO: Revisit when we deprecate Python2
- @skipIf(IS_WINDOWS, "Skip in windows tests")
def test_must_build_python_project(self):
self.builder.build(
self.source_dir, self.artifacts_dir, self.scratch_dir, self.manifest_path_valid, runtime=self.runtime
)
- if self.runtime == "python2.7":
- expected_files = self.test_data_files.union({"numpy", "numpy-1.15.4.data", "numpy-1.15.4.dist-info"})
- elif self.runtime == "python3.6":
+ if self.runtime == "python3.6":
self.check_architecture_in("numpy-1.17.4.dist-info", ["manylinux2010_x86_64", "manylinux1_x86_64"])
expected_files = self.test_data_files.union({"numpy", "numpy-1.17.4.dist-info"})
else:
@@ -109,13 +102,9 @@ def test_must_build_python_project_with_arm_architecture(self):
self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2014_aarch64"])
- # Temporarily skipping this test in Windows
- # Fails and we are not sure why: pip version/multiple Python versions in path/os/pypa issue?
- # TODO: Revisit when we deprecate Python2
- @skipIf(IS_WINDOWS, "Skip in windows tests")
def test_mismatch_runtime_python_project(self):
- # NOTE : Build still works if other versions of python are accessible on the path. eg: /usr/bin/python2.7
- # is still accessible within a python 3 virtualenv.
+ # NOTE : Build still works if other versions of python are accessible on the path. eg: /usr/bin/python3.7
+ # is still accessible within a python 3.8 virtualenv.
try:
self.builder.build(
self.source_dir,
@@ -162,11 +151,7 @@ def test_must_fail_to_resolve_dependencies(self):
self.source_dir, self.artifacts_dir, self.scratch_dir, self.manifest_path_invalid, runtime=self.runtime
)
- # In Python2 a 'u' is now added to the exception string. To account for this, we see if either one is in the
- # output
- message_in_exception = "Invalid requirement: 'boto3=1.19.99'" in str(
- ctx.exception
- ) or "Invalid requirement: u'boto3=1.19.99'" in str(ctx.exception)
+ message_in_exception = "Invalid requirement: 'boto3=1.19.99'" in str(ctx.exception)
self.assertTrue(message_in_exception)
def test_must_log_warning_if_requirements_not_found(self):
diff --git a/tests/integration/workflows/ruby_bundler/test_ruby.py b/tests/integration/workflows/ruby_bundler/test_ruby.py
index c1379dbc6..282228676 100644
--- a/tests/integration/workflows/ruby_bundler/test_ruby.py
+++ b/tests/integration/workflows/ruby_bundler/test_ruby.py
@@ -27,7 +27,7 @@ def setUp(self):
self.dependencies_dir = tempfile.mkdtemp()
self.no_deps = os.path.join(self.TEST_DATA_FOLDER, "no-deps")
self.builder = LambdaBuilder(language="ruby", dependency_manager="bundler", application_framework=None)
- self.runtime = "ruby2.5"
+ self.runtime = "ruby2.7"
def tearDown(self):
shutil.rmtree(self.artifacts_dir)
diff --git a/tests/unit/test_validator.py b/tests/unit/test_validator.py
index 710edd8ab..8e889c2f3 100644
--- a/tests/unit/test_validator.py
+++ b/tests/unit/test_validator.py
@@ -22,7 +22,7 @@ def test_validate_with_unsupported_runtime(self):
validator.validate("/usr/bin/unknown_runtime")
def test_validate_with_runtime_and_incompatible_architecture(self):
- runtime_list = ["dotnetcore2.1", "nodejs10.x", "ruby2.5", "python3.6", "python3.7", "python2.7"]
+ runtime_list = ["python3.6", "python3.7"]
for runtime in runtime_list:
validator = RuntimeValidator(runtime=runtime, architecture="arm64")
with self.assertRaises(UnsupportedArchitectureError):
diff --git a/tests/unit/test_workflow.py b/tests/unit/test_workflow.py
index 47013c0ed..ad69bd5e4 100644
--- a/tests/unit/test_workflow.py
+++ b/tests/unit/test_workflow.py
@@ -324,7 +324,7 @@ def test_must_raise_for_incompatible_runtime_and_architecture(self):
"artifacts_dir",
"scratch_dir",
"manifest_path",
- runtime="python2.7",
+ runtime="python3.7",
executable_search_paths=[str(pathlib.Path(os.getcwd()).parent)],
optimizations={"a": "b"},
options={"c": "d"},
@@ -333,7 +333,7 @@ def test_must_raise_for_incompatible_runtime_and_architecture(self):
validator_mock = Mock()
validator_mock.validate = Mock()
validator_mock.validate = MagicMock(
- side_effect=UnsupportedArchitectureError(runtime="python2.7", architecture="arm64")
+ side_effect=UnsupportedArchitectureError(runtime="python3.7", architecture="arm64")
)
resolver_mock = Mock()
@@ -349,7 +349,7 @@ def test_must_raise_for_incompatible_runtime_and_architecture(self):
with self.assertRaises(WorkflowFailedError) as ex:
self.work.run()
- self.assertIn("Architecture arm64 is not supported for runtime python2.7", str(ex.exception))
+ self.assertIn("Architecture arm64 is not supported for runtime python3.7", str(ex.exception))
class TestBaseWorkflow_repr(TestCase):
diff --git a/tests/unit/workflows/python_pip/test_packager.py b/tests/unit/workflows/python_pip/test_packager.py
index ddc3e4c46..7eaeb30b1 100644
--- a/tests/unit/workflows/python_pip/test_packager.py
+++ b/tests/unit/workflows/python_pip/test_packager.py
@@ -90,9 +90,6 @@ def popen(self, *args, **kwargs):
class TestGetLambdaAbi(object):
- def test_get_lambda_abi_python27(self):
- assert "cp27mu" == get_lambda_abi("python2.7")
-
def test_get_lambda_abi_python36(self):
assert "cp36m" == get_lambda_abi("python3.6")
diff --git a/tests/unit/workflows/python_pip/test_validator.py b/tests/unit/workflows/python_pip/test_validator.py
index 95caf6773..6d5abfcb7 100644
--- a/tests/unit/workflows/python_pip/test_validator.py
+++ b/tests/unit/workflows/python_pip/test_validator.py
@@ -46,7 +46,6 @@ def test_python_command(self):
@parameterized.expand(
[
- ("python2.7", "arm64"),
("python3.6", "arm64"),
("python3.7", "arm64"),
]