Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sam-cli-bot committed Jul 13, 2023
2 parents 49ec0ac + 95f3a4b commit 1a1eb27
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 146 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
npm:
- 8
- 9
Expand Down Expand Up @@ -154,6 +155,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -180,6 +182,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -209,6 +212,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -236,6 +240,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -259,6 +264,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -282,6 +288,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -311,6 +318,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

# Changing version will trigger a new release!
# Please make the version change as the last step of your development.
__version__ = "1.34.0"
__version__ = "1.35.0"
RPC_PROTOCOL_VERSION = "0.3"
2 changes: 1 addition & 1 deletion aws_lambda_builders/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"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": [ARM64, X86_64],
"java11": [ARM64, X86_64],
"java17": [ARM64, X86_64],
"go1.x": [ARM64, X86_64],
"dotnetcore3.1": [ARM64, X86_64],
"dotnet6": [ARM64, X86_64],
"provided": [ARM64, X86_64],
}
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/dotnet_clipackage/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package:
<ZIP-FILE> The name of the zip file to package the project into
Options:
-c | --configuration Configuration to build with, for example Release or Debug.
-f | --framework Target framework to compile, for example netcoreapp2.1.
-f | --framework Target framework to compile, for example net6.0.
--msbuild-parameters Additional msbuild parameters passed to the 'dotnet publish' command. Add quotes around the value if the value contains spaces.
-pl | --project-location The location of the project, if not set the current directory will be assumed.
-cfg | --config-file Configuration file storing default values for command line arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run(self, args, cwd=None):
LOG.debug("executing dotnet: %s", invoke_dotnet)

# DotNet output is in system locale dependent encoding
# https://docs.microsoft.com/en-us/dotnet/api/system.console.outputencoding?view=netcore-3.1#remarks
# https://learn.microsoft.com/en-us/dotnet/api/system.console.outputencoding?view=net-6.0#remarks
# "The default code page that the console uses is determined by the system locale."
encoding = locale.getpreferredencoding()
p = self.os_utils.popen(invoke_dotnet, stdout=self.os_utils.pipe, stderr=self.os_utils.pipe, cwd=cwd)
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/python_pip/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def build_dependencies(artifacts_dir_path,
:type runtime: str
:param runtime: Python version to build dependencies for. This can
either be python3.7, python3.8, python3.9 or python3.10. These are
either be python3.7, python3.8, python3.9, python3.10 or python3.11. These are
currently the only supported values.
:type ui: :class:`lambda_builders.actions.python_pip.utils.UI`
Expand Down
3 changes: 2 additions & 1 deletion aws_lambda_builders/workflows/python_pip/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get_lambda_abi(runtime):
"python3.8": "cp38",
"python3.9": "cp39",
"python3.10": "cp310",
"python3.11": "cp311",
}

if runtime not in supported:
Expand All @@ -99,7 +100,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 python3.7, python3.8, python3.9 or python3.10. These are currently the
either be python3.7, python3.8, python3.9, python3.10 or python3.11. These are currently the
only supported values.
:type osutils: :class:`lambda_builders.utils.OSUtils`
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pyelftools~=0.29 # Used to verify the generated Go binary architecture in integr

# formatter
black==23.3.0
ruff==0.0.270
ruff==0.0.277
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def read_version():
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet",
"Topic :: Software Development :: Build Tools",
"Topic :: Utilities",
Expand Down
78 changes: 2 additions & 76 deletions tests/integration/workflows/dotnet_clipackage/test_dotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class TestDotnetBase(TestCase):
"""
Base class for dotnetcore tests
Base class for dotnet tests
"""

TEST_DATA_FOLDER = os.path.join(os.path.dirname(__file__), "testdata")
Expand All @@ -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 = "dotnetcore3.1"
self.runtime = "dotnet6"

def tearDown(self):
shutil.rmtree(self.artifacts_dir)
Expand All @@ -50,80 +50,6 @@ def verify_execute_permissions(self, entrypoint_file_name):
self.assertTrue(os.access(entrypoint_file_path, os.X_OK))


