From 3fd20daa244ccb5c4082bbdd8e71ff97ccdfd41d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:17:48 +0000 Subject: [PATCH 1/2] chore(deps-dev): bump black from 23.12.1 to 24.1.1 in /requirements Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.1.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.1...24.1.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 8b9d9944..d2bc1a2f 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -13,5 +13,5 @@ pyelftools~=0.30 # Used to verify the generated Go binary architecture in integr # formatter black==22.6.0; python_version < "3.8" -black==23.12.1; python_version >= "3.8" +black==24.1.1; python_version >= "3.8" ruff==0.1.13 From 59e03c55d4f28a375a5821e63a2bd580570dbe51 Mon Sep 17 00:00:00 2001 From: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:37:19 -0800 Subject: [PATCH 2/2] format with new black version --- aws_lambda_builders/architecture.py | 1 + aws_lambda_builders/utils.py | 1 + aws_lambda_builders/workflow.py | 1 + aws_lambda_builders/workflows/custom_make/actions.py | 1 - aws_lambda_builders/workflows/custom_make/make.py | 3 +-- aws_lambda_builders/workflows/custom_make/utils.py | 1 - aws_lambda_builders/workflows/custom_make/workflow.py | 2 +- aws_lambda_builders/workflows/dotnet_clipackage/utils.py | 1 + aws_lambda_builders/workflows/dotnet_clipackage/workflow.py | 2 +- aws_lambda_builders/workflows/go_modules/builder.py | 1 + aws_lambda_builders/workflows/go_modules/workflow.py | 1 + aws_lambda_builders/workflows/java_gradle/workflow.py | 1 + aws_lambda_builders/workflows/java_maven/workflow.py | 1 + aws_lambda_builders/workflows/nodejs_npm/actions.py | 5 ----- aws_lambda_builders/workflows/nodejs_npm/exceptions.py | 1 - aws_lambda_builders/workflows/nodejs_npm/npm.py | 1 - aws_lambda_builders/workflows/nodejs_npm/utils.py | 1 - aws_lambda_builders/workflows/nodejs_npm/workflow.py | 1 - aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py | 2 +- aws_lambda_builders/workflows/nodejs_npm_esbuild/esbuild.py | 1 + .../workflows/nodejs_npm_esbuild/exceptions.py | 1 + aws_lambda_builders/workflows/nodejs_npm_esbuild/workflow.py | 1 - aws_lambda_builders/workflows/python_pip/exceptions.py | 1 + aws_lambda_builders/workflows/python_pip/workflow.py | 1 + aws_lambda_builders/workflows/ruby_bundler/actions.py | 1 - aws_lambda_builders/workflows/ruby_bundler/utils.py | 1 - aws_lambda_builders/workflows/ruby_bundler/workflow.py | 2 +- aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py | 1 + tests/unit/workflows/custom_make/test_workflow.py | 1 - tests/unit/workflows/java_gradle/test_gradlew_resolver.py | 4 ++-- tests/unit/workflows/nodejs_npm/test_workflow.py | 1 - tests/unit/workflows/nodejs_npm_esbuild/test_workflow.py | 1 - 32 files changed, 20 insertions(+), 25 deletions(-) diff --git a/aws_lambda_builders/architecture.py b/aws_lambda_builders/architecture.py index 703b6740..36a8a1ee 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 4bcd43dc..d18ccf0a 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/workflow.py b/aws_lambda_builders/workflow.py index 133ff854..ab6c5c71 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 cde42b0c..82382e9a 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 799242b0..b120ba85 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 15a7b17c..369cbb89 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 5ea85202..c4be1d5e 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 a1c0608f..cd26cddc 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 5fc986e1..9a5e5f49 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 1c13b435..02225a82 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 8c2b0e03..9e570937 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 e3e4825d..a853c53e 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 d22c2b40..656d4351 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 bb45fb1e..d73f0bd8 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 ebce8621..21aeb864 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 33b2598e..472d3df4 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 e2d5afe1..cf43a1bc 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 cd111b53..f1e9ff5b 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 fbb5cb01..49029c5f 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 2d4242bd..a56fa91d 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 56bbf1f4..5cb9cfc0 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 ae3ade1c..0783d4f3 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/exceptions.py b/aws_lambda_builders/workflows/python_pip/exceptions.py index d3591580..6a491c3c 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/workflow.py b/aws_lambda_builders/workflows/python_pip/workflow.py index 1e87c9d5..1862fd45 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/actions.py b/aws_lambda_builders/workflows/ruby_bundler/actions.py index 63d26ead..335a0afb 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 6d8b512d..113a7cae 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 0dd08242..77f3d700 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 a9db9d99..33c61ee3 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/tests/unit/workflows/custom_make/test_workflow.py b/tests/unit/workflows/custom_make/test_workflow.py index c82d2117..3ff9651d 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/java_gradle/test_gradlew_resolver.py b/tests/unit/workflows/java_gradle/test_gradlew_resolver.py index 49bde5f2..e28cb462 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 832ce53b..302c75b6 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_workflow.py b/tests/unit/workflows/nodejs_npm_esbuild/test_workflow.py index 6773c45f..4e41ca30 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