private @NotNull PyTargetEnvironmentPackageManager.ProcessOutputWithCommandLine getPythonProcessOutput(@NotNull PythonExecution pythonExecution,
                                                                                                         boolean askForSudo,
                                                                                                         boolean showProgress,
                                                                                                         @NotNull TargetEnvironmentRequest targetEnvironmentRequest)
    throws ExecutionException {
    // TODO [targets] Use `showProgress = true`
    // TODO [targets] Use `workingDir`
    // TODO [targets] Use `useUserSite` (handle use sudo)
    TargetProgressIndicator targetProgressIndicator = TargetProgressIndicator.EMPTY;
    TargetEnvironment targetEnvironment = targetEnvironmentRequest.prepareEnvironment(targetProgressIndicator);
    for (Map.Entry<TargetEnvironment.UploadRoot, TargetEnvironment.UploadableVolume> entry : targetEnvironment.getUploadVolumes()
      .entrySet()) {
      try {
        entry.getValue().upload(".", TargetProgressIndicator.EMPTY);
      }
      catch (IOException e) {
        throw new ExecutionException(e);
      }
    }
    // TODO [targets] Should `interpreterParameters` be here?
    TargetedCommandLine targetedCommandLine = PythonScripts.buildTargetedCommandLine(pythonExecution,
                                                                                     targetEnvironment,
                                                                                     getSdk(),
                                                                                     Collections.emptyList()
    );
    // TODO [targets] Set parent directory of interpreter as the working directory

    LOG.info("Running packaging tool");

    // TODO [targets] Apply environment variables: setPythonUnbuffered(...), setPythonDontWriteBytecode(...), resetHomePathChanges(...)
    // TODO [targets] Apply flavor from PythonSdkFlavor.getFlavor(mySdk)
    ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    Process process = createProcess(targetEnvironment, targetedCommandLine, askForSudo, indicator);
    List<String> commandLine = targetedCommandLine.collectCommandsSynchronously();
    String commandLineString = StringUtil.join(commandLine, " ");
    final CapturingProcessHandler handler =
      new CapturingProcessHandler(process, targetedCommandLine.getCharset(), commandLineString);
    final ProcessOutput result;
    if (showProgress && indicator != null) {
      handler.addProcessListener(new IndicatedProcessOutputListener(indicator));
      result = handler.runProcessWithProgressIndicator(indicator);
    }
    else {
      // TODO [targets] Check if timeout is ok for all targets
      result = handler.runProcess(TIMEOUT);
    }
    if (result.isCancelled()) {
      throw new RunCanceledByUserException();
    }
    result.checkSuccess(LOG);
    final int exitCode = result.getExitCode();
    String helperPath = ContainerUtil.getFirstItem(commandLine, "");
    List<String> args = commandLine.subList(Math.min(1, commandLine.size()), commandLine.size());
    if (exitCode != 0) {
      final String message = StringUtil.isEmptyOrSpaces(result.getStdout()) && StringUtil.isEmptyOrSpaces(result.getStderr())
                             ? PySdkBundle.message("python.conda.permission.denied")
                             : PySdkBundle.message("python.sdk.packaging.non.zero.exit.code", exitCode);
      throw new PyExecutionException(message, helperPath, args, result);
    }
    return new ProcessOutputWithCommandLine(helperPath, args, result);
  }
private @NotNull PyTargetEnvironmentPackageManager.ProcessOutputWithCommandLine getPythonProcessOutput(@NotNull PythonExecution pythonExecution,
                                                                                                         boolean askForSudo,
                                                                                                         boolean showProgress,
                                                                                                         @NotNull TargetEnvironmentRequest targetEnvironmentRequest)