def _update_version(app_name, version, app_spec, try_update=True):
    if not try_update:
        return None
    try:
        app_id = dxpy.api.app_update("app-" + app_name, version, app_spec)["id"]
        return app_id
    except dxpy.exceptions.DXAPIError as e:
        if e.name == 'InvalidState':
            print('App %s/%s has already been published' % (app_spec["name"], version), file=sys.stderr)
            return None
        raise e
Updates a version of the app in place. Returns an app_id, or None if the
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/dxpy/app_builder.py/_update_version