ramble.definitions namespace

Submodules

ramble.definitions.families module

class ramble.definitions.families.Families(origin_type: str, families: List[str] | None = None)[source]

Bases: object

Class representing object family membership

add_families(families: List[str])[source]

Add new families to this object

as_str(n_indent: int = 0, **kwargs)[source]

String representation of this object’s families

Parameters:

n_indent – Number of spaces to indent string lines with

Returns:

Representation of this variable

Return type:

(str)

ramble.definitions.requirements module

class ramble.definitions.requirements.PackageManagerRequirement(command: str, validation_type: str, regex: str, package_manager: str, when: list)[source]

Bases: object

Class representing a package manager requirement for a modifier

as_str(n_indent: int = 0, verbose: bool = False)[source]

String representation of this requirement

Parameters:
  • n_indent – Number of spaces to indent string lines with

  • verbose – Print verbose output

Returns:

Representation of this requirement

Return type:

(str)

ramble.definitions.variables module

class ramble.definitions.variables.EnvironmentVariable(name: str, value=None, description: str | None = None, method: str = 'set', append_separator: str = ',', when=None, **kwargs)[source]

Bases: object

Class representing an environment variable

as_str(n_indent: int = 0, verbose: bool = False)[source]

String representation of environment variable

Parameters:

n_indent (int) – Number of spaces to indent string representation by

Returns:

String representing this environment variable

Return type:

(str)

copy()[source]
class ramble.definitions.variables.EnvironmentVariableModifications(name: str, modification: str, method: str = 'set', when: List[str] | None = None, **kwargs)[source]

Bases: object

Class representing modifications of an environment variable

add_modification(modification: str, method: str = 'set', **kwargs)[source]

Adds a modification to this environment variable

Parameters:
  • modification (str) – The value of the modification

  • method (str) – The method of the modification.

  • separator (str) – The separator to use when appending or prepending

  • when (list | None) – List of when conditions this env_var_modification should apply in

all_methods = ['set', 'unset', 'prepend', 'append']
as_str(n_indent: int = 0, verbose: bool = False)[source]

String representation of this environment variable modification

Parameters:

n_indent (int) – Number of spaces to indent string lines with

Returns:

Representation of this environment variable modification

Return type:

(str)

copy()[source]
class ramble.definitions.variables.Variable(name: str, default=None, description: str | None = None, values=None, expandable: bool = True, track_used: bool = True, when=None, **kwargs)[source]

Bases: object

Class representing a variable definition

as_str(n_indent: int = 0, verbose: bool = False)[source]

String representation of this variable

Parameters:

n_indent (int) – Number of spaces to indent string lines with

Returns:

Representation of this variable

Return type:

(str)

copy()[source]
class ramble.definitions.variables.VariableModification(name: str, modification: str, method: str = 'set', separator: str = ' ', when=None, **kwargs)[source]

Bases: object

Class representing a variable modification

as_str(n_indent: int = 0, verbose: bool = False)[source]

String representation of this variable

Parameters:

n_indent (int) – Number of spaces to indent string lines with

Returns:

Representation of this variable

Return type:

(str)

copy()[source]

ramble.definitions.versions module

class ramble.definitions.versions.ObjectVersion(version_number: str = '', version: Version | None = None, description: str = '', origin_type: str = '', preferred: bool = False, version_to_pep440: Callable[[str], str] | None = None, pep440_to_version: Callable[[str], str] | None = None)[source]

Bases: object

as_str(n_indent: int = 0, verbose: bool = False)[source]

String representation of this version

Parameters:
  • n_indent (int) – Number of spaces to indent string with

  • verbose – Print verbose

Returns:

Representation of this version

Return type:

(str)

copy()[source]

Construct a copy of self and return it

default_conversion(version_str)[source]
evaluate_conflicts(variant)[source]

Error if this version conflicts with a variant that is used

get_version()[source]

Returns the packaging.version.Version representation of this version

get_version_num()[source]

Returns the version number of this version

satisfies(variant)[source]

Determine if an experiment’s variant satisfies this version

Parameters:

variant – A version variant containing the “@” sigil

Returns:

True or False, based if the experiment’s variant satisfies

the version

Return type:

(bool)