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 ] = []
@@ -206,6 +241,7 @@ def run_rattler(command: str, parsed_args: argparse.Namespace, config: Config) -
206241 noarch_build_platform : str = config .variant .get (
207242 "noarch_build_platform" , config .subdir
208243 )
244+ variant_config : VariantConfig = VariantConfig ()
209245
210246 # TODO: investigate why is config.channel_urls
211247 # does not pick up condarc settings, need to use context.channels
@@ -296,33 +332,13 @@ def run_rattler(command: str, parsed_args: argparse.Namespace, config: Config) -
296332 from ..variants import find_config_files
297333
298334 # 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- )
335+ if config_files :
336+ for variant in config_files :
337+ variant_config = VariantConfig .from_file (variant )
320338
321339 return process_recipes (
322340 recipes = recipes ,
323341 variant_config = variant_config ,
324- render_config = render_config ,
325- tool_config = tool_config ,
326342 command = command ,
327343 output_dir = output_dir ,
328344 channels = channels ,
@@ -331,4 +347,13 @@ def run_rattler(command: str, parsed_args: argparse.Namespace, config: Config) -
331347 package_format = package_format ,
332348 no_include_recipe = no_include_recipe ,
333349 debug = debug ,
350+ target_platform = target_platform ,
351+ build_platform = build_platform ,
352+ host_platform = host_platform ,
353+ experimental = experimental ,
354+ extra_context = extra_context ,
355+ test_strategy = test_strategy ,
356+ skip_existing = skip_existing ,
357+ noarch_build_platform = noarch_build_platform ,
358+ channel_priority = channel_priority ,
334359 )
0 commit comments