Example #1
0
def tagged_version_is_head(path):
    cmd = subprocess.Popen("git tag --contains HEAD",
                           shell=True,
                           cwd=path,
                           stdin=subprocess.PIPE,
                           stdout=subprocess.PIPE)
    stdout, stderr = cmd.communicate()
    tags = stdout.strip().split('\n')
    version = bv.pkg_version(path)
    return version in tags
Example #2
0
def tagged_version_is_head(path):
    cmd = subprocess.Popen("git tag --contains HEAD",
                           shell=True,
                           cwd=path,
                           stdin=subprocess.PIPE,
                           stdout=subprocess.PIPE)
    stdout, stderr = cmd.communicate()
    tags = stdout.strip().split('\n')
    version = bv.pkg_version(path)
    return version in tags
Example #3
0
def buildtool_cook(final=True, noact=False, skipchecks=False, force=False):
    if not skipchecks and not is_all_clean():
        print("Buildout is not clean, aborting!\n"
              "================================\n")
        return buildtool_status()

    # commit, and tag egg versions
    for (pkg, path) in devel_eggs().items():
        if should_cook(path, final, force):
            new_version = bv.bump_pkg(path, final, noact)
            git_commit(path, new_version, noact)
            git_tag(path, new_version, noact)
        else:
            # already released, unchanged
            print('%s: == %s' % (path, bv.pkg_version(path)))
Example #4
0
def buildtool_cook(final=True, noact=False, skipchecks=False, force=False):
    if not skipchecks and not is_all_clean():
        print(
            "Buildout is not clean, aborting!\n"
            "================================\n")
        return buildtool_status()

    # commit, and tag egg versions
    for (pkg, path) in devel_eggs().items():
        if should_cook(path, final, force):
            new_version = bv.bump_pkg(path, final, noact)
            git_commit(path, new_version, noact)
            git_tag(path, new_version, noact)
        else:
            # already released, unchanged
            print('%s: == %s' % (path, bv.pkg_version(path)))
Example #5
0
def buildtool_dist(versionsfile,
                   distlocation,
                   buildname=None,
                   final=True,
                   noact=False,
                   skipchecks=False,
                   force=False):
    assert versionsfile
    assert distlocation
    if not buildname:
        buildname = BASEDIR.split('/')[-1]

    if not skipchecks and not is_all_clean():
        print("Buildout is not clean, aborting!\n"
              "================================\n")
        return buildtool_status()

    vp = VersionParser(versionsfile)

    # release changed eggs
    changed = []
    for (pkg, path) in devel_eggs().items():
        print("\n--- %s ---" % pkg)
        oldversion = vp.get_version(pkg)
        newversion = bv.pkg_version(path)
        if oldversion == newversion and not force:
            print("%s: == %s" % (pkg, oldversion))
        else:
            changed.append(pkg)
            print("%s: %s -> %s" % (pkg, oldversion, newversion))
            vp.set_version(pkg, newversion)
            mkrelease(path, distlocation, noact)

    # force rc->final release even if *nothing* changed
    if final and not version_is_final(BASEDIR):
        changed.append(buildname)

    if not force and not changed and tagged_version_is_head(BASEDIR):
        print("Nothing changed, nothing to release. Aborting.")
        return

    print("\n====== %s ======" % buildname)
    # buildout version. requires a setup.py
    buildout_version = bv.bump_pkg(BASEDIR, final, noact)
    # release tag is identical across repos: build.name=0.4rc3
    release_tag = "%s=%s" % (buildname, buildout_version),

    # release, and tag buildout version on all eggs
    for (pkg, path) in devel_eggs().items():

        # this adds the buildout version tag to all eggs
        git_tag(path, release_tag, noact)
        git_push(path, noact)

    if not noact:
        vp.write()

    vp.set_version(buildname, buildout_version)
    git_commit(BASEDIR, buildout_version, noact)
    # version tag to match setup.py version
    git_tag(BASEDIR, buildout_version, noact)
    # release tag to match egg release tags
    git_tag(BASEDIR, release_tag, noact)
    mkrelease(BASEDIR, distlocation, noact)
    git_push(BASEDIR, noact)
Example #6
0
def version_is_final(path):
    version = bv.pkg_version(path)
    return 'rc' not in version and 'dev' not in version
Example #7
0
def version_is_final(path):
    version = bv.pkg_version(path)
    return 'rc' not in version and 'dev' not in version
Example #8
0
def buildtool_dist(versionsfile,
                   distlocation,
                   buildname=None,
                   final=True,
                   noact=False,
                   skipchecks=False,
                   force=False):
    assert versionsfile
    assert distlocation
    if not buildname:
        buildname = BASEDIR.split('/')[-1]

    if not skipchecks and not is_all_clean():
        print(
            "Buildout is not clean, aborting!\n"
            "================================\n")
        return buildtool_status()

    vp = VersionParser(versionsfile)

    # release changed eggs
    changed = []
    for (pkg, path) in devel_eggs().items():
        print("\n--- %s ---" % pkg)
        oldversion = vp.get_version(pkg)
        newversion = bv.pkg_version(path)
        if oldversion == newversion and not force:
            print("%s: == %s" % (pkg, oldversion))
        else:
            changed.append(pkg)
            print("%s: %s -> %s" % (pkg, oldversion, newversion))
            vp.set_version(pkg, newversion)
            mkrelease(path, distlocation, noact)

    # force rc->final release even if *nothing* changed
    if final and not version_is_final(BASEDIR):
        changed.append(buildname)

    if not force and not changed and tagged_version_is_head(BASEDIR):
        print("Nothing changed, nothing to release. Aborting.")
        return

    print("\n====== %s ======" % buildname)
    # buildout version. requires a setup.py
    buildout_version = bv.bump_pkg(BASEDIR, final, noact)
    # release tag is identical across repos: build.name=0.4rc3
    release_tag = "%s=%s" % (buildname, buildout_version),

    # release, and tag buildout version on all eggs
    for (pkg, path) in devel_eggs().items():

        # this adds the buildout version tag to all eggs
        git_tag(path, release_tag, noact)
        git_push(path, noact)

    if not noact:
        vp.write()

    vp.set_version(buildname, buildout_version)
    git_commit(BASEDIR, buildout_version, noact)
    # version tag to match setup.py version
    git_tag(BASEDIR, buildout_version, noact)
    # release tag to match egg release tags
    git_tag(BASEDIR, release_tag, noact)
    mkrelease(BASEDIR, distlocation, noact)
    git_push(BASEDIR, noact)