conda_recipe_manager.parser.dependency
- Description:
Provides types and utilities for managing recipe dependencies.
Functions
Constructs a DependencyData object from a dependency string in a recipe file. |
|
Given a DependencyData instance, derive the original string found in the recipe. |
|
|
Converts a dependency section enumeration to the equivalent string found in the recipe, based on the current schema. |
Converts a dependency section string to a section enumeration. |
Classes
|
Structure that contains metadata about a dependency found in the recipe. |
|
Mode of operation to use when handling duplicate dependencies (identified by name). |
|
Enumerates dependency sections found in a recipe file. |
Represents a dependency that contains a JINJA variable that is unable to be resolved by the recipe's variable table. |
- class conda_recipe_manager.parser.dependency.Dependency(required_by: str, path: str, type: DependencySection, data: DependencyData, selector: SelectorParser | None = None)[source]
Bases:
NamedTuple
Structure that contains metadata about a dependency found in the recipe. This is immutable by design.
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- data: MatchSpec | DependencyVariable
Alias for field number 3
- path: str
Alias for field number 1
- required_by: str
Alias for field number 0
- selector: SelectorParser | None
Alias for field number 4
- type: DependencySection
Alias for field number 2
- class conda_recipe_manager.parser.dependency.DependencyConflictMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
Mode of operation to use when handling duplicate dependencies (identified by name).
- EXACT_POSITION = 4
- IGNORE = 2
- REPLACE = 1
- USE_BOTH = 3
- class conda_recipe_manager.parser.dependency.DependencySection(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
Enumerates dependency sections found in a recipe file.
- BUILD = 1
- HOST = 2
- RUN = 3
- RUN_CONSTRAINTS = 4
- RUN_EXPORTS = 5
- TESTS = 6
- class conda_recipe_manager.parser.dependency.DependencyVariable(s: str)[source]
Bases:
object
Represents a dependency that contains a JINJA variable that is unable to be resolved by the recipe's variable table.
- conda_recipe_manager.parser.dependency.dependency_data_from_str(s: str) MatchSpec | DependencyVariable [source]
Constructs a DependencyData object from a dependency string in a recipe file.
- Parameters:
s -- String to process.
- Returns:
A DependencyData instance.
- conda_recipe_manager.parser.dependency.dependency_data_render_as_str(data: MatchSpec | DependencyVariable) str [source]
Given a DependencyData instance, derive the original string found in the recipe.
- Parameters:
data -- Target DependencyData
- Return s:
The original (raw) string found in the recipe file.
- conda_recipe_manager.parser.dependency.dependency_section_to_str(section: DependencySection, schema: SchemaVersion) str [source]
Converts a dependency section enumeration to the equivalent string found in the recipe, based on the current schema.
- Parameters:
section -- Target dependency section
schema -- Target recipe schema
- Returns:
String equivalent of the recipe schema
- conda_recipe_manager.parser.dependency.str_to_dependency_section(s: str) DependencySection | None [source]
Converts a dependency section string to a section enumeration.
- Parameters:
s -- Target string to convert
- Returns:
String equivalent of the recipe schema. None if the string is unrecognized.