Exemple #1
0
def release(yes=False):
    """
    Builds package and uploads to Anaconda.org
    We only allow releases from the production branch
    """
    _assert_release_ok()

    version = pkg_conf.get_version()

    _print("You are about to build and upload version {}, build {} of package {} to user {}".format(
        version, pkg_conf.get_build_number(), pkg_conf.PKG_NAME, pkg_conf.ANACONDA_USER))
    if yes or _confirm(prompt="Do you want to continue?"):
        cmd = "conda build conda-recipe --output"
        pkg_path = run(cmd, pty=on_linux, hide='stdout').stdout.strip()
        _print(pkg_path)

        cmd = "deactivate && conda build conda-recipe --no-anaconda-upload --quiet"
        if on_linux:
            cmd = "source " + cmd
        run(cmd, pty=on_linux)

        if os.path.exists(pkg_path):
            try:
                run("anaconda upload {} --user {}".format(pkg_path, pkg_conf.ANACONDA_USER))
                _tag_revision("v{}".format(version))
                return True
            except:
                traceback.print_exc()
                _print("Upload failed.")

        _print("Release failed.")
        return False
Exemple #2
0
def release(yes=False):
    """
    Builds package and uploads to Anaconda.org
    We only allow releases from the production branch
    """
    _assert_version_ok_git()

    version = pkg_conf.get_version()

    _print(
        "You are about to build and upload version {}, build {} of package {} to user {}"
        .format(version, pkg_conf.get_build_number(), pkg_conf.PKG_NAME,
                pkg_conf.ANACONDA_USER))
    if yes or _confirm(prompt="Do you want to continue?"):
        cmd = "conda build conda-recipe --output"
        pkg_path = run(cmd, pty=on_linux, hide='stdout').stdout.strip()
        _print(pkg_path)

        cmd = "deactivate && conda build conda-recipe --no-anaconda-upload --quiet"
        if on_linux:
            cmd = "source " + cmd
        run(cmd, pty=on_linux)

        if os.path.exists(pkg_path):
            try:
                run("anaconda upload {} --user {}".format(
                    pkg_path, pkg_conf.ANACONDA_USER))
                _tag_git_revision("v{}".format(version))
                return True
            except:
                traceback.print_exc()
                _print("Upload failed.")

        _print("Release failed.")
        return False
Exemple #3
0
def update_version(major=False,
                   minor=False,
                   patch=False,
                   rc=False,
                   release=False):
    """
    Bump the version of the package
    """
    _assert_version_ok_git()

    current_version = pkg_conf.get_version()
    current_build_number = pkg_conf.get_build_number()
    _print("Current version {}".format(current_version))
    _print("Current build number {}".format(current_build_number))

    # We strip out .dev if present, so we can parse the version number itself
    major_number, minor_number, patch_number = current_version.replace(
        "dev", "").split(".")
    build_number = current_build_number

    if major:
        major_number = int(major_number) + 1
        minor_number = 0
        patch_number = 0
        build_number = 0
    elif minor:
        minor_number = int(minor_number) + 1
        patch_number = 0
        build_number = 0
    elif patch:
        patch_number = int(patch_number) + 1
        build_number = 0
    else:
        build_number += 1

    # By default we add dev to ours builds unless its a release
    label = "dev"
    if rc:
        label = "rc"
    elif release:
        label = ""

    version_number = "{}.{}.{}{}".format(major_number, minor_number, label,
                                         patch_number)

    # actually write to the recipe and package
    _update_version(version_number, build_number)

    # the version numbers in the package and recipe have been updated, so commit those changes first
    run('hg commit -m "Bumped version to {}_{}."'.format(
        version_number, build_number))
Exemple #4
0
def update_version(major=False, minor=False, patch=False, rc=False, release=False):
    """
    Bump the version of the package
    """
    _assert_version_ok()

    current_version = pkg_conf.get_version()
    current_build_number = pkg_conf.get_build_number()
    _print("Current version {}".format(current_version))
    _print("Current build number {}".format(current_build_number))

    # We strip out .dev if present, so we can parse the version number itself
    major_number, minor_number, patch_number = current_version.replace("dev", "").replace("rc", "").split(".")
    build_number = current_build_number

    if major:
        major_number = int(major_number) + 1
        minor_number = 0
        patch_number = 0
        build_number = 0
    elif minor:
        minor_number = int(minor_number) + 1
        patch_number = 0
        build_number = 0
    elif patch:
        patch_number = int(patch_number) + 1
        build_number = 0
    else:
        build_number += 1

    # By default we add dev to ours builds unless its a release
    label = "dev"
    if rc:
        label = "rc"
    elif release:
        label = ""

    version_number = "{}.{}.{}{}".format(major_number, minor_number, label, patch_number)

    # actually write to the recipe and package
    _update_version(version_number, build_number)

    # the version numbers in the package and recipe have been updated, so commit those changes first
    run('hg commit -m "Bumped version to {}_{}."'.format(version_number, build_number))
Exemple #5
0
def release(yes=False, token=None):
    """
    Builds package and uploads to Anaconda.org
    We only allow releases from the production branch
    """
    _assert_release_ok()

    # if token is None:
    #     token = os.environ['BINSTAR_TOKEN']

    version = pkg_conf.get_version()

    _print(
        "You are about to build and upload version {}, build {} of package {} to user {}"
        .format(version, pkg_conf.get_build_number(), pkg_conf.PKG_NAME,
                run('anaconda whoami').stdout))
    if yes or _confirm(prompt="Do you want to continue?"):

        try:
            pkg_path = run("deactivate && conda build conda-recipe --output",
                           hide='stdout').stdout.strip().split()[-1]
            # run("deactivate && conda build conda-recipe --no-anaconda-upload --quiet")
            print(pkg_path)
            build()
            run("anaconda upload {}".format(pkg_path))
        except:
            traceback.print_exc()
            _print("anaconda upload failed.")
            return False

        try:
            run("python setup.py sdist upload")
        except:
            traceback.print_exc()
            _print("pypi upload failed.")
            return False

        _tag_git_revision("v{}".format(version))
        return True
def release(yes=False, token=None):
    """
    Builds package and uploads to Anaconda.org
    We only allow releases from the production branch
    """
    _assert_release_ok()

    # if token is None:
    #     token = os.environ['BINSTAR_TOKEN']

    version = pkg_conf.get_version()

    _print("You are about to build and upload version {}, build {} of package {} to user {}".format(
            version, pkg_conf.get_build_number(), pkg_conf.PKG_NAME, run('anaconda whoami').stdout))
    if yes or _confirm(prompt="Do you want to continue?"):

        # convert github .md file to pypi .rst file
        pkg_conf.convert_readme()

        try:
            pkg_path = run("deactivate && conda build conda-recipe --output", hide='stdout').stdout.strip().split()[-1]
            # run("deactivate && conda build conda-recipe --no-anaconda-upload --quiet")
            print (pkg_path)
            build()
            run("anaconda upload {}".format(pkg_path))
        except:
            traceback.print_exc()
            _print("anaconda upload failed.")
            return False

        try:
            run("python setup.py sdist upload")
        except:
            traceback.print_exc()
            _print("pypi upload failed.")
            return False

        _tag_git_revision("v{}".format(version))
        return True