예제 #1
0
파일: setup.py 프로젝트: AbhayMK/pycbc
def generate_version_info():
    """Get VCS info and write version info to version.py
    """
    from pycbc import _version_helper

    vcs_info = _version_helper.generate_git_version_info()

    with open('pycbc/version.py', 'w') as f:
        f.write("# Generated by setup.py for PyCBC on %s.\n\n"
                % vcs_info.build_date)

        # print general info
        f.write('version = \'%s\'\n' % vcs_info.version)
        f.write('date = \'%s\'\n' % vcs_info.date)
        f.write('release = %s\n' % vcs_info.release)

        # print git info
        f.write('\ngit_hash = \'%s\'\n' % vcs_info.hash)
        f.write('git_branch = \'%s\'\n' % vcs_info.branch)
        f.write('git_tag = \'%s\'\n' % vcs_info.tag)
        f.write('git_author = \'%s\'\n' % vcs_info.author)
        f.write('git_committer = \'%s\'\n' % vcs_info.committer)
        f.write('git_status = \'%s\'\n' % vcs_info.status)
        f.write('git_builder = \'%s\'\n' % vcs_info.builder)
        f.write('git_build_date = \'%s\'\n' % vcs_info.build_date)
        f.write('git_verbose_msg = """Branch: %s\nTag: %s\nId: %s\nBuilder: %s\nBuild date: %s\nRepository status is %s"""' %(vcs_info.branch,vcs_info.tag,vcs_info.hash,vcs_info.builder,vcs_info.build_date,vcs_info.status) )
    return vcs_info.version
예제 #2
0
def get_version_info():
    """Get VCS info and write version info to version.py
    """
    from pycbc import _version_helper

    class vdummy(object):
        def __getattr__(self, attr):
            return ''

    # If this is a pycbc git repo always populate version information using GIT
    try:
        vinfo = _version_helper.generate_git_version_info()
    except:
        vinfo = vdummy()
        vinfo.version = '1.13.dev7'
        vinfo.release = 'False'

    with open('pycbc/version.py', 'w') as f:
        f.write("# coding: utf-8\n")
        f.write("# Generated by setup.py for PyCBC on %s.\n\n"
                % vinfo.build_date)

        # print general info
        f.write('version = \'%s\'\n' % vinfo.version)
        f.write('date = \'%s\'\n' % vinfo.date)
        f.write('release = %s\n' % vinfo.release)
        f.write('last_release = \'%s\'\n' % vinfo.last_release)

        # print git info
        f.write('\ngit_hash = \'%s\'\n' % vinfo.hash)
        f.write('git_branch = \'%s\'\n' % vinfo.branch)
        f.write('git_tag = \'%s\'\n' % vinfo.tag)
        f.write('git_author = \'%s\'\n' % vinfo.author)
        f.write('git_committer = \'%s\'\n' % vinfo.committer)
        f.write('git_status = \'%s\'\n' % vinfo.status)
        f.write('git_builder = \'%s\'\n' % vinfo.builder)
        f.write('git_build_date = \'%s\'\n' % vinfo.build_date)
        f.write('git_verbose_msg = """Version: %s\n'
                'Branch: %s\n'
                'Tag: %s\n'
                'Id: %s\n'
                'Builder: %s\n'
                'Build date: %s\n'
                'Repository status is %s"""\n' %(
                                               vinfo.version,
                                               vinfo.branch,
                                               vinfo.tag,
                                               vinfo.hash,
                                               vinfo.builder,
                                               vinfo.build_date,
                                               vinfo.status))
        f.write('from pycbc._version import *\n')
        version = vinfo.version

    from pycbc import version
    version = version.version
    return version
예제 #3
0
파일: setup.py 프로젝트: cmbiwer/pycbc
def get_version_info():
    """Get VCS info and write version info to version.py
    """
    from pycbc import _version_helper

    class vdummy(object):
        def __getattr__(self, attr):
            return ''

    # If this is a pycbc git repo always populate version information using GIT
    try:
        vinfo = _version_helper.generate_git_version_info()
    except:
        vinfo = vdummy()
        vinfo.version = '1.13.dev8'
        vinfo.release = 'False'

    with open('pycbc/version.py', 'w') as f:
        f.write("# coding: utf-8\n")
        f.write("# Generated by setup.py for PyCBC on %s.\n\n"
                % vinfo.build_date)

        # print general info
        f.write('version = \'%s\'\n' % vinfo.version)
        f.write('date = \'%s\'\n' % vinfo.date)
        f.write('release = %s\n' % vinfo.release)
        f.write('last_release = \'%s\'\n' % vinfo.last_release)

        # print git info
        f.write('\ngit_hash = \'%s\'\n' % vinfo.hash)
        f.write('git_branch = \'%s\'\n' % vinfo.branch)
        f.write('git_tag = \'%s\'\n' % vinfo.tag)
        f.write('git_author = \'%s\'\n' % vinfo.author)
        f.write('git_committer = \'%s\'\n' % vinfo.committer)
        f.write('git_status = \'%s\'\n' % vinfo.status)
        f.write('git_builder = \'%s\'\n' % vinfo.builder)
        f.write('git_build_date = \'%s\'\n' % vinfo.build_date)
        f.write('git_verbose_msg = """Version: %s\n'
                'Branch: %s\n'
                'Tag: %s\n'
                'Id: %s\n'
                'Builder: %s\n'
                'Build date: %s\n'
                'Repository status is %s"""\n' %(
                                               vinfo.version,
                                               vinfo.branch,
                                               vinfo.tag,
                                               vinfo.hash,
                                               vinfo.builder,
                                               vinfo.build_date,
                                               vinfo.status))
        f.write('from pycbc._version import *\n')
        version = vinfo.version

    from pycbc import version
    version = version.version
    return version
