77from conda .base .context import context
88from rattler_build .progress import RichProgressCallback
99from rattler_build .render import RenderConfig
10- from rattler_build .stage0 import Stage0Recipe
10+ from rattler_build .stage0 import MultiOutputRecipe , Stage0Recipe
1111from rattler_build .tool_config import PlatformConfig , ToolConfiguration
1212from rattler_build .variant_config import VariantConfig
1313
@@ -91,8 +91,6 @@ def check_arguments_rattler(
9191def process_recipes (
9292 recipes : list [str ],
9393 variant_config : VariantConfig ,
94- render_config : RenderConfig ,
95- tool_config : ToolConfiguration ,
9694 command : str ,
9795 output_dir : str ,
9896 channels : list [str ],
@@ -101,6 +99,15 @@ def process_recipes(
10199 package_format : str ,
102100 no_include_recipe : bool ,
103101 debug : bool ,
102+ target_platform : str ,
103+ build_platform : str ,
104+ host_platform : str ,
105+ experimental : bool ,
106+ extra_context : dict [str ],
107+ test_strategy : str ,
108+ skip_existing : bool ,
109+ noarch_build_platform : str ,
110+ channel_priority : str ,
104111) -> int :
105112 import yaml
106113
@@ -118,6 +125,32 @@ def process_recipes(
118125 f"Failed to process recipe { recipe_path } : { str (e )} "
119126 )
120127
128+ if isinstance (recipe , MultiOutputRecipe ):
129+ for idx , output in enumerate (recipe .outputs , 1 ):
130+ output_dict = output .to_dict ()
131+ if "staging" in output_dict :
132+ experimental = True
133+
134+ # common tool / platform / render configuration
135+ tool_config = ToolConfiguration (
136+ test_strategy = test_strategy ,
137+ skip_existing = skip_existing ,
138+ noarch_build_platform = noarch_build_platform ,
139+ channel_priority = channel_priority ,
140+ )
141+
142+ platform_config = PlatformConfig (
143+ target_platform = target_platform ,
144+ build_platform = build_platform ,
145+ host_platform = host_platform ,
146+ experimental = experimental ,
147+ )
148+
149+ render_config = RenderConfig (
150+ platform = platform_config ,
151+ extra_context = extra_context ,
152+ )
153+
121154 # render the recipe
122155 try :
123156 rendered = recipe .render (variant_config , render_config )
@@ -127,8 +160,9 @@ def process_recipes(
127160 )
128161
129162 if command == "render" :
130- data = rendered [0 ].recipe .to_dict ()
131- print (yaml .safe_dump (data , indent = 2 , sort_keys = False ))
163+ for item in rendered :
164+ data = item .recipe .to_dict ()
165+ print (yaml .safe_dump (data , indent = 2 , sort_keys = False ))
132166 succeeded .append (recipe_path_str )
133167 continue
134168
@@ -195,6 +229,7 @@ def run_rattler(command: str, parsed_args: argparse.Namespace, config: Config) -
195229 output_dir : str = config .croot
196230 no_include_recipe : bool = False
197231 no_build_id : bool = False
232+ experimental : bool = False
198233 package_format : str | None = None
199234 debug : bool = False
200235 channels : list [str ] = []
@@ -296,33 +331,15 @@ def run_rattler(command: str, parsed_args: argparse.Namespace, config: Config) -
296331 from ..variants import find_config_files
297332
298333 # configure variant
299- for variant in config_files :
300- variant_config = VariantConfig .from_file (variant )
301-
302- # common tool / platform / render configuration
303- tool_config = ToolConfiguration (
304- test_strategy = test_strategy ,
305- skip_existing = skip_existing ,
306- noarch_build_platform = noarch_build_platform ,
307- channel_priority = channel_priority ,
308- )
309-
310- platform_config = PlatformConfig (
311- target_platform = target_platform ,
312- build_platform = build_platform ,
313- host_platform = host_platform ,
314- )
315-
316- render_config = RenderConfig (
317- platform = platform_config ,
318- extra_context = extra_context ,
319- )
320-
334+ if config_files :
335+ for variant in config_files :
336+ variant_config = VariantConfig .from_file (variant )
337+ else :
338+ variant_config = VariantConfig ()
339+
321340 return process_recipes (
322341 recipes = recipes ,
323342 variant_config = variant_config ,
324- render_config = render_config ,
325- tool_config = tool_config ,
326343 command = command ,
327344 output_dir = output_dir ,
328345 channels = channels ,
@@ -331,4 +348,13 @@ def run_rattler(command: str, parsed_args: argparse.Namespace, config: Config) -
331348 package_format = package_format ,
332349 no_include_recipe = no_include_recipe ,
333350 debug = debug ,
351+ target_platform = target_platform ,
352+ build_platform = build_platform ,
353+ host_platform = host_platform ,
354+ experimental = experimental ,
355+ extra_context = extra_context ,
356+ test_strategy = test_strategy ,
357+ skip_existing = skip_existing ,
358+ noarch_build_platform = noarch_build_platform ,
359+ channel_priority = channel_priority ,
334360 )
0 commit comments