Skip to content

Commit fef06ac

Browse files
authored
Merge pull request #337 from aws/develop
chore: Merge develop into master
2 parents 00b4a46 + ca658b3 commit fef06ac

File tree

16 files changed

+83
-87
lines changed

16 files changed

+83
-87
lines changed

.appveyor.yml

Lines changed: 3 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"
@@ -76,6 +75,9 @@ for:
7675
# setup make
7776
- "choco install make"
7877

78+
# install dotnet6
79+
- ps: "&powershell -NoProfile -ExecutionPolicy unrestricted -Command \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Version 6.0.200 -InstallDir 'C:\\Program Files\\dotnet\\'\""
80+
7981
# Echo final Path
8082
- "echo %PATH%"
8183

@@ -91,7 +93,6 @@ for:
9193
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
9294
- sh: "PATH=$JAVA_HOME/bin:$PATH"
9395
- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
94-
- sh: "rvm use 2.5"
9596
- sh: "nvm install ${nodejs_version}"
9697
- sh: "npm install [email protected] -g"
9798
- sh: "npm -v"

aws_lambda_builders/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
AWS Lambda Builder Library
33
"""
4-
__version__ = "1.12.0"
4+
__version__ = "1.13.0"
55
RPC_PROTOCOL_VERSION = "0.3"

aws_lambda_builders/validator.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,18 @@
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],
25+
"dotnet6": [ARM64, X86_64],
2926
"provided": [ARM64, X86_64],
3027
}
3128

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: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,38 @@ 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)
3232
shutil.rmtree(self.scratch_dir)
3333

34-
def verify_architecture(self, deps_file_name, expected_architecture):
34+
def verify_architecture(self, deps_file_name, expected_architecture, version=None):
3535
deps_file = pathlib.Path(self.artifacts_dir, deps_file_name)
3636

3737
if not deps_file.exists():
3838
self.fail("Failed verifying architecture, {} file not found".format(deps_file_name))
3939

4040
with open(str(deps_file)) as f:
4141
deps_json = json.loads(f.read())
42-
version = self.runtime[-3:]
42+
version = version or self.runtime[-3:]
4343
target_name = ".NETCoreApp,Version=v{}/{}".format(version, expected_architecture)
4444
target = deps_json.get("runtimeTarget").get("name")
4545

4646
self.assertEqual(target, target_name)
4747

4848

49-
class TestDotnet21(TestDotnetBase):
49+
class TestDotnet31(TestDotnetBase):
5050
"""
51-
Tests for dotnetcore 2.1
51+
Tests for dotnetcore 3.1
5252
"""
5353

54+
def setUp(self):
55+
super(TestDotnet31, self).setUp()
56+
self.runtime = "dotnetcore3.1"
57+
5458
def test_with_defaults_file(self):
55-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile2.1")
59+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")
5660

5761
self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime)
5862

@@ -71,45 +75,62 @@ def test_with_defaults_file(self):
7175
self.assertEqual(expected_files, output_files)
7276
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64")
7377

74-
def test_require_parameters(self):
75-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "RequireParameters")
78+
def test_with_defaults_file_x86(self):
79+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")
7680

7781
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"},
82+
source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=X86_64
8483
)
8584

8685
expected_files = {
8786
"Amazon.Lambda.Core.dll",
8887
"Amazon.Lambda.Serialization.Json.dll",
8988
"Newtonsoft.Json.dll",
90-
"RequireParameters.deps.json",
91-
"RequireParameters.dll",
92-
"RequireParameters.pdb",
93-
"RequireParameters.runtimeconfig.json",
89+
"WithDefaultsFile.deps.json",
90+
"WithDefaultsFile.dll",
91+
"WithDefaultsFile.pdb",
92+
"WithDefaultsFile.runtimeconfig.json",
9493
}
9594

9695
output_files = set(os.listdir(self.artifacts_dir))
9796

9897
self.assertEqual(expected_files, output_files)
99-
self.verify_architecture("RequireParameters.deps.json", "linux-x64")
98+
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64")
99+
100+
def test_with_defaults_file_arm64(self):
101+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")
100102

103+
self.builder.build(
104+
source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=ARM64
105+
)
101106

102-
class TestDotnet31(TestDotnetBase):
107+
expected_files = {
108+
"Amazon.Lambda.Core.dll",
109+
"Amazon.Lambda.Serialization.Json.dll",
110+
"Newtonsoft.Json.dll",
111+
"WithDefaultsFile.deps.json",
112+
"WithDefaultsFile.dll",
113+
"WithDefaultsFile.pdb",
114+
"WithDefaultsFile.runtimeconfig.json",
115+
}
116+
117+
output_files = set(os.listdir(self.artifacts_dir))
118+
119+
self.assertEqual(expected_files, output_files)
120+
self.verify_architecture("WithDefaultsFile.deps.json", "linux-arm64")
121+
122+
123+
class TestDotnet6(TestDotnetBase):
103124
"""
104-
Tests for dotnetcore 3.1
125+
Tests for dotnet 6
105126
"""
106127

107128
def setUp(self):
108-
super(TestDotnet31, self).setUp()
109-
self.runtime = "dotnetcore3.1"
129+
super(TestDotnet6, self).setUp()
130+
self.runtime = "dotnet6"
110131

111132
def test_with_defaults_file(self):
112-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")
133+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile6")
113134

114135
self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime)
115136

@@ -126,10 +147,10 @@ def test_with_defaults_file(self):
126147
output_files = set(os.listdir(self.artifacts_dir))
127148

128149
self.assertEqual(expected_files, output_files)
129-
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64")
150+
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version="6.0")
130151

131152
def test_with_defaults_file_x86(self):
132-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")
153+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile6")
133154

134155
self.builder.build(
135156
source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=X86_64
@@ -148,10 +169,10 @@ def test_with_defaults_file_x86(self):
148169
output_files = set(os.listdir(self.artifacts_dir))
149170

150171
self.assertEqual(expected_files, output_files)
151-
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64")
172+
self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version="6.0")
152173

153174
def test_with_defaults_file_arm64(self):
154-
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")
175+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile6")
155176

156177
self.builder.build(
157178
source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=ARM64
@@ -170,4 +191,4 @@ def test_with_defaults_file_arm64(self):
170191
output_files = set(os.listdir(self.artifacts_dir))
171192

172193
self.assertEqual(expected_files, output_files)
173-
self.verify_architecture("WithDefaultsFile.deps.json", "linux-arm64")
194+
self.verify_architecture("WithDefaultsFile.deps.json", "linux-arm64", version="6.0")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>net6.0</TargetFramework>
44
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
55
<AWSProjectType>Lambda</AWSProjectType>
66
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
{
2-
"Information" : [
2+
"Information": [
33
"This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
44
"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.",
5-
65
"dotnet lambda help",
7-
86
"All the command line options for the Lambda command can be specified in this file."
97
],
10-
11-
"profile":"",
12-
"region" : "",
13-
"configuration" : "Release",
14-
"framework" : "netcoreapp2.1",
15-
"function-runtime":"dotnetcore2.1",
16-
"function-memory-size" : 256,
17-
"function-timeout" : 30,
18-
"function-handler" : "WithDefaultsFile::WithDefaultsFile.Function::FunctionHandler"
19-
}
8+
"profile": "",
9+
"region": "",
10+
"configuration": "Release",
11+
"framework": "net6.0",
12+
"function-runtime": "dotnet6",
13+
"function-memory-size": 256,
14+
"function-timeout": 30,
15+
"function-handler": "WithDefaultsFile::WithDefaultsFile.Function::FunctionHandler"
16+
}

0 commit comments

Comments
 (0)