예제 #4
0
def get_version_info():
    """Get VCS info and write version info to version.py
    """
    from pycbc import _version_helper

    # If this is a pycbc git repo always populate versoin information using GIT
    try:
        vcs_info = _version_helper.generate_git_version_info()

        with open('pycbc/version.py', 'w') as f:
            f.write("# coding: utf-8\n")
            f.write("# Generated by setup.py for PyCBC on %s.\n\n"
                    % vcs_info.build_date)

            # print general info
            f.write('version = \'%s\'\n' % vcs_info.version)
            f.write('date = \'%s\'\n' % vcs_info.date)
            f.write('release = %s\n' % vcs_info.release)
            f.write('last_release = \'%s\'\n' % vcs_info.last_release)

            # print git info
            f.write('\ngit_hash = \'%s\'\n' % vcs_info.hash)
            f.write('git_branch = \'%s\'\n' % vcs_info.branch)
            f.write('git_tag = \'%s\'\n' % vcs_info.tag)
            f.write('git_author = \'%s\'\n' % vcs_info.author)
            f.write('git_committer = \'%s\'\n' % vcs_info.committer)
            f.write('git_status = \'%s\'\n' % vcs_info.status)
            f.write('git_builder = \'%s\'\n' % vcs_info.builder)
            f.write('git_build_date = \'%s\'\n' % vcs_info.build_date)
            f.write('git_verbose_msg = """Branch: %s\n'
                    'Tag: %s\n'
                    'Id: %s\n'
                    'Builder: %s\n'
                    'Build date: %s\n'
                    'Repository status is %s"""\n' %(vcs_info.branch,
                                                   vcs_info.tag,
                                                   vcs_info.hash,
                                                   vcs_info.builder,
                                                   vcs_info.build_date,
                                                   vcs_info.status))
            f.write('from pycbc._version import *\n')
            version = vcs_info.version

    # If this is a release or another kind of source distribution of PyCBC
    except:
        version = '1.9.5dev'
        release = 'False'

        date = hash = branch = tag = author = committer = status = builder = build_date = ''

        with open('pycbc/version.py', 'w') as f:
            f.write("# Generated by setup.py for PyCBC.\n\n")

            # print general infov
            f.write('version = \'%s\'\n' % version)
            f.write('date = \'%s\'\n' % date)
            f.write('release = %s\n' % release)

            # print git info
            f.write('\ngit_hash = \'%s\'\n' % hash)
            f.write('git_branch = \'%s\'\n' % branch)
            f.write('git_tag = \'%s\'\n' % tag)
            f.write('git_author = \'%s\'\n' % author)
            f.write('git_committer = \'%s\'\n' % committer)
            f.write('git_status = \'%s\'\n' % status)
            f.write('git_builder = \'%s\'\n' % builder)
            f.write('git_build_date = \'%s\'\n' % build_date)
            f.write('git_verbose_msg = """Version: %s Release: %s \n'
                    ' """\n' % (version, release))
            f.write('from pycbc._version import *\n')

    from pycbc import version
    version = version.version
    return version
