3c22a3c1d005fc505584837727dc00074b0ab375,contrib/go/src/python/pants/contrib/go/tasks/go_fetch.py,GoFetch,execute,#GoFetch#,32

Before Change


  def execute(self):
    self.context.products.safe_create_data("go_remote_lib_src", lambda: defaultdict(str))

    with self.invalidated(self.context.targets(self.is_remote_lib)) as invalidation_check:
      for vt in invalidation_check.all_vts:
        import_id = self.global_import_id(vt.target)
        dest_dir = os.path.join(vt.results_dir, import_id)

        if not vt.valid:
          rev = vt.target.payload.get_field_value("rev")
          zip_url = vt.target.payload.get_field_value("zip_url").format(id=import_id, rev=rev)
          if not zip_url:
            raise TaskError("No zip url specified for go_remote_library {id}"
                            .format(id=import_id))
          self._download_zip(zip_url, dest_dir)

        self.context.products.get_data("go_remote_lib_src")[vt.target] = dest_dir

  def _download_zip(self, zip_url, dest_dir):
    Downloads a zip file at the given URL into the given directory.

    :param str zip_url: Full URL pointing to zip file.

After Change


  def execute(self):
    self.context.products.safe_create_data("go_remote_lib_src", lambda: defaultdict(str))
    undeclared_deps = self._transitive_download_remote_libs(self.context.targets(self.is_remote_lib))
    if undeclared_deps:
      self._log_undeclared_deps(undeclared_deps)
      raise TaskError("Failed to resolve transitive Go remote dependencies.")

  def _log_undeclared_deps(self, undeclared_deps):
    for import_id, deps in undeclared_deps.items():
      self.context.log.error("{import_id} has remote dependencies which require local declaration:"
                             .format(import_id=import_id))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pantsbuild/pants
Commit Name: 3c22a3c1d005fc505584837727dc00074b0ab375
Time: 2015-08-13
Author: codyhgibb@gmail.com
File Name: contrib/go/src/python/pants/contrib/go/tasks/go_fetch.py
Class Name: GoFetch
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: 02601118f6edf725e64e2471def69e0114ae3845
Time: 2015-02-02
Author: mateorod9@gmail.com
File Name: src/python/pants/backend/android/tasks/aapt_builder.py
Class Name: AaptBuilder
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: 6d8625611ff936bab56d15a2b36e0aba7e54612e
Time: 2017-03-30
Author: benjyw@gmail.com
File Name: src/python/pants/backend/python/tasks2/pytest_run.py
Class Name: PytestRun
Method Name: _do_run_tests