magpie.compat ============= .. py:module:: magpie.compat Classes ------- .. autoapisummary:: magpie.compat.VersionInterface magpie.compat.LooseVersion Module Contents --------------- .. py:class:: VersionInterface Bases: :py:obj:`object` .. py:property:: major :type: int :abstractmethod: .. py:property:: minor :type: int :abstractmethod: .. py:property:: patch :type: int :abstractmethod: .. py:class:: LooseVersion(version: str) Bases: :py:obj:`packaging.version.Version`, :py:obj:`VersionInterface` This class abstracts handling of a project's versions. A :class:`Version` instance is comparison aware and can be compared and sorted using the standard Python interfaces. >>> v1 = Version("1.0a5") >>> v2 = Version("1.0") >>> v1 >>> v2 >>> v1 < v2 True >>> v1 == v2 False >>> v1 > v2 False >>> v1 >= v2 False >>> v1 <= v2 True Initialize a Version object. :param version: The string representation of a version which will be parsed and normalized before use. :raises InvalidVersion: If the ``version`` does not conform to PEP 440 in any way then this exception will be raised. .. py:property:: version :type: Tuple[Union[int, str], Ellipsis] .. py:property:: patch .. py:method:: _cmp(other: Union[LooseVersion, str]) -> int