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)

print_attr_map = [('command', 'Command'), ('validation_type', 'Validation Type'), ('package_manager', 'Package Manager'), ('regex', 'Regex'), ('when', 'When')]

ramble.definitions.variables module

class ramble.definitions.variables.CommandVariable(name: str, command: str, dry_run_value: str, description: str | None = None, expandable: bool = True, track_used: bool = True, when=None, **kwargs)[source]

Bases: Variable

extract_value(workspace, app_inst)[source]
print_attr_map = [('description', 'Description'), ('command', 'Command'), ('dry_run_value', 'Dry Run Value'), ('when', 'When')]
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]
print_attr_map = [('description', 'Description'), ('value', 'Value'), ('method', 'Method'), ('separator', 'Separator'), ('when', 'When')]
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']
append: List[Dict[str, Any]]
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]
prepend: List[Dict[str, Dict[str, str]]]
set: Dict[str, str]
unset: Set[str]
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]
print_attr_map = [('description', 'Description'), ('default', 'Default'), ('values', 'Suggested Values'), ('when', 'When')]
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]
print_attr_map = [('modification', 'Modification'), ('method', 'Method'), ('separator', 'Separator'), ('when', 'When')]

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

Deprecated since version 0.6.0: This will be removed in 0.7.0. Access the .version attribute directly instead

get_version_num()[source]

Returns the version number of this version

Deprecated since version 0.6.0: This will be removed in 0.7.0. Use the .version_num property instead

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)

property version_num

Returns the version number of this version