@@ -281,7 +281,7 @@ def run(self) -> None:
281281 )
282282
283283 self ._check_exclude_warning ()
284- self ._check_rust_cargo_experimental_flag ()
284+ self ._check_build_method_experimental_flag ()
285285
286286 for f in self .get_resources_to_build ().functions :
287287 EventTracker .track_event (EventName .BUILD_FUNCTION_RUNTIME .value , f .runtime )
@@ -696,24 +696,26 @@ def _check_exclude_warning(self) -> None:
696696 if self ._resource_identifier in excludes :
697697 LOG .warning (self ._EXCLUDE_WARNING_MESSAGE )
698698
699- def _check_rust_cargo_experimental_flag (self ) -> None :
699+ def _check_build_method_experimental_flag (self ) -> None :
700700 """
701701 Prints warning message and confirms if user wants to use beta feature
702702 """
703- WARNING_MESSAGE = (
704- 'Build method "rust-cargolambda" is a beta feature. \n '
705- "Please confirm if you would like to proceed \n "
706- 'You can also enable this beta feature with "sam build --beta-features".'
707- )
703+ EXPERIMENTAL_BUILD_METHODS = {
704+ "rust-cargolambda" : ExperimentalFlag . RustCargoLambda ,
705+ "python-uv" : ExperimentalFlag . UvPackageManager ,
706+ }
707+
708708 resources_to_build = self .get_resources_to_build ()
709- is_building_rust = False
710709 for function in resources_to_build .functions :
711- if function .metadata and function .metadata .get ("BuildMethod" , "" ) == "rust-cargolambda" :
712- is_building_rust = True
713- break
710+ if function .metadata and function .metadata .get ("BuildMethod" , "" ) in EXPERIMENTAL_BUILD_METHODS :
711+ build_method = function .metadata .get ("BuildMethod" , "" )
712+ WARNING_MESSAGE = (
713+ f'Build method "{ build_method } " is a beta feature.\n '
714+ "Please confirm if you would like to proceed\n "
715+ 'You can also enable this beta feature with "sam build --beta-features".'
716+ )
714717
715- if is_building_rust :
716- prompt_experimental (ExperimentalFlag .RustCargoLambda , WARNING_MESSAGE )
718+ prompt_experimental (EXPERIMENTAL_BUILD_METHODS [build_method ], WARNING_MESSAGE )
717719
718720 @property
719721 def build_in_source (self ) -> Optional [bool ]:
0 commit comments