          give easy access to the return code, and also dumps stdout to console so we use subprocess
          for Windows. The downside of this is that we cannot do unbuffered reads, so the process can
          look like it hangs.
  
          #TODO Implement real time read functionality for windows
  
          Parameters
          ----------
          command: list
              The command to run
          package: str
 
</s> remove         proc = pexpect.spawn(" ".join(command),
                             encoding=self._env.encoding,
                             codec_errors="replace",
                             timeout=None)
        last_line_cr = False
        while True:
            try:
                idx = proc.expect(["\r\n", "\r"])
                line = proc.before.rstrip()
                if line and idx == 0:
                    if last_line_cr:
                        last_line_cr = False
                        # Output last line of progress bar and go to next line
 </s> add     def _pywinpty_installer(self, command: List[str], package: str) -> int:
        """ Run an install command using pywinpty and log output.

        pywinpty is used so we can get unbuffered output to display updates

        Parameters
        ----------
        command: list
            The command to run
        package: str
            The package name that is being installed

        Returns
        -------
        int
            The return code from the subprocess
        """
        try:
            import winpty  # pylint:disable=import-outside-toplevel,import-error
            logger.info("Installing %s", package)
            cmd = which(command[0], path=os.environ.get('PATH', os.defpath))
            # For some reason with WinPTY we need to pass in the full command. Probably a bug
            cmdline = list2cmdline(command)
            logger.debug("argv: %s, cmd: '%s', cmdline: '%s'", command, cmd, cmdline)

            proc = winpty.PTY(
                100,
                24,
                backend=winpty.enums.Backend.WinPTY,  # ConPTY hangs and has lots of Ansi Escapes
                agent_config=winpty.enums.AgentConfig.WINPTY_FLAG_PLAIN_OUTPUT)  # Strip all Ansi

            if not proc.spawn(cmd, cmdline=cmdline):
                del proc
                raise RuntimeError("Failed to spawn winpty")

            pbar = re.compile(r"(?:eta\s[\d\W]+)|(?:\s+\|\s+\d+%)\Z")
            lines = []
            out = ""
            eof = False
            last_line_cr = False
            num_bytes = 1024
            while True:
                try:
                    from_pty = proc.read(num_bytes)
                except winpty.WinptyError as err:
                    if any(val in str(err) for val in ["EOF", "pipe has been ended"]):
                        # Get remaining bytes. On a comms error, the buffer remains unread so keep
                        # halving buffer amount until down to 1 when we know we have everything
                        if num_bytes == 1:
                            eof = True
                        from_pty = ""
                        num_bytes //= 2
                    else:
                        raise
                out += from_pty
                if "\n" in out:
                    lines.extend(out.split("\n"))
                    if out.endswith("\n") or eof:  # Ends on newline or is EOF
                        out = ""
                    else:  # roll over semi-consumed line to next read
                        out = lines[-1]
                        lines = lines[:-1]

                for line in lines:  # Dump the output to log
                    line = line.rstrip()
                    is_cr = bool(pbar.search(line))
                    if line and not is_cr:
                        if last_line_cr:
                            last_line_cr = False
                            if not self._is_gui:  # Go to next line
                                print("")
                        logger.verbose(line)  # type:ignore
                    elif line:
                        last_line_cr = True
                        logger.debug(line) </s> remove disable=print-statement,
        parameter-unpacking,
        unpacking-in-except,
        old-raise-syntax,
        backtick,
        long-suffix,
        old-ne-operator,
        old-octal-literal,
        import-star-module-level,
        non-ascii-bytes-literal,
        raw-checker-failed,
 </s> add disable=raw-checker-failed, </s> remove         use-symbolic-message-instead,
        apply-builtin,
        basestring-builtin,
        buffer-builtin,
        cmp-builtin,
        coerce-builtin,
        execfile-builtin,
        file-builtin,
        long-builtin,
        raw_input-builtin,
        reduce-builtin,
        standarderror-builtin,
        unicode-builtin,
        xrange-builtin,
        coerce-method,
        delslice-method,
        getslice-method,
        setslice-method,
        no-absolute-import,
        old-division,
        dict-iter-method,
        dict-view-method,
        next-method-called,
        metaclass-assignment,
        indexing-exception,
        raising-string,
        reload-builtin,
        oct-method,
        hex-method,
        nonzero-method,
        cmp-method,
        input-builtin,
        round-builtin,
        intern-builtin,
        unichr-builtin,
        map-builtin-not-iterating,
        zip-builtin-not-iterating,
        range-builtin-not-iterating,
        filter-builtin-not-iterating,
        using-cmp-argument,
        eq-without-hash,
        div-method,
        idiv-method,
        rdiv-method,
        exception-message-attribute,
        invalid-str-codec,
        sys-max-int,
        bad-python3-import,
        deprecated-string-function,
        deprecated-str-translate-call,
        deprecated-itertools-function,
        deprecated-types-field,
        next-method-defined,
        dict-items-not-iterating,
        dict-keys-not-iterating,
        dict-values-not-iterating,
        deprecated-operator-function,
        deprecated-urllib-function,
        xreadlines-attribute,
        deprecated-sys-function,
        exception-escape,
        comprehension-escape
 </s> add         use-symbolic-message-instead </s> remove                             print(line)
                    logger.verbose(line)  # type:ignore
                elif line and idx == 1:
                    last_line_cr = True
                    logger.debug(line)
                    if not self._is_gui:
                        print(line, end="\r")
            except pexpect.EOF:
                break
        proc.close()
        returncode = proc.exitstatus
        logger.debug("Package: %s, returncode: %s", package, returncode)
        return returncode
 </s> add                             print(line, end="\r")
                lines = []
                if eof:
                    returncode = proc.get_exitstatus()
                    break

            del proc
            logger.debug("Package: %s, returncode: %s", package, returncode)
            return returncode
        except Exception as err:  # pylint:disable=broad-except
            logger.debug("Failed to install with pexpect. Falling back to subprocess. Error: %s",
                         str(err))
            return self._subproc_installer(command, package) </s> remove         setup_packages = [(pkg.unsafe_name, pkg.specs)
                          for pkg in parse_requirements(_INSTALLER_REQUIREMENTS)]
 </s> add         pkgs = [pkg[0] for pkg in _INSTALLER_REQUIREMENTS]
        setup_packages = [(pkg.unsafe_name, pkg.specs) for pkg in parse_requirements(pkgs)]
          give easy access to the return code, and also dumps stdout to console so we use subprocess
          for Windows. The downside of this is that we cannot do unbuffered reads, so the process can
          look like it hangs.
  


          Parameters
          ----------
          command: list
              The command to run
          package: str
keep keep keep keep replace replace keep keep keep keep keep
 Update setup.py
  - Realtime output for Windows
  - color logging for compatible Windows versions 
setup.py