docs: def execute_command(self, parts, dry_run):
          """
          Execute a command.
  
          Parameters
          ----------
          parts : list
              Sequence of strings constituting a command.
          dry_run : bool
              Whether to just log the command instead of executing it.
  
          Returns
          -------
          status : int
              Status code of the executed command or 0 if `dry_run` is `True`.
          """
          if dry_run:
              self.logger.info("dry-run command '%s'", " ".join(map(str, parts)))
              return 0
          else:  # pragma: no cover
              self.logger.debug("executing command '%s'", " ".join(map(str, parts)))
              status_code = os.spawnvpe(os.P_WAIT, parts[0], parts, os.environ)
              if status_code:
                  self.logger.warning("command '%s' returned status code %d",
                                      " ".join(map(str, parts)), status_code)
              return status_code