mlrl.util.version module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides utilities for dealing with version numbers.

class mlrl.util.version.Version(numbers: tuple[int, ...])

Bases: object

Represents a version.

Attributes:

numbers: The version numbers

numbers: tuple[int, ...]
static parse(version: str, skip_on_error: bool = False) Version

Parses and returns a version from a given string.

Parameters:
  • version – The string to be parsed

  • skip_on_error – True, if all remaining version numbers should be skipped if one of them could not be parsed, False if an error should be raised

Returns:

The version that has been parsed

static parse_version_number(version_number: str) int

Parses and returns a single version number from a given string.

Parameters:

version_number – The string to be parsed

Returns:

The version number that has been parsed