コード例 #1
0
def compare(current, operator, reference):
    # if len(sys.argv) < 4:
    #     script_name = sys.argv[0]
    #     print 'Usage:'
    #     print '{} current-version operator reference-version'.format(script_name)
    #     print '{} v0.10.29 \'>=\' v0.10.20'.format(script_name)
    #     print '{} v0.10.29 \'<\' v0.12.00'.format(script_name)
    #     sys.exit(1)

    current = LooseVersion(current.replace('v', ''))
    reference = LooseVersion(reference.replace('v', ''))

    if operator == '>=':
        if not current >= reference:
            sys.exit(1)
    elif operator == '>':
        if not current > reference:
            sys.exit(1)
    elif operator == '<=':
        if not current <= reference:
            sys.exit(1)
    elif operator == '<':
        if not current < reference:
            sys.exit(1)
    else:
        print 'Unknown operator {}'.format(operator)
        sys.exit(1)
コード例 #2
0
ファイル: conf.py プロジェクト: mlettau/linearmodels
# General information about the project.
project = 'linearmodels'
copyright = '2017, Kevin Sheppard'
author = 'Kevin Sheppard'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
# The short X.Y version.
version = LooseVersion(linearmodels.__version__)
if '+' in version.version:
    version = linearmodels.__version__
    version = version.replace('.dirty', '')
    version = version.split('+')
    commits, tag = version[1].split('.')
    version = version[0]
    tag = ' (+' + commits + ', ' + tag + ')'
    version = version + tag
else:
    version = linearmodels.__version__

# The full version, including alpha/beta/rc tags.
release = linearmodels.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
コード例 #3
0
def am_i_updated(version):

    version = LooseVersion(version.replace('v', ''))
    last_version = get_last()

    return last_version <= version
コード例 #4
0
ファイル: check_version.py プロジェクト: simontorres/goodman
def am_i_updated(version):

    version = LooseVersion(version.replace('v', ''))
    last_version = get_last()

    return last_version <= version
コード例 #5
0
ファイル: conf.py プロジェクト: codacy-badger/linearmodels
# General information about the project.
project = "linearmodels"
copyright = "2017, Kevin Sheppard"
author = "Kevin Sheppard"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
# The short X.Y version.
version = LooseVersion(linearmodels.__version__)
if "+" in version.version:
    version = linearmodels.__version__
    version = version.replace(".dirty", "")
    version = version.split("+")
    commits, tag = version[1].split(".")
    version = version[0]
    short_tag = " (+{0})".format(commits)
    tag = " (+" + commits + ", " + tag + ")"
    short_version = version + short_tag
    version = version + tag
else:
    short_version = version = linearmodels.__version__

# The full version, including alpha/beta/rc tags.
release = linearmodels.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.