conda_recipe_manager.commands.convert

Description:

CLI for converting an old recipe file to the "new" format.

Functions

convert_file(file_path, output, ...)

Converts a single recipe file to the V1 format, tracking results.

process_recipe(file, path, output, debug)

Helper function that performs the conversion operation for parallelizable execution.

Classes

ConversionResult(code, content, file_path, ...)

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.

code: ExitCode
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) 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.

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) 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.

Returns:

Tuple containing the key/value pairing that tracks the result of the conversion operation