# coding:utf-8

from distutils.version import LooseVersion


def version_gte(version, target_version):
    """版本比较：大于等于"""

    if not version or not target_version:
        return False

    return LooseVersion(version) >= LooseVersion(target_version)


def version_lte(version, target_version):
    """版本比较：小于等于"""

    if not version or not target_version:
        return False

    return LooseVersion(version) <= LooseVersion(target_version)