class TestDotnet31(TestDotnetBase):
"""
Tests for dotnetcore 3.1
"""

def setUp(self):
super(TestDotnet31, self).setUp()
self.runtime = "dotnetcore3.1"

def test_with_defaults_file(self):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.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_with_defaults_file_x86(self):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")

self.builder.build(
source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=X86_64
)

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_with_defaults_file_arm64(self):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile3.1")

self.builder.build(
source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=ARM64
)

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-arm64")


class TestDotnet6(TestDotnetBase):
"""
Tests for dotnet 6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 6 additions & 5 deletions tests/integration/workflows/python_pip/test_python_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
logger = logging.getLogger("aws_lambda_builders.workflows.python_pip.workflow")
IS_WINDOWS = platform.system().lower() == "windows"
NOT_ARM = platform.processor() != "aarch64"
ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10"}
ARM_RUNTIMES = {"python3.8", "python3.9", "python3.10", "python3.11"}


@parameterized_class(("experimental_flags",), [([]), ([EXPERIMENTAL_FLAG_BUILD_PERFORMANCE])])
Expand Down Expand Up @@ -61,6 +61,7 @@ def setUp(self):
"python3.8": "python3.9",
"python3.9": "python3.7",
"python3.10": "python3.9",
"python3.11": "python3.10",
}

def tearDown(self):
Expand Down Expand Up @@ -93,7 +94,7 @@ def test_must_build_python_project(self):
experimental_flags=self.experimental_flags,
)

if self.runtime == "python3.10":
if self.runtime in ("python3.10", "python3.11"):
self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"})
else:
Expand All @@ -120,7 +121,7 @@ def test_must_build_python_project_python3_binary(self):
executable_search_paths=[executable_dir],
)

if self.runtime == "python3.10":
if self.runtime in ("python3.10", "python3.11"):
self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_x86_64", "manylinux1_x86_64"])
expected_files = self.test_data_files.union({"numpy", "numpy-1.23.5.dist-info", "numpy.libs"})
else:
Expand Down Expand Up @@ -165,12 +166,12 @@ def test_must_build_python_project_with_arm_architecture(self):
experimental_flags=self.experimental_flags,
)
expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.20.3.dist-info"})
if self.runtime == "python3.10":
if self.runtime in ("python3.10", "python3.11"):
expected_files = self.test_data_files.union({"numpy", "numpy.libs", "numpy-1.23.5.dist-info"})
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

if self.runtime == "python3.10":
if self.runtime in ("python3.10", "python3.11"):
self.check_architecture_in("numpy-1.23.5.dist-info", ["manylinux2014_aarch64"])
else:
self.check_architecture_in("numpy-1.20.3.dist-info", ["manylinux2014_aarch64"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ numpy==1.17.4; python_version == '3.6'
numpy==1.20.3; python_version == '3.7'
numpy==1.20.3; python_version == '3.8'
numpy==1.20.3; python_version == '3.9'
numpy==1.23.5; python_version == '3.10'
numpy==1.23.5; python_version == '3.10'
numpy==1.23.5; python_version == '3.11'
4 changes: 2 additions & 2 deletions tests/unit/workflows/dotnet_clipackage/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_build_package_arm64(self):

def test_build_package_arguments(self):
mode = "Release"
options = {"--framework": "netcoreapp2.1"}
options = {"--framework": "net6.0"}
action = RunPackageAction(
self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, os_utils=self.os_utils
)
Expand All @@ -176,7 +176,7 @@ def test_build_package_arguments(self):
"--msbuild-parameters",
"--runtime linux-x64",
"--framework",
"netcoreapp2.1",
"net6.0",
],
cwd="/source_dir",
)
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/workflows/python_pip/test_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def test_get_lambda_abi_python39(self):
def test_get_lambda_abi_python310(self):
assert "cp310" == get_lambda_abi("python3.10")

def test_get_lambda_abi_python311(self):
assert "cp311" == get_lambda_abi("python3.11")


class TestPythonPipDependencyBuilder(object):
def test_can_call_dependency_builder(self, osutils):
Expand Down

0 comments on commit 1a1eb27

Please sign in to comment.