예제 #5
0
def get_version_info():
    """Get VCS info and write version info to version.py
    """
    from pycbc import _version_helper

    # If this is a pycbc git repo always populate versoin information using GIT
    try:
        vcs_info = _version_helper.generate_git_version_info()

        with open('pycbc/version.py', 'w') as f:
            f.write("# coding: utf-8\n")
            f.write("# Generated by setup.py for PyCBC on %s.\n\n" %
                    vcs_info.build_date)

            # print general info
            f.write('version = \'%s\'\n' % vcs_info.version)
            f.write('date = \'%s\'\n' % vcs_info.date)
            f.write('release = %s\n' % vcs_info.release)
            f.write('last_release = \'%s\'\n' % vcs_info.last_release)

            # print git info
            f.write('\ngit_hash = \'%s\'\n' % vcs_info.hash)
            f.write('git_branch = \'%s\'\n' % vcs_info.branch)
            f.write('git_tag = \'%s\'\n' % vcs_info.tag)
            f.write('git_author = \'%s\'\n' % vcs_info.author)
            f.write('git_committer = \'%s\'\n' % vcs_info.committer)
            f.write('git_status = \'%s\'\n' % vcs_info.status)
            f.write('git_builder = \'%s\'\n' % vcs_info.builder)
            f.write('git_build_date = \'%s\'\n' % vcs_info.build_date)
            f.write('git_verbose_msg = """Branch: %s\n'
                    'Tag: %s\n'
                    'Id: %s\n'
                    'Builder: %s\n'
                    'Build date: %s\n'
                    'Repository status is %s"""\n' %
                    (vcs_info.branch, vcs_info.tag, vcs_info.hash,
                     vcs_info.builder, vcs_info.build_date, vcs_info.status))
            f.write('from pycbc._version import *\n')
            version = vcs_info.version

    # If this is a release or another kind of source distribution of PyCBC
    except:
        version = '1.9.5dev'
        release = 'False'

        date = hash = branch = tag = author = committer = status = builder = build_date = ''

        with open('pycbc/version.py', 'w') as f:
            f.write("# Generated by setup.py for PyCBC.\n\n")

            # print general infov
            f.write('version = \'%s\'\n' % version)
            f.write('date = \'%s\'\n' % date)
            f.write('release = %s\n' % release)

            # print git info
            f.write('\ngit_hash = \'%s\'\n' % hash)
            f.write('git_branch = \'%s\'\n' % branch)
            f.write('git_tag = \'%s\'\n' % tag)
            f.write('git_author = \'%s\'\n' % author)
            f.write('git_committer = \'%s\'\n' % committer)
            f.write('git_status = \'%s\'\n' % status)
            f.write('git_builder = \'%s\'\n' % builder)
            f.write('git_build_date = \'%s\'\n' % build_date)
            f.write('git_verbose_msg = """Version: %s Release: %s \n'
                    ' """\n' % (version, release))
            f.write('from pycbc._version import *\n')

    from pycbc import version
    version = version.version
    return version
예제 #6
0
def get_version_info():
    """Get VCS info and write version info to version.py
    """
    from pycbc import _version_helper

    # If this is a pycbc git repo always populate versoin information using GIT
    try:
        vcs_info = _version_helper.generate_git_version_info()

        with open("pycbc/version.py", "w") as f:
            f.write("# Generated by setup.py for PyCBC on %s.\n\n" % vcs_info.build_date)

            # print general info
            f.write("version = '%s'\n" % vcs_info.version)
            f.write("date = '%s'\n" % vcs_info.date)
            f.write("release = %s\n" % vcs_info.release)

            # print git info
            f.write("\ngit_hash = '%s'\n" % vcs_info.hash)
            f.write("git_branch = '%s'\n" % vcs_info.branch)
            f.write("git_tag = '%s'\n" % vcs_info.tag)
            f.write("git_author = '%s'\n" % vcs_info.author)
            f.write("git_committer = '%s'\n" % vcs_info.committer)
            f.write("git_status = '%s'\n" % vcs_info.status)
            f.write("git_builder = '%s'\n" % vcs_info.builder)
            f.write("git_build_date = '%s'\n" % vcs_info.build_date)
            f.write(
                'git_verbose_msg = """Branch: %s\n'
                "Tag: %s\n"
                "Id: %s\n"
                "Builder: %s\n"
                "Build date: %s\n"
                'Repository status is %s"""'
                % (vcs_info.branch, vcs_info.tag, vcs_info.hash, vcs_info.builder, vcs_info.build_date, vcs_info.status)
            )
            version = vcs_info.version

    # If this is a release or another kind of source distribution of PyCBC
    except:
        version = "1.3.1"
        release = "True"
        date = hash = branch = tag = author = committer = status = builder = build_date = ""

        with open("pycbc/version.py", "w") as f:
            f.write("# Generated by setup.py for PyCBC.\n\n")

            # print general infov
            f.write("version = '%s'\n" % version)
            f.write("date = '%s'\n" % date)
            f.write("release = %s\n" % release)

            # print git info
            f.write("\ngit_hash = '%s'\n" % hash)
            f.write("git_branch = '%s'\n" % branch)
            f.write("git_tag = '%s'\n" % tag)
            f.write("git_author = '%s'\n" % author)
            f.write("git_committer = '%s'\n" % committer)
            f.write("git_status = '%s'\n" % status)
            f.write("git_builder = '%s'\n" % builder)
            f.write("git_build_date = '%s'\n" % build_date)
            f.write('git_verbose_msg = """Version: %s Release: %s \n' ' """' % (version, release))

    from pycbc import version

    version = version.version
    return version