def get_requirements(self, arguments, max_retries=None, use_wheels=False):
        arguments = self.decorate_arguments(arguments)
        # Demote hash sum mismatch log messages from CRITICAL to DEBUG (hiding
        # implementation details from users unless they want to see them).
        with DownloadLogFilter():
            with SetupRequiresPatch(self.config, self.eggs_links):
                # Use a new build directory for each run of get_requirements().
                self.create_build_directory()
                # Check whether -U or --upgrade was given.
                if any(match_option(a, '-U', '--upgrade') for a in arguments):
                    logger.info("Checking index(es) for new version (-U or --upgrade was given) ..")
                else:
                    # If -U or --upgrade wasn't given and all requirements can be
                    # satisfied using the archives in pip-accel's local source
                    # index we don't need pip to connect to PyPI looking for new
                    # versions (that will just slow us down).
                    try:
                        return self.unpack_source_dists(arguments, use_wheels=use_wheels)
                    except DistributionNotFound:
                        logger.info("We don't have all distribution archives yet!")
                # Get the maximum number of retries from the configuration if the
                # caller didn't specify a preference.
                if max_retries is None:
                    max_retries = self.config.max_retries
                # If not all requirements are available locally we use pip to
                # download the missing source distribution archives from PyPI (we
                # retry a couple of times in case pip reports recoverable
                # errors).
                for i in range(max_retries):
                    try:
                        return self.download_source_dists(arguments, use_wheels=use_wheels)
                    except Exception as e:
                        if i + 1 < max_retries:
                            # On all but the last iteration we swallow exceptions
                            # during downloading.
                            logger.warning("pip raised exception while downloading distributions: %s", e)
                        else:
                            # On the last iteration we don't swallow exceptions
                            # during downloading because the error reported by pip
                            # is the most sensible error for us to report.
                            raise
                    logger.info("Retrying after pip failed (%i/%i) ..", i + 1, max_retries)
Use pip to download and unpack the requested source distribution archives.
dataset/ETHPy150Open paylogic/pip-accel/pip_accel/__init__.py/PipAccelerator.get_requirements