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)
# 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.
def am_i_updated(version): version = LooseVersion(version.replace('v', '')) last_version = get_last() return last_version <= version
def am_i_updated(version): version = LooseVersion(version.replace('v', '')) last_version = get_last() return last_version <= version
# 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.