Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hawflau committed Feb 27, 2024
1 parent b21f46d commit ef5489d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
5 changes: 4 additions & 1 deletion samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
RUST_CARGO_LAMBDA_CONFIG,
)
from samcli.lib.runtimes.base import (
RuntimeDataMixin,
Runtime,
DeprecatedRuntime,
Family,
Expand Down Expand Up @@ -90,7 +91,9 @@ def get_selector(


def get_layer_subfolder(build_workflow: str) -> str:
subfolders_by_runtime = layer_subfolder_mapping(list(Runtime) + list(DeprecatedRuntime))
subfolders_by_runtime = layer_subfolder_mapping(
cast(List[RuntimeDataMixin], list(Runtime) + list(DeprecatedRuntime))
)
# User is responsible for creating subfolder in these workflows
subfolders_by_runtime["makefile"] = ""

Expand Down
19 changes: 1 addition & 18 deletions samcli/lib/runtimes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@
from dataclasses import dataclass, field
from enum import Enum, unique
from pathlib import Path
from typing import Dict, List, Optional, Tuple, cast, Callable

from samcli.lib.build.workflows import (
CONFIG,
PYTHON_PIP_CONFIG,
NODEJS_NPM_CONFIG,
RUBY_BUNDLER_CONFIG,
JAVA_GRADLE_CONFIG,
JAVA_KOTLIN_GRADLE_CONFIG,
JAVA_MAVEN_CONFIG,
DOTNET_CLIPACKAGE_CONFIG,
GO_MOD_CONFIG,
PROVIDED_MAKE_CONFIG,
NODEJS_NPM_ESBUILD_CONFIG,
RUST_CARGO_LAMBDA_CONFIG,
)

from typing import Dict, List, Optional, Tuple, cast

LOG = logging.getLogger(__name__)

Expand All @@ -38,7 +22,6 @@ class Architecture(Enum):
class FamilyDataMixin:
key: str
layer_subfolder: Optional[str]
workflow_config: Callable[[str, str], CONFIG]
dep_manager: List[Tuple[str, Path]] = field(default_factory=list) # (package manager, path to local init template)
build: bool = True
eb_code_binding: Optional[str] = None # possible values are "Java8", "Python36", "Go1", "TypeScript3"
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/lib/utils/test_architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def test_must_pass_for_support_runtime_architecture(self, runtime, arch, package

@parameterized.expand(
[
("java8", ARM64),
("go1.x", ARM64),
("provided", ARM64),
("java8", Architecture.ARM64.value),
("go1.x", Architecture.ARM64.value),
("provided", Architecture.ARM64.value),
]
)
def test_must_raise_for_unsupported_runtime_architecture(self, runtime, arch):
Expand Down

0 comments on commit ef5489d

Please sign in to comment.