(ctx, version)
Release a new version

    Running this task will:
     - Prompt the user for a changelog and write it to
       the release notes
     - Commit the release notes
     - Bump the version number
     - Push a release to pypi and npm
Release a new version
Release a new version
def release(ctx, version):
    '''
    Release a new version

    Running this task will:
     - Prompt the user for a changelog and write it to
       the release notes
     - Commit the release notes
     - Bump the version number
     - Push a release to pypi and npm
    '''
    release_notes_lines = get_release_notes(version)

    if release_notes_lines is None:
        print('No release notes: exiting')
        exit()

    update_release_notes(version, release_notes_lines)
    with open('changelog.tmp', 'w') as f:
        f.writelines(release_notes_lines)

    run('git add docs/source/release_notes.rst')
    run('git commit -m "Add release notes for version {}"'.format(version))
    set_pyversion(version)
    set_jsversion(version)
    release_python_sdist()
    os.chdir(os.path.join(GMAPS_DIR, 'js'))
    try:
        run('npm publish')
    finally:
        os.chdir(GMAPS_DIR)
def release ( ctx , version ) : release_notes_lines = get_release_notes ( version ) if release_notes_lines is None : print ( 'No release notes: exiting' ) exit ( ) update_release_notes ( version , release_notes_lines ) with open ( 'changelog.tmp' , 'w' ) as f : f . writelines ( release_notes_lines ) run ( 'git add docs/source/release_notes.rst' ) run ( 'git commit -m "Add release notes for version {}"' . format ( version ) ) set_pyversion ( version ) set_jsversion ( version ) release_python_sdist ( ) os . chdir ( os . path . join ( GMAPS_DIR , 'js' ) ) try : run ( 'npm publish' ) finally : os . chdir ( GMAPS_DIR )