conda_recipe_manager.parser.selector_parser

Description:

Custom parser for selector recipe selector syntax. This parser does not evaluate Python code directly, and should therefore not be affected by the execution vulnerability in the V0 recipe format.

Classes

SelectorParser(content, schema_version)

Parses a selector statement

class conda_recipe_manager.parser.selector_parser.SelectorParser(content: str, schema_version: SchemaVersion)[source]

Bases: IsModifiable

Parses a selector statement

does_selector_apply(query: SelectorQuery) bool[source]

Determines if this selector applies to the current target environment.

Parameters:

query -- Target environment constraints.

Returns:

True if the selector applies to the current situation. False otherwise.

get_selected_platforms() set[Platform][source]

Returns the set of platforms selected by this selector

Returns:

Set of platforms selected for by the target selector.

is_modified() bool

Indicates if the object has been modified.

Returns:

True if the object instance has been modified. False otherwise.

render() str[source]

Renders the selector as it would appear in a recipe file.

Returns:

The rendered equivalent selector.