Skip to content

Commit 334ee50

Browse files
authored
fix: deprecate old runtimes (ruby2.5, python2.7, nodejs10.x, dotnetcore2.1) (#319)
* remove ruby2.5 support * remove nodejs10.x support * remove dotnetcore2.1 support * remove python2.7 support * remove "rvm use 2.5" in CI job definition (which enables ruby2.5) * chore: update comment
1 parent 9786073 commit 334ee50

File tree

15 files changed

+18
-154
lines changed

15 files changed

+18
-154
lines changed

.appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ for:
5151
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\bin;%PATH%"
5252
- "%PYTHON%\\python.exe -m pip install -r requirements/dev.txt"
5353
- "%PYTHON%\\python.exe -m pip install -e ."
54-
- "set PATH=C:\\Ruby25-x64\\bin;%PATH%"
5554
- "gem --version"
5655
- "gem install bundler -v 1.17.3"
5756
- "bundler --version"
@@ -91,7 +90,6 @@ for:
9190
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
9291
- sh: "PATH=$JAVA_HOME/bin:$PATH"
9392
- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
94-
- sh: "rvm use 2.5"
9593
- sh: "nvm install ${nodejs_version}"
9694
- sh: "npm install [email protected] -g"
9795
- sh: "npm -v"

aws_lambda_builders/validator.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,16 @@
1111
LOG = logging.getLogger(__name__)
1212

1313
SUPPORTED_RUNTIMES = {
14-
"nodejs10.x": [X86_64],
1514
"nodejs12.x": [ARM64, X86_64],
1615
"nodejs14.x": [ARM64, X86_64],
17-
"python2.7": [X86_64],
1816
"python3.6": [X86_64],
1917
"python3.7": [X86_64],
2018
"python3.8": [ARM64, X86_64],
2119
"python3.9": [ARM64, X86_64],
22-
"ruby2.5": [X86_64],
2320
"ruby2.7": [ARM64, X86_64],
2421
"java8": [ARM64, X86_64],
2522
"java11": [ARM64, X86_64],
2623
"go1.x": [ARM64, X86_64],
27-
"dotnetcore2.1": [X86_64],
2824
"dotnetcore3.1": [ARM64, X86_64],
2925
"provided": [ARM64, X86_64],
3026
}

aws_lambda_builders/workflows/python_pip/DESIGN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def build_dependencies(artifacts_dir_path,
4949
5050
:type runtime: str
5151
:param runtime: Python version to build dependencies for. This can
52-
either be python2.7 or python3.6. These are currently the only
53-
supported values.
52+
either be python3.6, python3.7, python3.8 or python3.9. These are
53+
currently the only supported values.
5454
5555
:type ui: :class:`lambda_builders.actions.python_pip.utils.UI`
5656
:param ui: A class that traps all progress information such as status

aws_lambda_builders/workflows/python_pip/packager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def __init__(self, version):
8181

8282
def get_lambda_abi(runtime):
8383
supported = {
84-
"python2.7": "cp27mu",
8584
"python3.6": "cp36m",
8685
"python3.7": "cp37m",
8786
"python3.8": "cp38",
@@ -100,7 +99,7 @@ def __init__(self, runtime, osutils=None, dependency_builder=None, architecture=
10099
101100
:type runtime: str
102101
:param runtime: Python version to build dependencies for. This can
103-
either be python2.7, python3.6 or python3.7. These are currently the
102+
either be python3.6, python3.7, python3.8 or python3.9. These are currently the
104103
only supported values.
105104
106105
:type osutils: :class:`lambda_builders.utils.OSUtils`

aws_lambda_builders/workflows/ruby_bundler/DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bundle install --deployment
6464

6565
### sam build --use-container
6666

67-
This command would use some sort of container, such as `lambci/lambda:build-ruby2.5`.
67+
This command would use some sort of container, such as `public.ecr.aws/sam/build-ruby2.7`.
6868

6969
```shell
7070
# exit with error if vendor/bundle and/or .bundle directory exists and is non-empty

tests/integration/workflows/dotnet_clipackage/test_dotnet.py

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def setUp(self):
2525
self.artifacts_dir = tempfile.mkdtemp()
2626
self.scratch_dir = tempfile.mkdtemp()
2727
self.builder = LambdaBuilder(language="dotnet", dependency_manager="cli-package", application_framework=None)
28-
self.runtime = "dotnetcore2.1" # default to 2.1
28+
self.runtime = "dotnetcore3.1"
2929

3030
def tearDown(self):
3131
shutil.rmtree(self.artifacts_dir)
@@ -46,59 +46,6 @@ def verify_architecture(self, deps_file_name, expected_architecture):
4646
self.assertEqual(target, target_name)
4747

4848

49-
class TestDotnet21(TestDotnetBase):
50-
"""
51-
Tests for dotnetcore 2.1
52-
"""
53-
54-
def test_with_defaults_file(self):
55-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile2.1")
56-
57-
self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime)
58-
59-
expected_files = {
60-
"Amazon.Lambda.Core.dll",
61-
"Amazon.Lambda.Serialization.Json.dll",
62-
"Newtonsoft.Json.dll",
63-
"WithDefaultsFile.deps.json",
64-
"WithDefaultsFile.dll",
65-
"WithDefaultsFile.pdb",
66-
"WithDefaultsFile.runtimeconfig.json",
67-
}
68-
69-
output_files = set(os.listdir(self.artifacts_dir))
70-
71-
self.assertEqual(expected_files, output_files)
72-
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64")
73-
74-
def test_require_parameters(self):
75-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "RequireParameters")
76-
77-
self.builder.build(
78-
source_dir,
79-
self.artifacts_dir,
80-
self.scratch_dir,
81-
source_dir,
82-
runtime=self.runtime,
83-
options={"--framework": "netcoreapp2.1", "--configuration": "Debug"},
84-
)
85-
86-
expected_files = {
87-
"Amazon.Lambda.Core.dll",
88-
"Amazon.Lambda.Serialization.Json.dll",
89-
"Newtonsoft.Json.dll",
90-
"RequireParameters.deps.json",
91-
"RequireParameters.dll",
92-
"RequireParameters.pdb",
93-
"RequireParameters.runtimeconfig.json",
94-
}
95-
96-
output_files = set(os.listdir(self.artifacts_dir))
97-
98-
self.assertEqual(expected_files, output_files)
99-
self.verify_architecture("RequireParameters.deps.json", "linux-x64")
100-
101-
10249
class TestDotnet31(TestDotnetBase):
10350
"""
10451
Tests for dotnetcore 3.1

tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/Function.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/WithDefaultsFile.csproj

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile2.1/aws-lambda-tools-defaults.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/integration/workflows/python_pip/test_python_pip.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ def setUp(self):
4343
language=self.builder.capability.language, major=sys.version_info.major, minor=sys.version_info.minor
4444
)
4545
self.runtime_mismatch = {
46-
"python3.6": "python2.7",
47-
"python3.7": "python2.7",
48-
"python2.7": "python3.8",
49-
"python3.8": "python2.7",
50-
"python3.9": "python2.7",
46+
"python3.6": "python3.7",
47+
"python3.7": "python3.8",
48+
"python3.8": "python3.9",
49+
"python3.9": "python3.7",
5150
}
5251

5352
def tearDown(self):
@@ -70,18 +69,12 @@ def check_architecture_in(self, library, architectures):
7069
)
7170
)
7271

73-
# Temporarily skipping this test in Windows
74-
# Fails and we are not sure why: pip version/multiple Python versions in path/os/pypa issue?
75-
# TODO: Revisit when we deprecate Python2
76-
@skipIf(IS_WINDOWS, "Skip in windows tests")
7772
def test_must_build_python_project(self):
7873
self.builder.build(
7974
self.source_dir, self.artifacts_dir, self.scratch_dir, self.manifest_path_valid, runtime=self.runtime
8075
)
8176

82-
if self.runtime == "python2.7":
83-
expected_files = self.test_data_files.union({"numpy", "numpy-1.15.4.data", "numpy-1.15.4.dist-info"})
84-
elif self.runtime == "python3.6":
77+
if self.runtime == "python3.6":
8578
self.check_architecture_in("numpy-1.17.4.dist-info", ["manylinux2010_x86_64", "manylinux1_x86_64"])
8679
expected_files = self.test_data_files.union({"numpy", "numpy-1.17.4.dist-info"})
8780
else:
@@ -109,13 +102,9 @@ def test_must_build_python_project_with_arm_architecture(self):
109102

110103
self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2014_aarch64"])
111104

112-
# Temporarily skipping this test in Windows
113-
# Fails and we are not sure why: pip version/multiple Python versions in path/os/pypa issue?
114-
# TODO: Revisit when we deprecate Python2
115-
@skipIf(IS_WINDOWS, "Skip in windows tests")
116105
def test_mismatch_runtime_python_project(self):
117-
# NOTE : Build still works if other versions of python are accessible on the path. eg: /usr/bin/python2.7
118-
# is still accessible within a python 3 virtualenv.
106+
# NOTE : Build still works if other versions of python are accessible on the path. eg: /usr/bin/python3.7
107+
# is still accessible within a python 3.8 virtualenv.
119108
try:
120109
self.builder.build(
121110
self.source_dir,
@@ -162,11 +151,7 @@ def test_must_fail_to_resolve_dependencies(self):
162151
self.source_dir, self.artifacts_dir, self.scratch_dir, self.manifest_path_invalid, runtime=self.runtime
163152
)
164153

165-
# In Python2 a 'u' is now added to the exception string. To account for this, we see if either one is in the
166-
# output
167-
message_in_exception = "Invalid requirement: 'boto3=1.19.99'" in str(
168-
ctx.exception
169-
) or "Invalid requirement: u'boto3=1.19.99'" in str(ctx.exception)
154+
message_in_exception = "Invalid requirement: 'boto3=1.19.99'" in str(ctx.exception)
170155
self.assertTrue(message_in_exception)
171156

172157
def test_must_log_warning_if_requirements_not_found(self):

0 commit comments

Comments
 (0)