conda_recipe_manager.commands.convert#
- Description:
CLI for converting an old recipe file to the "new" format.
Functions
|
Converts a single recipe file to the V1 format, tracking results. |
|
Helper function that performs the conversion operation for parallelizable execution. |
Classes
|
Struct that contains the results, metadata, errors, etc of converting a single recipe file. |
- class conda_recipe_manager.commands.convert.ConversionResult(code: ExitCode, content: str, file_path: Path, msg_tbl: MessageTable, project_name: str)[source]#
Bases:
object
Struct that contains the results, metadata, errors, etc of converting a single recipe file.
- set_return_code() None [source]#
Given the current state of the message table, set the appropriate return code. Does not overwrite the existing state unless errors or warnings were found.
- content: str#
- file_path: Path#
- msg_tbl: MessageTable#
- project_name: str#
- conda_recipe_manager.commands.convert.convert_file(file_path: Path, output: Path | None, print_output: bool, debug: bool, fail_on_unsupported_jinja: bool) ConversionResult [source]#
Converts a single recipe file to the V1 format, tracking results.
- Parameters:
file_path -- Path to the recipe file to convert
output -- If specified, the file contents are written to this file path. Otherwise, the file is dumped to STDOUT IF print_output is set to True.
print_output -- Prints the recipe to STDOUT/STDERR if the output file is not specified and this flag is True.
debug -- Enables debug mode output. Prints to STDERR.
fail_on_unsupported_jinja -- If set, the conversion process will exit with a failure if unsupported JINJA is encountered in the V0 recipe.
- Returns:
A struct containing the results of the conversion process, including debugging metadata.
- conda_recipe_manager.commands.convert.process_recipe(file: Path, path: Path, output: Path | None, debug: bool, fail_on_unsupported_jinja: bool) tuple[str, ConversionResult] [source]#
Helper function that performs the conversion operation for parallelizable execution.
- Parameters:
file -- Recipe file to convert
path -- Path argument provided by the user
output -- Output argument file provided by the user
debug -- Enables debug mode output. Prints to STDERR.
fail_on_unsupported_jinja -- If set, the conversion process will exit with a failure if unsupported JINJA is encountered in the V0 recipe.
- Returns:
Tuple containing the key/value pairing that tracks the result of the conversion operation