manen.helpers

manen.helpers.poll(fn, args: tuple[~typing.Any, ...] | None = None, kwargs: dict[str, ~typing.Any] | None = None, timeout: float = 10, step: float = 0.5, evaluate_success: ~typing.Callable = <function <lambda>>)[source]
manen.helpers.version(version_str: str) Version[source]

Helper function to convert a version string into a tuple. The versioning scheme is described here. The input will be validated with the regular expression ^[\d]+.[\d]+.[\d]+.[\d]+$ and raised a ValueError if it doesn’t match.

Caution

This versioning system is not compliant with semantic versioning rules.

Parameters:

version_str (str) – string to be converted to a tuple

Raises:

ValueError – raised if the input doesn’t match the pattern

Returns:

parsed version

Return type:

Version

manen.helpers.version_as_str(version_tuple: Version, limit: int = 4) str[source]

Format a version tuple as a string in the format: {major}.{minor}.{build}.{patch}

Parameters:
  • version_tuple (Version) – version info as a tuple

  • limit (int, optional) – Limit on the length of the tuple to format. Defaults to 4.

Returns:

formatted version

Return type:

str