diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b912f0950..d18d33bda 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -63,7 +63,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -88,7 +87,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -120,7 +118,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -154,7 +151,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -182,7 +178,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -213,7 +208,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -242,7 +236,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -267,7 +260,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -296,7 +288,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -310,9 +301,6 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- - uses: ruby/setup-ruby@v1
- with:
- ruby-version: "2.7"
- run: make init
- run: pytest -vv tests/integration/workflows/ruby_bundler
@@ -327,7 +315,6 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- - "3.7"
- "3.8"
- "3.9"
- "3.10"
@@ -359,7 +346,6 @@ jobs:
python:
- "3.9"
- "3.8"
- - "3.7"
rust:
- stable
steps:
diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py
index 668968c42..688cf091c 100644
--- a/aws_lambda_builders/__init__.py
+++ b/aws_lambda_builders/__init__.py
@@ -5,5 +5,5 @@
# Changing version will trigger a new release!
# Please make the version change as the last step of your development.
-__version__ = "1.45.0"
+__version__ = "1.46.0"
RPC_PROTOCOL_VERSION = "0.3"
diff --git a/aws_lambda_builders/architecture.py b/aws_lambda_builders/architecture.py
index 703b67408..36a8a1ee2 100644
--- a/aws_lambda_builders/architecture.py
+++ b/aws_lambda_builders/architecture.py
@@ -1,5 +1,6 @@
"""
Enum for determining type of architectures for Lambda Function.
"""
+
X86_64 = "x86_64"
ARM64 = "arm64"
diff --git a/aws_lambda_builders/utils.py b/aws_lambda_builders/utils.py
index 4bcd43dcc..d18ccf0a9 100644
--- a/aws_lambda_builders/utils.py
+++ b/aws_lambda_builders/utils.py
@@ -1,6 +1,7 @@
"""
Common utilities for the library
"""
+
import locale
import logging
import os
diff --git a/aws_lambda_builders/validator.py b/aws_lambda_builders/validator.py
index 0306ce14d..94e4d331b 100644
--- a/aws_lambda_builders/validator.py
+++ b/aws_lambda_builders/validator.py
@@ -10,18 +10,14 @@
LOG = logging.getLogger(__name__)
SUPPORTED_RUNTIMES = {
- "nodejs12.x": [ARM64, X86_64],
- "nodejs14.x": [ARM64, X86_64],
"nodejs16.x": [ARM64, X86_64],
"nodejs18.x": [ARM64, X86_64],
"nodejs20.x": [ARM64, X86_64],
- "python3.7": [X86_64],
"python3.8": [ARM64, X86_64],
"python3.9": [ARM64, X86_64],
"python3.10": [ARM64, X86_64],
"python3.11": [ARM64, X86_64],
"python3.12": [ARM64, X86_64],
- "ruby2.7": [ARM64, X86_64],
"ruby3.2": [ARM64, X86_64],
"java8": [ARM64, X86_64],
"java11": [ARM64, X86_64],
@@ -29,6 +25,7 @@
"java21": [ARM64, X86_64],
"go1.x": [ARM64, X86_64],
"dotnet6": [ARM64, X86_64],
+ "dotnet8": [ARM64, X86_64],
"provided": [ARM64, X86_64],
}
diff --git a/aws_lambda_builders/workflow.py b/aws_lambda_builders/workflow.py
index 133ff854a..ab6c5c713 100644
--- a/aws_lambda_builders/workflow.py
+++ b/aws_lambda_builders/workflow.py
@@ -1,6 +1,7 @@
"""
Implementation of a base workflow
"""
+
import functools
import logging
import os
diff --git a/aws_lambda_builders/workflows/custom_make/actions.py b/aws_lambda_builders/workflows/custom_make/actions.py
index cde42b0cf..82382e9ae 100644
--- a/aws_lambda_builders/workflows/custom_make/actions.py
+++ b/aws_lambda_builders/workflows/custom_make/actions.py
@@ -14,7 +14,6 @@
class CustomMakeAction(BaseAction):
-
"""
A Lambda Builder Action that builds and packages a provided runtime project using Make.
"""
diff --git a/aws_lambda_builders/workflows/custom_make/make.py b/aws_lambda_builders/workflows/custom_make/make.py
index 799242b04..b120ba853 100644
--- a/aws_lambda_builders/workflows/custom_make/make.py
+++ b/aws_lambda_builders/workflows/custom_make/make.py
@@ -1,6 +1,7 @@
"""
Wrapper around calling make through a subprocess.
"""
+
import io
import logging
import shutil
@@ -11,7 +12,6 @@
class MakeExecutionError(Exception):
-
"""
Exception raised in case Make execution fails.
It will pass on the standard error output from the Make console.
@@ -24,7 +24,6 @@ def __init__(self, **kwargs):
class SubProcessMake(object):
-
"""
Wrapper around the Make command line utility, making it
easy to consume execution results.
diff --git a/aws_lambda_builders/workflows/custom_make/utils.py b/aws_lambda_builders/workflows/custom_make/utils.py
index 15a7b17ce..369cbb89e 100644
--- a/aws_lambda_builders/workflows/custom_make/utils.py
+++ b/aws_lambda_builders/workflows/custom_make/utils.py
@@ -10,7 +10,6 @@
class OSUtils(object):
-
"""
Wrapper around file system functions, to make it easy to
unit test actions in memory
diff --git a/aws_lambda_builders/workflows/custom_make/workflow.py b/aws_lambda_builders/workflows/custom_make/workflow.py
index 5ea85202d..c4be1d5e2 100644
--- a/aws_lambda_builders/workflows/custom_make/workflow.py
+++ b/aws_lambda_builders/workflows/custom_make/workflow.py
@@ -1,6 +1,7 @@
"""
ProvidedMakeWorkflow
"""
+
from aws_lambda_builders.actions import CopySourceAction
from aws_lambda_builders.path_resolver import PathResolver
from aws_lambda_builders.workflow import BaseWorkflow, BuildDirectory, BuildInSourceSupport, Capability
@@ -13,7 +14,6 @@
class CustomMakeWorkflow(BaseWorkflow):
-
"""
A Lambda builder workflow for provided runtimes based on make.
"""
diff --git a/aws_lambda_builders/workflows/dotnet_clipackage/utils.py b/aws_lambda_builders/workflows/dotnet_clipackage/utils.py
index a1c0608f3..cd26cddc2 100644
--- a/aws_lambda_builders/workflows/dotnet_clipackage/utils.py
+++ b/aws_lambda_builders/workflows/dotnet_clipackage/utils.py
@@ -1,6 +1,7 @@
"""
Commonly used utilities
"""
+
import logging
import os
import platform
diff --git a/aws_lambda_builders/workflows/dotnet_clipackage/workflow.py b/aws_lambda_builders/workflows/dotnet_clipackage/workflow.py
index 5fc986e17..9a5e5f49a 100644
--- a/aws_lambda_builders/workflows/dotnet_clipackage/workflow.py
+++ b/aws_lambda_builders/workflows/dotnet_clipackage/workflow.py
@@ -1,6 +1,7 @@
"""
.NET Core CLI Package Workflow
"""
+
from aws_lambda_builders.workflow import BaseWorkflow, BuildDirectory, BuildInSourceSupport, Capability
from .actions import GlobalToolInstallAction, RunPackageAction
@@ -10,7 +11,6 @@
class DotnetCliPackageWorkflow(BaseWorkflow):
-
"""
A Lambda builder workflow that knows to build and package .NET Core Lambda functions
"""
diff --git a/aws_lambda_builders/workflows/go_modules/builder.py b/aws_lambda_builders/workflows/go_modules/builder.py
index 1c13b435e..02225a829 100644
--- a/aws_lambda_builders/workflows/go_modules/builder.py
+++ b/aws_lambda_builders/workflows/go_modules/builder.py
@@ -1,6 +1,7 @@
"""
Build a Go project using standard Go tooling
"""
+
import logging
from pathlib import Path
diff --git a/aws_lambda_builders/workflows/go_modules/workflow.py b/aws_lambda_builders/workflows/go_modules/workflow.py
index 8c2b0e034..9e570937c 100644
--- a/aws_lambda_builders/workflows/go_modules/workflow.py
+++ b/aws_lambda_builders/workflows/go_modules/workflow.py
@@ -1,6 +1,7 @@
"""
Go Modules Workflow
"""
+
from aws_lambda_builders.workflow import BaseWorkflow, BuildDirectory, BuildInSourceSupport, Capability
from .actions import GoModulesBuildAction
diff --git a/aws_lambda_builders/workflows/java_gradle/workflow.py b/aws_lambda_builders/workflows/java_gradle/workflow.py
index e3e4825d9..a853c53eb 100644
--- a/aws_lambda_builders/workflows/java_gradle/workflow.py
+++ b/aws_lambda_builders/workflows/java_gradle/workflow.py
@@ -1,6 +1,7 @@
"""
Java Gradle Workflow
"""
+
import hashlib
import os
diff --git a/aws_lambda_builders/workflows/java_maven/workflow.py b/aws_lambda_builders/workflows/java_maven/workflow.py
index d22c2b40a..656d43515 100644
--- a/aws_lambda_builders/workflows/java_maven/workflow.py
+++ b/aws_lambda_builders/workflows/java_maven/workflow.py
@@ -1,6 +1,7 @@
"""
Java Maven Workflow
"""
+
from aws_lambda_builders.actions import CleanUpAction, CopySourceAction
from aws_lambda_builders.workflow import BaseWorkflow, BuildDirectory, BuildInSourceSupport, Capability
from aws_lambda_builders.workflows.java.actions import JavaCopyDependenciesAction, JavaMoveDependenciesAction
diff --git a/aws_lambda_builders/workflows/nodejs_npm/actions.py b/aws_lambda_builders/workflows/nodejs_npm/actions.py
index bb45fb1ec..d73f0bd80 100644
--- a/aws_lambda_builders/workflows/nodejs_npm/actions.py
+++ b/aws_lambda_builders/workflows/nodejs_npm/actions.py
@@ -13,7 +13,6 @@
class NodejsNpmPackAction(BaseAction):
-
"""
A Lambda Builder Action that packages a Node.js package using NPM to extract the source and remove test resources
"""
@@ -151,7 +150,6 @@ def execute(self):
class NodejsNpmCIAction(BaseAction):
-
"""
A Lambda Builder Action that installs NPM project dependencies
using the CI method - which is faster and better reproducible
@@ -201,7 +199,6 @@ def execute(self):
class NodejsNpmrcAndLockfileCopyAction(BaseAction):
-
"""
A Lambda Builder Action that copies lockfile and NPM config file .npmrc
"""
@@ -247,7 +244,6 @@ def execute(self):
class NodejsNpmrcCleanUpAction(BaseAction):
-
"""
A Lambda Builder Action that cleans NPM config file .npmrc
"""
@@ -288,7 +284,6 @@ def execute(self):
class NodejsNpmLockFileCleanUpAction(BaseAction):
-
"""
A Lambda Builder Action that cleans up garbage lockfile left by 7 in node_modules
"""
diff --git a/aws_lambda_builders/workflows/nodejs_npm/exceptions.py b/aws_lambda_builders/workflows/nodejs_npm/exceptions.py
index ebce8621c..21aeb8644 100644
--- a/aws_lambda_builders/workflows/nodejs_npm/exceptions.py
+++ b/aws_lambda_builders/workflows/nodejs_npm/exceptions.py
@@ -2,7 +2,6 @@
Exceptions for the Node.js workflow
"""
-
from aws_lambda_builders.exceptions import LambdaBuilderError
diff --git a/aws_lambda_builders/workflows/nodejs_npm/npm.py b/aws_lambda_builders/workflows/nodejs_npm/npm.py
index 33b2598ef..472d3df4e 100644
--- a/aws_lambda_builders/workflows/nodejs_npm/npm.py
+++ b/aws_lambda_builders/workflows/nodejs_npm/npm.py
@@ -10,7 +10,6 @@
class SubprocessNpm(object):
-
"""
Wrapper around the NPM command line utility, making it
easy to consume execution results.
diff --git a/aws_lambda_builders/workflows/nodejs_npm/utils.py b/aws_lambda_builders/workflows/nodejs_npm/utils.py
index e2d5afe10..cf43a1bce 100644
--- a/aws_lambda_builders/workflows/nodejs_npm/utils.py
+++ b/aws_lambda_builders/workflows/nodejs_npm/utils.py
@@ -10,7 +10,6 @@
class OSUtils(object):
-
"""
Wrapper around file system functions, to make it easy to
unit test actions in memory
diff --git a/aws_lambda_builders/workflows/nodejs_npm/workflow.py b/aws_lambda_builders/workflows/nodejs_npm/workflow.py
index cd111b530..f1e9ff5b1 100644
--- a/aws_lambda_builders/workflows/nodejs_npm/workflow.py
+++ b/aws_lambda_builders/workflows/nodejs_npm/workflow.py
@@ -42,7 +42,6 @@
class NodejsNpmWorkflow(BaseWorkflow):
-
"""
A Lambda builder workflow that knows how to pack
NodeJS projects using NPM.
diff --git a/aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py b/aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py
index fbb5cb012..49029c5fd 100644
--- a/aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py
+++ b/aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py
@@ -1,6 +1,7 @@
"""
Actions specific to the esbuild bundler
"""
+
import logging
from typing import Any, Dict
@@ -17,7 +18,6 @@
class EsbuildBundleAction(BaseAction):
-
"""
A Lambda Builder Action that packages a Node.js package using esbuild into a single file
optionally transpiling TypeScript
diff --git a/aws_lambda_builders/workflows/nodejs_npm_esbuild/esbuild.py b/aws_lambda_builders/workflows/nodejs_npm_esbuild/esbuild.py
index 2d4242bdd..a56fa91db 100644
--- a/aws_lambda_builders/workflows/nodejs_npm_esbuild/esbuild.py
+++ b/aws_lambda_builders/workflows/nodejs_npm_esbuild/esbuild.py
@@ -1,6 +1,7 @@
"""
Wrapper around calling esbuild through a subprocess.
"""
+
import logging
from pathlib import Path
from typing import Any, Callable, Dict, List, Union
diff --git a/aws_lambda_builders/workflows/nodejs_npm_esbuild/exceptions.py b/aws_lambda_builders/workflows/nodejs_npm_esbuild/exceptions.py
index 56bbf1f4a..5cb9cfc0e 100644
--- a/aws_lambda_builders/workflows/nodejs_npm_esbuild/exceptions.py
+++ b/aws_lambda_builders/workflows/nodejs_npm_esbuild/exceptions.py
@@ -1,6 +1,7 @@
"""
Esbuild specific exceptions
"""
+
from aws_lambda_builders.actions import ActionFailedError
from aws_lambda_builders.exceptions import LambdaBuilderError
diff --git a/aws_lambda_builders/workflows/nodejs_npm_esbuild/workflow.py b/aws_lambda_builders/workflows/nodejs_npm_esbuild/workflow.py
index ae3ade1c5..0783d4f38 100644
--- a/aws_lambda_builders/workflows/nodejs_npm_esbuild/workflow.py
+++ b/aws_lambda_builders/workflows/nodejs_npm_esbuild/workflow.py
@@ -30,7 +30,6 @@
class NodejsNpmEsbuildWorkflow(BaseWorkflow):
-
"""
A Lambda builder workflow that uses esbuild to bundle Node.js and transpile TS
NodeJS projects using NPM with esbuild.
diff --git a/aws_lambda_builders/workflows/python_pip/DESIGN.md b/aws_lambda_builders/workflows/python_pip/DESIGN.md
index c1d9fadb8..1767e32d3 100644
--- a/aws_lambda_builders/workflows/python_pip/DESIGN.md
+++ b/aws_lambda_builders/workflows/python_pip/DESIGN.md
@@ -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, python3.10, python3.11 or python3.12. These are
+ either be python3.8, python3.9, python3.10, python3.11 or python3.12. These are
currently the only supported values.
:type ui: :class:`lambda_builders.actions.python_pip.utils.UI`
diff --git a/aws_lambda_builders/workflows/python_pip/exceptions.py b/aws_lambda_builders/workflows/python_pip/exceptions.py
index d35915807..6a491c3c5 100644
--- a/aws_lambda_builders/workflows/python_pip/exceptions.py
+++ b/aws_lambda_builders/workflows/python_pip/exceptions.py
@@ -1,6 +1,7 @@
"""
Python pip specific workflow exceptions.
"""
+
from aws_lambda_builders.exceptions import LambdaBuilderError
diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py
index 7a752d70c..65a802028 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 = {
- "python3.7": "cp37m",
"python3.8": "cp38",
"python3.9": "cp39",
"python3.10": "cp310",
@@ -101,7 +100,7 @@ def __init__(self, runtime, python_exe, osutils=None, dependency_builder=None, a
:type runtime: str
:param runtime: Python version to build dependencies for. This can
- either be python3.7, python3.8, python3.9, python3.10, python3.11 or python3.12. These are currently the
+ either be python3.8, python3.9, python3.10, python3.11 or python3.12. These are currently the
only supported values.
:type osutils: :class:`lambda_builders.utils.OSUtils`
diff --git a/aws_lambda_builders/workflows/python_pip/workflow.py b/aws_lambda_builders/workflows/python_pip/workflow.py
index 1e87c9d5d..1862fd450 100644
--- a/aws_lambda_builders/workflows/python_pip/workflow.py
+++ b/aws_lambda_builders/workflows/python_pip/workflow.py
@@ -1,6 +1,7 @@
"""
Python PIP Workflow
"""
+
import logging
from aws_lambda_builders.actions import CleanUpAction, CopySourceAction, LinkSourceAction
diff --git a/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md b/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md
index 433df21c5..8ce00fbaf 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 `public.ecr.aws/sam/build-ruby2.7`.
+This command would use some sort of container, such as `public.ecr.aws/sam/build-ruby3.2`.
```shell
# exit with error if vendor/bundle and/or .bundle directory exists and is non-empty
diff --git a/aws_lambda_builders/workflows/ruby_bundler/actions.py b/aws_lambda_builders/workflows/ruby_bundler/actions.py
index 63d26eada..335a0afbb 100644
--- a/aws_lambda_builders/workflows/ruby_bundler/actions.py
+++ b/aws_lambda_builders/workflows/ruby_bundler/actions.py
@@ -12,7 +12,6 @@
class RubyBundlerInstallAction(BaseAction):
-
"""
A Lambda Builder Action which runs bundle install in order to build a full Gemfile.lock
"""
diff --git a/aws_lambda_builders/workflows/ruby_bundler/utils.py b/aws_lambda_builders/workflows/ruby_bundler/utils.py
index 6d8b512d7..113a7caef 100644
--- a/aws_lambda_builders/workflows/ruby_bundler/utils.py
+++ b/aws_lambda_builders/workflows/ruby_bundler/utils.py
@@ -9,7 +9,6 @@
class OSUtils(object):
-
"""
Wrapper around file system functions, to make it easy to
unit test actions in memory
diff --git a/aws_lambda_builders/workflows/ruby_bundler/workflow.py b/aws_lambda_builders/workflows/ruby_bundler/workflow.py
index 0dd082426..77f3d7003 100644
--- a/aws_lambda_builders/workflows/ruby_bundler/workflow.py
+++ b/aws_lambda_builders/workflows/ruby_bundler/workflow.py
@@ -1,6 +1,7 @@
"""
Ruby Bundler Workflow
"""
+
import logging
from aws_lambda_builders.actions import CleanUpAction, CopyDependenciesAction, CopySourceAction
@@ -14,7 +15,6 @@
class RubyBundlerWorkflow(BaseWorkflow):
-
"""
A Lambda builder workflow that knows how to build
Ruby projects using Bundler.
diff --git a/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py b/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py
index a9db9d995..33c61ee36 100644
--- a/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py
+++ b/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py
@@ -1,6 +1,7 @@
"""
Wrapper around calling Cargo Lambda through a subprocess.
"""
+
import io
import logging
import os
diff --git a/requirements/dev.txt b/requirements/dev.txt
index a5faa70b2..98fd3a483 100644
--- a/requirements/dev.txt
+++ b/requirements/dev.txt
@@ -1,17 +1,12 @@
-coverage==7.2.7; python_version < '3.8'
-coverage==7.3.2; python_version >= '3.8'
-flake8==3.3.0; python_version < '3.8'
-flake8==3.8.4; python_version >= '3.8'
+coverage==7.4.1
+flake8==3.8.4
pytest-cov==4.1.0
-isort>=4.2.5,<5; python_version < '3.8'
-
# Test requirements
pytest>=6.1.1
parameterized==0.9.0
pyelftools~=0.30 # Used to verify the generated Go binary architecture in integration tests (utils.py)
# formatter
-black==22.6.0; python_version < "3.8"
-black==23.11.0; python_version >= "3.8"
-ruff==0.1.7
+black==24.2.0
+ruff==0.2.1
diff --git a/setup.py b/setup.py
index bcd79b7f1..d10bb6cf0 100644
--- a/setup.py
+++ b/setup.py
@@ -43,8 +43,8 @@ def read_version():
license="Apache License 2.0",
packages=find_packages(exclude=["tests.*", "tests"]),
keywords="AWS Lambda Functions Building",
- # Support 3.7 or greater
- python_requires=(">=3.7"),
+ # Support 3.8 or greater
+ python_requires=(">=3.8"),
entry_points={"console_scripts": ["{}=aws_lambda_builders.__main__:main".format(cmd_name)]},
install_requires=read_requirements("base.txt") + read_requirements("python_pip.txt"),
extras_require={"dev": read_requirements("dev.txt")},
@@ -58,7 +58,6 @@ def read_version():
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
- "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
diff --git a/tests/functional/test_actions.py b/tests/functional/test_actions.py
index 9909bcffe..d26647e2e 100644
--- a/tests/functional/test_actions.py
+++ b/tests/functional/test_actions.py
@@ -30,7 +30,7 @@ def test_copy_dependencies_action(self, source_folder):
copy_dependencies_action = CopyDependenciesAction(empty_source, test_folder, target)
copy_dependencies_action.execute()
- self.assertEqual(os.listdir(test_folder), os.listdir(target))
+ self.assertEqual(set(os.listdir(test_folder)), set(os.listdir(target)))
def test_must_maintain_symlinks_if_enabled(self):
with tempfile.TemporaryDirectory() as tmpdir:
@@ -116,4 +116,4 @@ def test_move_dependencies_action(self, source_folder):
move_dependencies_action = MoveDependenciesAction(empty_source, test_source, target)
move_dependencies_action.execute()
- self.assertEqual(os.listdir(test_folder), os.listdir(target))
+ self.assertEqual(set(os.listdir(test_folder)), set(os.listdir(target)))
diff --git a/tests/integration/workflows/dotnet_clipackage/test_dotnet.py b/tests/integration/workflows/dotnet_clipackage/test_dotnet.py
index 187a9c7ab..95743d112 100644
--- a/tests/integration/workflows/dotnet_clipackage/test_dotnet.py
+++ b/tests/integration/workflows/dotnet_clipackage/test_dotnet.py
@@ -2,6 +2,7 @@
import shutil
import tempfile
import json
+from parameterized import parameterized
try:
import pathlib
@@ -25,13 +26,12 @@ 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 = "dotnet6"
def tearDown(self):
shutil.rmtree(self.artifacts_dir)
shutil.rmtree(self.scratch_dir)
- def verify_architecture(self, deps_file_name, expected_architecture, version=None):
+ def verify_architecture(self, deps_file_name, expected_architecture, version):
deps_file = pathlib.Path(self.artifacts_dir, deps_file_name)
if not deps_file.exists():
@@ -39,7 +39,6 @@ def verify_architecture(self, deps_file_name, expected_architecture, version=Non
with open(str(deps_file)) as f:
deps_json = json.loads(f.read())
- version = version or self.runtime[-3:]
target_name = ".NETCoreApp,Version=v{}/{}".format(version, expected_architecture)
target = deps_json.get("runtimeTarget").get("name")
@@ -50,19 +49,24 @@ def verify_execute_permissions(self, entrypoint_file_name):
self.assertTrue(os.access(entrypoint_file_path, os.X_OK))
-class TestDotnet6(TestDotnetBase):
+class TestDotnet(TestDotnetBase):
"""
- Tests for dotnet 6
+ Tests for dotnet
"""
def setUp(self):
- super(TestDotnet6, self).setUp()
- self.runtime = "dotnet6"
+ super(TestDotnet, self).setUp()
- def test_with_defaults_file(self):
- source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile6")
+ @parameterized.expand(
+ [
+ ("dotnet6", "6.0", "WithDefaultsFile6"),
+ ("dotnet8", "8.0", "WithDefaultsFile8"),
+ ]
+ )
+ def test_with_defaults_file(self, runtime, version, test_project):
+ source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
- self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime)
+ self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime)
expected_files = {
"Amazon.Lambda.Core.dll",
@@ -77,14 +81,18 @@ def test_with_defaults_file(self):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version="6.0")
+ self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version)
- def test_with_defaults_file_x86(self):
- source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile6")
+ @parameterized.expand(
+ [
+ ("dotnet6", "6.0", "WithDefaultsFile6"),
+ ("dotnet8", "8.0", "WithDefaultsFile8"),
+ ]
+ )
+ def test_with_defaults_file_x86(self, runtime, version, test_project):
+ source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
- self.builder.build(
- source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=X86_64
- )
+ self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime, architecture=X86_64)
expected_files = {
"Amazon.Lambda.Core.dll",
@@ -99,14 +107,18 @@ def test_with_defaults_file_x86(self):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version="6.0")
+ self.verify_architecture("WithDefaultsFile.deps.json", "linux-x64", version)
- def test_with_defaults_file_arm64(self):
- source_dir = os.path.join(self.TEST_DATA_FOLDER, "WithDefaultsFile6")
+ @parameterized.expand(
+ [
+ ("dotnet6", "6.0", "WithDefaultsFile6"),
+ ("dotnet8", "8.0", "WithDefaultsFile8"),
+ ]
+ )
+ def test_with_defaults_file_arm64(self, runtime, version, test_project):
+ source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
- self.builder.build(
- source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=ARM64
- )
+ self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime, architecture=ARM64)
expected_files = {
"Amazon.Lambda.Core.dll",
@@ -121,14 +133,18 @@ def test_with_defaults_file_arm64(self):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- self.verify_architecture("WithDefaultsFile.deps.json", "linux-arm64", version="6.0")
+ self.verify_architecture("WithDefaultsFile.deps.json", "linux-arm64", version)
- def test_with_custom_runtime(self):
- source_dir = os.path.join(self.TEST_DATA_FOLDER, "CustomRuntime6")
+ @parameterized.expand(
+ [
+ ("dotnet6", "6.0", "CustomRuntime6"),
+ ("dotnet8", "8.0", "CustomRuntime8"),
+ ]
+ )
+ def test_with_custom_runtime(self, runtime, version, test_project):
+ source_dir = os.path.join(self.TEST_DATA_FOLDER, test_project)
- self.builder.build(
- source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime=self.runtime, architecture=X86_64
- )
+ self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, source_dir, runtime, architecture=X86_64)
expected_files = {
"Amazon.Lambda.Core.dll",
@@ -144,7 +160,7 @@ def test_with_custom_runtime(self):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- self.verify_architecture("bootstrap.deps.json", "linux-x64", version="6.0")
+ self.verify_architecture("bootstrap.deps.json", "linux-x64", version)
# Execute permissions are required for custom runtimes which bootstrap themselves, otherwise `sam local invoke`
# won't have permission to run the file
self.verify_execute_permissions("bootstrap")
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/CustomRuntime8.csproj b/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/CustomRuntime8.csproj
new file mode 100644
index 000000000..5dc8d0f1b
--- /dev/null
+++ b/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/CustomRuntime8.csproj
@@ -0,0 +1,17 @@
+
+
+ Exe
+ net8.0
+ enable
+ enable
+ Lambda
+ bootstrap
+ true
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/Function.cs b/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/Function.cs
new file mode 100644
index 000000000..0bbad05ac
--- /dev/null
+++ b/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/Function.cs
@@ -0,0 +1,21 @@
+using Amazon.Lambda.Core;
+using Amazon.Lambda.RuntimeSupport;
+using Amazon.Lambda.Serialization.SystemTextJson;
+
+namespace CustomRuntime6;
+
+public class Function
+{
+ private static async Task Main(string[] args)
+ {
+ Func handler = FunctionHandler;
+ await LambdaBootstrapBuilder.Create(handler, new DefaultLambdaJsonSerializer())
+ .Build()
+ .RunAsync();
+ }
+
+ public static string FunctionHandler(string input, ILambdaContext context)
+ {
+ return input.ToUpper();
+ }
+}
\ No newline at end of file
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/aws-lambda-tools-defaults.json b/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/aws-lambda-tools-defaults.json
new file mode 100644
index 000000000..9c44274ae
--- /dev/null
+++ b/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime8/aws-lambda-tools-defaults.json
@@ -0,0 +1,16 @@
+{
+ "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",
+ "function-runtime": "provided.al2",
+ "function-memory-size": 256,
+ "function-timeout": 30,
+ "function-handler": "bootstrap",
+ "msbuild-parameters": "--self-contained true"
+}
\ No newline at end of file
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/RequireParameters/RequireParameters.cs b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/Function.cs
similarity index 96%
rename from tests/integration/workflows/dotnet_clipackage/testdata/RequireParameters/RequireParameters.cs
rename to tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/Function.cs
index 602632404..23fc86994 100644
--- a/tests/integration/workflows/dotnet_clipackage/testdata/RequireParameters/RequireParameters.cs
+++ b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/Function.cs
@@ -8,7 +8,7 @@
// 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 RequireParameters
+namespace WithDefaultsFile
{
public class Function
{
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/RequireParameters/RequireParameters.csproj b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/WithDefaultsFile.csproj
similarity index 89%
rename from tests/integration/workflows/dotnet_clipackage/testdata/RequireParameters/RequireParameters.csproj
rename to tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/WithDefaultsFile.csproj
index 5db764810..cdb851832 100644
--- a/tests/integration/workflows/dotnet_clipackage/testdata/RequireParameters/RequireParameters.csproj
+++ b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/WithDefaultsFile.csproj
@@ -1,6 +1,6 @@
- net6.0
+ net8.0
true
Lambda
diff --git a/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/aws-lambda-tools-defaults.json b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/aws-lambda-tools-defaults.json
new file mode 100644
index 000000000..81e94b11d
--- /dev/null
+++ b/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile8/aws-lambda-tools-defaults.json
@@ -0,0 +1,16 @@
+{
+ "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": "net8.0",
+ "function-runtime": "dotnet8",
+ "function-memory-size": 256,
+ "function-timeout": 30,
+ "function-handler": "WithDefaultsFile::WithDefaultsFile.Function::FunctionHandler"
+}
\ No newline at end of file
diff --git a/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py b/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py
index 279f6e19f..d27f8a2d6 100644
--- a/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py
+++ b/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py
@@ -41,7 +41,7 @@ def tearDown(self):
shutil.rmtree(self.dependencies_dir)
shutil.rmtree(self.temp_dir)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_without_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps")
@@ -57,7 +57,7 @@ def test_builds_project_without_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_without_manifest(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-manifest")
@@ -75,7 +75,7 @@ def test_builds_project_without_manifest(self, runtime):
mock_warning.assert_called_once_with("package.json file not found. Continuing the build without dependencies.")
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_and_excludes_hidden_aws_sam(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "excluded-files")
@@ -91,7 +91,7 @@ def test_builds_project_and_excludes_hidden_aws_sam(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")
@@ -111,7 +111,7 @@ def test_builds_project_with_remote_dependencies(self, runtime):
output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules")))
self.assertEqual(expected_modules, output_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_npmrc(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npmrc")
@@ -134,18 +134,12 @@ def test_builds_project_with_npmrc(self, runtime):
@parameterized.expand(
[
- ("nodejs12.x", "package-lock"),
- ("nodejs14.x", "package-lock"),
("nodejs16.x", "package-lock"),
("nodejs18.x", "package-lock"),
("nodejs20.x", "package-lock"),
- ("nodejs12.x", "shrinkwrap"),
- ("nodejs14.x", "shrinkwrap"),
("nodejs16.x", "shrinkwrap"),
("nodejs18.x", "shrinkwrap"),
("nodejs20.x", "shrinkwrap"),
- ("nodejs12.x", "package-lock-and-shrinkwrap"),
- ("nodejs14.x", "package-lock-and-shrinkwrap"),
("nodejs16.x", "package-lock-and-shrinkwrap"),
("nodejs18.x", "package-lock-and-shrinkwrap"),
("nodejs20.x", "package-lock-and-shrinkwrap"),
@@ -175,7 +169,7 @@ def test_builds_project_with_lockfile(self, runtime, dir_name):
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_fails_if_npm_cannot_resolve_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps")
@@ -190,7 +184,7 @@ def test_fails_if_npm_cannot_resolve_dependencies(self, runtime):
self.assertIn("No matching version found for aws-sdk@2.997.999", str(ctx.exception))
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")
@@ -208,7 +202,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")
@@ -238,7 +232,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir(
self, runtime
):
@@ -259,7 +253,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_without_combine_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")
@@ -286,7 +280,7 @@ def test_builds_project_without_combine_dependencies(self, runtime):
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_build_in_source_with_download_dependencies(self, runtime):
source_dir = os.path.join(self.temp_testdata_dir, "npm-deps")
@@ -315,7 +309,7 @@ def test_build_in_source_with_download_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_build_in_source_with_removed_dependencies(self, runtime):
# run a build with default requirements and confirm dependencies are downloaded
source_dir = os.path.join(self.temp_testdata_dir, "npm-deps")
@@ -355,7 +349,7 @@ def test_build_in_source_with_removed_dependencies(self, runtime):
self.assertIn(".package-lock.json", set(os.listdir(source_node_modules)))
self.assertNotIn("minimal-request-promise", set(os.listdir(source_node_modules)))
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_build_in_source_with_download_dependencies_local_dependency(self, runtime):
source_dir = os.path.join(self.temp_testdata_dir, "with-local-dependency")
@@ -384,7 +378,7 @@ def test_build_in_source_with_download_dependencies_local_dependency(self, runti
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_build_in_source_with_download_dependencies_and_dependencies_dir(self, runtime):
source_dir = os.path.join(self.temp_testdata_dir, "npm-deps")
@@ -419,7 +413,7 @@ def test_build_in_source_with_download_dependencies_and_dependencies_dir(self, r
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_build_in_source_with_download_dependencies_and_dependencies_dir_without_combine_dependencies(
self, runtime
):
@@ -452,7 +446,7 @@ def test_build_in_source_with_download_dependencies_and_dependencies_dir_without
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_build_in_source_reuse_saved_dependencies_dir(self, runtime):
source_dir = os.path.join(self.temp_testdata_dir, "npm-deps")
@@ -508,7 +502,7 @@ def test_build_in_source_reuse_saved_dependencies_dir(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root(self, runtime):
base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -531,7 +525,7 @@ def test_builds_project_with_manifest_outside_root(self, runtime):
output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules")))
self.assertEqual(expected_modules, output_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_with_reuse_saved_dependencies_dir(self, runtime):
base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -578,7 +572,7 @@ def test_builds_project_with_manifest_outside_root_with_reuse_saved_dependencies
output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules")))
self.assertEqual(expected_modules, output_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_not_combine(self, runtime):
base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -603,7 +597,7 @@ def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_not
dependencies_dir_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules")))
self.assertEqual(expected_modules, dependencies_dir_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_combine(self, runtime):
base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -632,7 +626,7 @@ def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_com
dependencies_dir_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules")))
self.assertEqual(expected_modules, dependencies_dir_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_and_local_dependencies(self, runtime):
base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root-with-local-dependency")
source_dir = os.path.join(base_dir, "src")
@@ -660,7 +654,7 @@ def test_builds_project_with_manifest_outside_root_and_local_dependencies(self,
source_modules = set(os.listdir(os.path.join(source_dir, "node_modules")))
self.assertTrue(all(expected_module in source_modules for expected_module in expected_modules))
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_reuse_saved_dependencies_dir(
self, runtime
):
@@ -715,7 +709,7 @@ def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_r
source_modules = set(os.listdir(os.path.join(source_dir, "node_modules")))
self.assertTrue(all(expected_module in source_modules for expected_module in expected_modules))
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_dependencies_dir_and_not_combine(
self, runtime
):
@@ -747,7 +741,7 @@ def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_d
source_modules = set(os.listdir(os.path.join(source_dir, "node_modules")))
self.assertTrue(all(expected_module in source_modules for expected_module in expected_modules))
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_dependencies_dir_and_combine(
self, runtime
):
diff --git a/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py b/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py
index ecd6119b8..81f832da4 100644
--- a/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py
+++ b/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py
@@ -52,7 +52,7 @@ def tearDown(self):
if os.path.exists(source_dependencies):
shutil.rmtree(source_dependencies)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_javascript_project_with_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")
@@ -73,7 +73,7 @@ def test_builds_javascript_project_with_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_javascript_project_with_multiple_entrypoints(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-multiple-entrypoints")
@@ -94,7 +94,7 @@ def test_builds_javascript_project_with_multiple_entrypoints(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_typescript_projects(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-typescript")
@@ -115,7 +115,7 @@ def test_builds_typescript_projects(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_with_external_esbuild(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild")
options = {"entry_points": ["included.js"]}
@@ -135,7 +135,7 @@ def test_builds_with_external_esbuild(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_no_options_passed_to_esbuild(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")
@@ -152,7 +152,7 @@ def test_no_options_passed_to_esbuild(self, runtime):
self.assertEqual(str(context.exception), "NodejsNpmEsbuildBuilder:EsbuildBundle - entry_points not set ({})")
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_bundle_with_implicit_file_types(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "implicit-file-types")
@@ -173,7 +173,7 @@ def test_bundle_with_implicit_file_types(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_bundles_project_without_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-package-esbuild")
options = {"entry_points": ["included"]}
@@ -199,7 +199,7 @@ def test_bundles_project_without_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules")
options = {"entry_points": ["included.js"]}
@@ -227,7 +227,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules")
options = {"entry_points": ["included.js"]}
@@ -257,7 +257,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir(
self, runtime
):
@@ -282,7 +282,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
"dependencies directory was not provided and downloading dependencies is disabled.",
)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_project_without_combine_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules")
options = {"entry_points": ["included.js"]}
@@ -313,7 +313,7 @@ def test_builds_project_without_combine_dependencies(self, runtime):
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_javascript_project_with_external(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-externals")
@@ -338,7 +338,7 @@ def test_builds_javascript_project_with_external(self, runtime):
# Check that the module has been require() instead of bundled
self.assertIn('require("minimal-request-promise")', js_file)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_javascript_project_with_loader(self, runtime):
osutils = OSUtils()
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild-loader")
@@ -380,7 +380,7 @@ def test_builds_javascript_project_with_loader(self, runtime):
),
)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_includes_sourcemap_if_requested(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")
@@ -401,7 +401,7 @@ def test_includes_sourcemap_if_requested(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_esbuild_produces_mjs_output_files(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")
options = {"entry_points": ["included.js"], "sourcemap": True, "out_extension": [".js=.mjs"]}
@@ -421,7 +421,7 @@ def test_esbuild_produces_mjs_output_files(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_esbuild_produces_sourcemap_without_source_contents(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")
options = {"entry_points": ["included.js"], "sourcemap": True, "sources_content": "false"}
@@ -444,7 +444,7 @@ def test_esbuild_produces_sourcemap_without_source_contents(self, runtime):
self.assertNotIn("sourcesContent", sourcemap)
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_esbuild_can_build_in_source(self, runtime):
options = {"entry_points": ["included.js"]}
@@ -470,7 +470,7 @@ def test_esbuild_can_build_in_source(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_esbuild_can_build_in_source_with_local_dependency(self, runtime):
self.source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-local-dependency")
@@ -498,7 +498,7 @@ def test_esbuild_can_build_in_source_with_local_dependency(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_javascript_project_ignoring_relevant_flags(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")
@@ -519,7 +519,7 @@ def test_builds_javascript_project_ignoring_relevant_flags(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_typescript_projects_with_external_manifest(self, runtime):
base_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -541,7 +541,7 @@ def test_builds_typescript_projects_with_external_manifest(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir_without_combine(self, runtime):
base_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -570,7 +570,7 @@ def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir
output_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules")))
self.assertIn(expected_modules, output_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir_with_combine(self, runtime):
base_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-manifest-outside-root")
source_dir = os.path.join(base_dir, "src")
@@ -599,7 +599,7 @@ def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir
output_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules")))
self.assertIn(expected_modules, output_modules)
- @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
+ @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)])
def test_builds_typescript_projects_with_external_manifest_and_local_depends(self, runtime):
base_dir = os.path.join(self.temp_testdata_dir, "esbuild-manifest-outside-root-with-local-depends")
source_dir = os.path.join(base_dir, "src")
diff --git a/tests/integration/workflows/python_pip/test_python_pip.py b/tests/integration/workflows/python_pip/test_python_pip.py
index e93781224..9ceed3d13 100644
--- a/tests/integration/workflows/python_pip/test_python_pip.py
+++ b/tests/integration/workflows/python_pip/test_python_pip.py
@@ -59,9 +59,8 @@ def setUp(self):
language=self.builder.capability.language, major=sys.version_info.major, minor=sys.version_info.minor
)
self.runtime_mismatch = {
- "python3.7": "python3.8",
"python3.8": "python3.9",
- "python3.9": "python3.7",
+ "python3.9": "python3.10",
"python3.10": "python3.9",
"python3.11": "python3.10",
"python3.12": "python3.11",
@@ -256,10 +255,7 @@ def test_must_resolve_unknown_package_name(self):
runtime=self.runtime,
experimental_flags=self.experimental_flags,
)
- if self.runtime in ("python3.7"):
- expected_files = self.test_data_files.union(["inflate64", "inflate64-0.3.1.dist-info"])
- else:
- expected_files = self.test_data_files.union(["inflate64", "inflate64-1.0.0.dist-info"])
+ expected_files = self.test_data_files.union(["inflate64", "inflate64-1.0.0.dist-info"])
output_files = set(os.listdir(self.artifacts_dir))
for f in expected_files:
self.assertIn(f, output_files)
diff --git a/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt b/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt
index cf49c86eb..486c6b57f 100644
--- a/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt
+++ b/tests/integration/workflows/python_pip/testdata/requirements-numpy.txt
@@ -1,6 +1,3 @@
-numpy==1.15.4; python_version == '2.7'
-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'
diff --git a/tests/integration/workflows/ruby_bundler/test_ruby.py b/tests/integration/workflows/ruby_bundler/test_ruby.py
index 072e92e94..5dd491dfb 100644
--- a/tests/integration/workflows/ruby_bundler/test_ruby.py
+++ b/tests/integration/workflows/ruby_bundler/test_ruby.py
@@ -18,7 +18,6 @@
@parameterized_class(
("runtime",),
[
- ("ruby2.7",),
("ruby3.2",),
],
)
diff --git a/tests/unit/test_validator.py b/tests/unit/test_validator.py
index 083774aa6..56e03cc69 100644
--- a/tests/unit/test_validator.py
+++ b/tests/unit/test_validator.py
@@ -22,8 +22,8 @@ def test_validate_with_unsupported_runtime(self):
validator.validate("/usr/bin/unknown_runtime")
def test_validate_with_runtime_and_incompatible_architecture(self):
- runtime_list = ["python3.7"]
+ runtime_list = ["python3.12"]
for runtime in runtime_list:
- validator = RuntimeValidator(runtime=runtime, architecture="arm64")
+ validator = RuntimeValidator(runtime=runtime, architecture="invalid_arch")
with self.assertRaises(UnsupportedArchitectureError):
validator.validate("/usr/bin/{}".format(runtime))
diff --git a/tests/unit/test_workflow.py b/tests/unit/test_workflow.py
index 930aa5b76..7484686b2 100644
--- a/tests/unit/test_workflow.py
+++ b/tests/unit/test_workflow.py
@@ -369,7 +369,7 @@ def test_must_raise_for_incompatible_runtime_and_architecture(self):
"artifacts_dir",
"scratch_dir",
"manifest_path",
- runtime="python3.7",
+ runtime="python3.12",
executable_search_paths=[str(pathlib.Path(os.getcwd()).parent)],
optimizations={"a": "b"},
options={"c": "d"},
@@ -378,7 +378,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="python3.7", architecture="arm64")
+ side_effect=UnsupportedArchitectureError(runtime="python3.12", architecture="invalid_arch")
)
resolver_mock = Mock()
@@ -394,7 +394,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 python3.7", str(ex.exception))
+ self.assertIn("Architecture invalid_arch is not supported for runtime python3.12", str(ex.exception))
class TestBaseWorkflow_repr(TestCase):
diff --git a/tests/unit/workflows/custom_make/test_workflow.py b/tests/unit/workflows/custom_make/test_workflow.py
index c82d21175..3ff9651d8 100644
--- a/tests/unit/workflows/custom_make/test_workflow.py
+++ b/tests/unit/workflows/custom_make/test_workflow.py
@@ -8,7 +8,6 @@
class TestProvidedMakeWorkflow(TestCase):
-
"""
the workflow requires an external utility (make) to run, so it is extensively tested in integration tests.
this is just a quick wiring test to provide fast feedback if things are badly broken
diff --git a/tests/unit/workflows/dotnet_clipackage/test_actions.py b/tests/unit/workflows/dotnet_clipackage/test_actions.py
index 2005155ca..c9e54a518 100644
--- a/tests/unit/workflows/dotnet_clipackage/test_actions.py
+++ b/tests/unit/workflows/dotnet_clipackage/test_actions.py
@@ -4,6 +4,7 @@
import platform
from concurrent.futures import ThreadPoolExecutor
from unittest.mock import patch
+from parameterized import parameterized
from aws_lambda_builders.actions import ActionFailedError
from aws_lambda_builders.architecture import ARM64, X86_64
@@ -154,9 +155,15 @@ def test_build_package_arm64(self):
cwd="/source_dir",
)
- def test_build_package_arguments(self):
+ @parameterized.expand(
+ [
+ ("net6.0"),
+ ("net8.0"),
+ ]
+ )
+ def test_build_package_arguments(self, dotnet_version):
mode = "Release"
- options = {"--framework": "net6.0"}
+ options = {"--framework": dotnet_version}
action = RunPackageAction(
self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, os_utils=self.os_utils
)
@@ -176,7 +183,7 @@ def test_build_package_arguments(self):
"--msbuild-parameters",
"--runtime linux-x64",
"--framework",
- "net6.0",
+ dotnet_version,
],
cwd="/source_dir",
)
diff --git a/tests/unit/workflows/java_gradle/test_gradlew_resolver.py b/tests/unit/workflows/java_gradle/test_gradlew_resolver.py
index 49bde5f21..e28cb462b 100644
--- a/tests/unit/workflows/java_gradle/test_gradlew_resolver.py
+++ b/tests/unit/workflows/java_gradle/test_gradlew_resolver.py
@@ -20,8 +20,8 @@ def test_gradlew_exists_returns_gradlew(self):
def test_gradlew_not_exists_returns_gradle_on_path(self):
gradle_path = "/path/to/gradle"
- self.mock_os_utils.which.side_effect = (
- lambda executable, executable_search_paths: [] if executable == "gradlew" else [gradle_path]
+ self.mock_os_utils.which.side_effect = lambda executable, executable_search_paths: (
+ [] if executable == "gradlew" else [gradle_path]
)
resolver = GradleResolver(os_utils=self.mock_os_utils)
diff --git a/tests/unit/workflows/nodejs_npm/test_workflow.py b/tests/unit/workflows/nodejs_npm/test_workflow.py
index 832ce53b0..302c75b68 100644
--- a/tests/unit/workflows/nodejs_npm/test_workflow.py
+++ b/tests/unit/workflows/nodejs_npm/test_workflow.py
@@ -35,7 +35,6 @@ def communicate(self):
class TestNodejsNpmWorkflow(TestCase):
-
"""
the workflow requires an external utility (npm) to run, so it is extensively tested in integration tests.
this is just a quick wiring test to provide fast feedback if things are badly broken
diff --git a/tests/unit/workflows/nodejs_npm_esbuild/test_actions.py b/tests/unit/workflows/nodejs_npm_esbuild/test_actions.py
index faa5976eb..bd7b5169f 100644
--- a/tests/unit/workflows/nodejs_npm_esbuild/test_actions.py
+++ b/tests/unit/workflows/nodejs_npm_esbuild/test_actions.py
@@ -219,7 +219,7 @@ def test_uses_specified_target(self):
action = EsbuildBundleAction(
"source",
"artifacts",
- {"entry_points": ["x.js"], "target": "node14"},
+ {"entry_points": ["x.js"], "target": "node20"},
self.osutils,
self.subprocess_esbuild,
"package.json",
@@ -233,7 +233,7 @@ def test_uses_specified_target(self):
"--outdir=artifacts",
"--format=cjs",
"--minify",
- "--target=node14",
+ "--target=node20",
],
cwd="source",
)
@@ -242,7 +242,7 @@ def test_includes_multiple_entry_points_if_requested(self):
action = EsbuildBundleAction(
"source",
"artifacts",
- {"entry_points": ["x.js", "y.js"], "target": "node14"},
+ {"entry_points": ["x.js", "y.js"], "target": "node20"},
self.osutils,
self.subprocess_esbuild,
"package.json",
@@ -257,7 +257,7 @@ def test_includes_multiple_entry_points_if_requested(self):
"--outdir=artifacts",
"--format=cjs",
"--minify",
- "--target=node14",
+ "--target=node20",
],
cwd="source",
)
@@ -270,7 +270,7 @@ def test_includes_building_with_external_dependencies(self, osutils_mock):
action = EsbuildBundleAction(
"source",
"artifacts",
- {"entry_points": ["x.js", "y.js"], "target": "node14", "external": "./node_modules/*"},
+ {"entry_points": ["x.js", "y.js"], "target": "node20", "external": "./node_modules/*"},
osutils_mock,
self.subprocess_esbuild,
"package.json",
@@ -289,7 +289,7 @@ def test_includes_building_with_external_dependencies(self, osutils_mock):
"--outdir=artifacts",
"--format=cjs",
"--minify",
- "--target=node14",
+ "--target=node20",
],
cwd="source",
)
@@ -303,7 +303,7 @@ def test_building_with_external_dependencies_in_bundler_config_fails_if_esbuild_
action = EsbuildBundleAction(
"source",
"artifacts",
- {"entry_points": ["x.js", "y.js"], "target": "node14", "external": "./node_modules/*"},
+ {"entry_points": ["x.js", "y.js"], "target": "node20", "external": "./node_modules/*"},
osutils_mock,
subprocess_esbuild_mock,
"package.json",
diff --git a/tests/unit/workflows/nodejs_npm_esbuild/test_esbuild.py b/tests/unit/workflows/nodejs_npm_esbuild/test_esbuild.py
index e928282c9..4da6866bc 100644
--- a/tests/unit/workflows/nodejs_npm_esbuild/test_esbuild.py
+++ b/tests/unit/workflows/nodejs_npm_esbuild/test_esbuild.py
@@ -196,7 +196,7 @@ def test_builds_args_from_config(self, osutils_mock):
"sourcemap": False,
"sources_content": "false",
"format": "esm",
- "target": "node14",
+ "target": "node20",
"loader": [".proto=text", ".json=js"],
"external": ["aws-sdk", "axios"],
"out_extension": [".js=.mjs"],
@@ -212,7 +212,7 @@ def test_builds_args_from_config(self, osutils_mock):
set(args),
{
"--minify",
- "--target=node14",
+ "--target=node20",
"--format=esm",
"--main-fields=module,main",
"--external:aws-sdk",
diff --git a/tests/unit/workflows/nodejs_npm_esbuild/test_workflow.py b/tests/unit/workflows/nodejs_npm_esbuild/test_workflow.py
index 6773c45fb..4e41ca30c 100644
--- a/tests/unit/workflows/nodejs_npm_esbuild/test_workflow.py
+++ b/tests/unit/workflows/nodejs_npm_esbuild/test_workflow.py
@@ -34,7 +34,6 @@ def communicate(self):
class TestNodejsNpmEsbuildWorkflow(TestCase):
-
"""
the workflow requires an external utility (npm) to run, so it is extensively tested in integration tests.
this is just a quick wiring test to provide fast feedback if things are badly broken
diff --git a/tests/unit/workflows/python_pip/test_packager.py b/tests/unit/workflows/python_pip/test_packager.py
index cdd339811..928387ddd 100644
--- a/tests/unit/workflows/python_pip/test_packager.py
+++ b/tests/unit/workflows/python_pip/test_packager.py
@@ -91,9 +91,6 @@ def popen(self, *args, **kwargs):
class TestGetLambdaAbi(object):
- def test_get_lambda_abi_python37(self):
- assert "cp37m" == get_lambda_abi("python3.7")
-
def test_get_lambda_abi_python38(self):
assert "cp38" == get_lambda_abi("python3.8")
diff --git a/tests/unit/workflows/python_pip/test_validator.py b/tests/unit/workflows/python_pip/test_validator.py
index c0588181f..f1c9defce 100644
--- a/tests/unit/workflows/python_pip/test_validator.py
+++ b/tests/unit/workflows/python_pip/test_validator.py
@@ -17,7 +17,7 @@ def communicate(self):
class TestPythonRuntimeValidator(TestCase):
def setUp(self):
- self.validator = PythonRuntimeValidator(runtime="python3.7", architecture="x86_64")
+ self.validator = PythonRuntimeValidator(runtime="python3.12", architecture="x86_64")
def test_runtime_validate_unsupported_language_fail_open(self):
validator = PythonRuntimeValidator(runtime="python2.6", architecture="arm64")
@@ -27,7 +27,7 @@ def test_runtime_validate_unsupported_language_fail_open(self):
def test_runtime_validate_supported_version_runtime(self):
with mock.patch("subprocess.Popen") as mock_subprocess:
mock_subprocess.return_value = MockSubProcess(0)
- self.validator.validate(runtime_path="/usr/bin/python3.7")
+ self.validator.validate(runtime_path="/usr/bin/python3.12")
self.assertTrue(mock_subprocess.call_count, 1)
def test_runtime_validate_mismatch_version_runtime(self):
@@ -38,14 +38,14 @@ def test_runtime_validate_mismatch_version_runtime(self):
self.assertTrue(mock_subprocess.call_count, 1)
def test_python_command(self):
- cmd = self.validator._validate_python_cmd(runtime_path="/usr/bin/python3.7")
- version_strings = ["sys.version_info.major == 3", "sys.version_info.minor == 7"]
+ cmd = self.validator._validate_python_cmd(runtime_path="/usr/bin/python3.12")
+ version_strings = ["sys.version_info.major == 3", "sys.version_info.minor == 12"]
for version_string in version_strings:
self.assertTrue(all([part for part in cmd if version_string in part]))
@parameterized.expand(
[
- ("python3.7", "arm64"),
+ ("python3.12", "invalid_arch"),
]
)
def test_runtime_validate_with_incompatible_architecture(self, runtime, architecture):