Skip to content

Commit fdc2f07

Browse files
committed
chore misc formatting
1 parent 496b9e8 commit fdc2f07

3 files changed

Lines changed: 12 additions & 43 deletions

File tree

samcli/commands/build/build_context.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,18 @@ def _check_build_method_experimental_flag(self) -> None:
700700
"""
701701
Prints warning message and confirms if user wants to use beta feature
702702
"""
703-
EXPERIMENTAL_BUILD_METHODS = { "rust-cargolambda": ExperimentalFlag.RustCargoLambda, "python-uv": ExperimentalFlag.UvPackageManager }
703+
EXPERIMENTAL_BUILD_METHODS = {
704+
"rust-cargolambda": ExperimentalFlag.RustCargoLambda,
705+
"python-uv": ExperimentalFlag.UvPackageManager,
706+
}
704707

705708
resources_to_build = self.get_resources_to_build()
706709
for function in resources_to_build.functions:
707710
if function.metadata and function.metadata.get("BuildMethod", "") in EXPERIMENTAL_BUILD_METHODS:
708711
build_method = function.metadata.get("BuildMethod", "")
709712
WARNING_MESSAGE = (
710713
f'Build method "{build_method}" is a beta feature.\n'
711-
'Please confirm if you would like to proceed\n'
714+
"Please confirm if you would like to proceed\n"
712715
'You can also enable this beta feature with "sam build --beta-features".'
713716
)
714717

samcli/lib/build/workflow_config.py

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os
77
from typing import Dict, List, Optional, Union, cast
88

9-
from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled
109
from samcli.lib.build.workflows import (
1110
CONFIG,
1211
DOTNET_CLIPACKAGE_CONFIG,
@@ -161,13 +160,13 @@ def get_workflow_config(
161160
}
162161

163162
selectors_by_runtime = {
164-
"python3.8": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
165-
"python3.9": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
166-
"python3.10": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
167-
"python3.11": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
168-
"python3.12": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
169-
"python3.13": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
170-
"python3.14": BasicWorkflowSelector([PYTHON_PIP_CONFIG]),
163+
"python3.8": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
164+
"python3.9": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
165+
"python3.10": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
166+
"python3.11": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
167+
"python3.12": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
168+
"python3.13": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
169+
"python3.14": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
171170
"nodejs16.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
172171
"nodejs18.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
173172
"nodejs20.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
@@ -338,17 +337,3 @@ def get_config(self, code_dir: str, project_dir: str) -> CONFIG:
338337
@staticmethod
339338
def _has_manifest(config: CONFIG, directory: str) -> bool:
340339
return os.path.exists(os.path.join(directory, config.manifest_name))
341-
342-
343-
class ConditionalWorkflowSelector(BasicWorkflowSelector):
344-
"""
345-
Selects between two workflow configs based on a condition
346-
"""
347-
348-
def __init__(self, default: CONFIG, alternative: CONFIG, use_alternative: bool = False):
349-
self.default = default
350-
self.alternative = alternative
351-
self.use_alternative = use_alternative
352-
353-
def get_config(self, code_dir: str, project_dir: str) -> CONFIG:
354-
return self.alternative if self.use_alternative else self.default

tests/integration/buildcmd/test_build_cmd_python.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -622,22 +622,3 @@ def test_unsupported_runtime(self):
622622
self.assertEqual(1, process_execute.process.returncode)
623623

624624
self.assertIn("Build Failed", str(process_execute.stdout))
625-
626-
627-
class TestBuildCommand_PythonUv(BuildIntegBase):
628-
def test_build_python_with_uv_experimental_flag(self):
629-
# Set experimental flag
630-
os.environ["SAM_CLI_BETA_UV_PACKAGE_MANAGER"] = "true"
631-
632-
try:
633-
overrides = {"Runtime": "python3.11", "CodeUri": "Python"}
634-
cmdlist = self.get_command_list(parameter_overrides=overrides)
635-
636-
command_result = run_command(cmdlist, cwd=self.working_dir)
637-
638-
# Verify build succeeded
639-
self.assertEqual(command_result.process.returncode, 0)
640-
641-
finally:
642-
# Clean up environment
643-
os.environ.pop("SAM_CLI_BETA_UV_PACKAGE_MANAGER", None)

0 commit comments

Comments
 (0)