docs: def build_binary_dist_helper(self, requirement, setup_command):
          """
          Convert an unpacked source distribution to a binary distribution.
  
          :param requirement: A :class:`.Requirement` object.
          :param setup_command: A list of strings with the arguments to
                                ``setup.py``.
          :returns: The pathname of the resulting binary distribution (a string).
          :raises: :exc:`.BuildFailed` when the build reports an error (e.g.
                   because of missing binary dependencies like system
                   libraries).
          :raises: :exc:`.NoBuildOutput` when the build does not produce the
                   expected binary distribution archive.
          """
          build_timer = Timer()
          # Make sure the source distribution contains a setup script.
          setup_script = os.path.join(requirement.source_directory, 'setup.py')
          if not os.path.isfile(setup_script):
              msg = "Directory %s (%s %s) doesn't contain a source distribution!"
              raise InvalidSourceDistribution(msg % (requirement.source_directory, requirement.name, requirement.version))
          # Let the user know what's going on.
          build_text = "Building %s binary distribution" % requirement
          logger.info("%s ..", build_text)
          # Cleanup previously generated distributions.
          dist_directory = os.path.join(requirement.source_directory, 'dist')
          if os.path.isdir(dist_directory):
              logger.debug("Cleaning up previously generated distributions in %s ..", dist_directory)
              shutil.rmtree(dist_directory)
          # Let the user know (approximately) which command is being executed
          # (I don't think it's necessary to show them the nasty details :-).
          logger.debug("Executing external command: %s",
                       ' '.join(map(pipes.quote, [self.config.python_executable, 'setup.py'] + setup_command)))
          # Compose the command line needed to build the binary distribution.
          # This nasty command line forces the use of setuptools (instead of
          # distutils) just like pip does. This will cause the `*.egg-info'
          # metadata to be written to a directory instead of a file, which
          # (amongst other things) enables tracking of installed files.
          command_line = [
              self.config.python_executable, '-c',
              ';'.join([
                  'import setuptools',
                  '__file__=%r' % setup_script,
                  r"exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))",
              ])
          ] + setup_command
          # Redirect all output of the build to a temporary file.
          fd, temporary_file = tempfile.mkstemp()
          try:
              # Start the build.
              build = subprocess.Popen(command_line, cwd=requirement.source_directory, stdout=fd, stderr=fd)
              # Wait for the build to finish and provide feedback to the user in the mean time.
              spinner = Spinner(label=build_text, timer=build_timer)
              while build.poll() is None:
                  spinner.step()
                  # Don't tax the CPU too much.
                  time.sleep(0.2)
              spinner.clear()
              # Make sure the build succeeded and produced a binary distribution archive.
              try:
                  # If the build reported an error we'll try to provide the user with
                  # some hints about what went wrong.
                  if build.returncode != 0:
                      raise BuildFailed("Failed to build {name} ({version}) binary distribution!",
                                        name=requirement.name, version=requirement.version)
                  # Check if the build created the `dist' directory (the os.listdir()
                  # call below will raise an exception if we don't check for this).
                  if not os.path.isdir(dist_directory):
                      raise NoBuildOutput("Build of {name} ({version}) did not produce a binary distribution archive!",
                                          name=requirement.name, version=requirement.version)
                  # Check if we can find the binary distribution archive.
                  filenames = os.listdir(dist_directory)
                  if len(filenames) != 1:
                      variables = dict(name=requirement.name,
                                       version=requirement.version,
                                       filenames=concatenate(sorted(filenames)))
                      raise NoBuildOutput("""
                          Build of {name} ({version}) produced more than one
                          distribution archive! (matches: {filenames})
                      """, **variables)
              except Exception as e:
                  # Decorate the exception with the output of the failed build.
                  with open(temporary_file) as handle:
                      build_output = handle.read()
                  enhanced_message = compact("""
                      {message}
  
                      Please check the build output because it will probably
                      provide a hint about what went wrong.
  
                      Build output:
  
                      {output}
                  """, message=e.args[0], output=build_output.strip())
                  e.args = (enhanced_message,)
                  raise
              logger.info("Finished building %s in %s.", requirement.name, build_timer)
              return os.path.join(dist_directory, filenames[0])
          finally:
              # Close file descriptor before removing the temporary file.
              # Without closing Windows is complaining that the file cannot
              # be removed because it is used by another process.
              os.close(fd)
              os.unlink(temporary_file)