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
def _assert_release_ok(): _assert_version_ok() current_version = pkg_conf.get_version() if 'dev' in current_version: _exit("dev version detected, release cancelled")
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
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))
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))
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
from setuptools import find_packages from distutils.core import setup import pkg_conf setup( keywords = "numpy group_by set-operations indexing", name=pkg_conf.PKG_NAME, version=pkg_conf.get_version(), packages=find_packages(), install_requires=['pyyaml', 'future'], description=pkg_conf.get_recipe_meta()['about']['summary'], long_description=pkg_conf.get_readme_rst(), author=pkg_conf.AUTHOR, author_email=pkg_conf.AUTHOR_EMAIL, url=pkg_conf.get_recipe_meta()['about']['home'], license=pkg_conf.get_recipe_meta()['about']['license'], platforms='any', classifiers=[ "Development Status :: 4 - Beta", 'Intended Audience :: Science/Research', 'Intended Audience :: Developers', "Topic :: Utilities", 'Topic :: Scientific/Engineering', 'License :: {}'.format(pkg_conf.get_recipe_meta()['about']['license']), 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7',
from setuptools import find_packages from distutils.core import setup import pkg_conf setup( keywords="numpy group_by set-operations indexing", name=pkg_conf.PKG_NAME, version=pkg_conf.get_version(), packages=find_packages(), install_requires=['pyyaml', 'future'], description=pkg_conf.get_recipe_meta()['about']['summary'], long_description=pkg_conf.get_readme_rst(), author=pkg_conf.AUTHOR, author_email=pkg_conf.AUTHOR_EMAIL, url=pkg_conf.get_recipe_meta()['about']['home'], license=pkg_conf.get_recipe_meta()['about']['license'], platforms='any', classifiers=[ "Development Status :: 4 - Beta", 'Intended Audience :: Science/Research', 'Intended Audience :: Developers', "Topic :: Utilities", 'Topic :: Scientific/Engineering', 'License :: {}'.format(pkg_conf.get_recipe_meta()['about']['license']), 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5',