code: 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
docs: Updates a version of the app in place. Returns an app_id, or None if the
      app has already been published.