def run(self, pkg_name, archive_filename, extras=[]):
        """
        Main method for Installer to do its job.
        :param pkg_name: name of package
        :type pkg_name: str
        :param archive_filename: path to archive
        :type param: str
        :param extras: extras to install
        :type extras: list of str
        :return: tuple of (files installed, dependencies)
        :rtype: tuple of (list of str, list of str)
        """

        extracted_folder = self._unzip(pkg_name, archive_filename)
        try:
            # locate the setup file
            src_dir = os.path.join(extracted_folder, os.listdir(extracted_folder)[0])
            setup_filename = os.path.join(src_dir, 'setup.py')

            try:
                print('Running setup file ...')
                return self._run_setup_file(setup_filename, extras=extras)

            except Exception as e:
                print('{!r}'.format(e))
                print('Failed to run setup.py')
                if self.verbose:
                    # print traceback
                    print("")
                    traceback.print_exc()
                    print("")
                print('Fall back to directory guessing ...')

                pkg_name = pkg_name.lower().replace('-', '_')

                if os.path.isdir(os.path.join(src_dir, pkg_name)):
                    ArchiveFileInstaller._safe_move(
                        os.path.join(src_dir,
                                     pkg_name),
                        os.path.join(self.site_packages,
                                     pkg_name)
                    )
                    return [os.path.join(self.site_packages, pkg_name)], []

                elif os.path.isfile(os.path.join(src_dir, pkg_name + '.py')):
                    ArchiveFileInstaller._safe_move(
                        os.path.join(src_dir,
                                     pkg_name + '.py'),
                        os.path.join(self.site_packages,
                                     pkg_name + '.py')
                    )
                    return [os.path.join(self.site_packages, pkg_name + '.py')], []

                elif os.path.isdir(os.path.join(src_dir, 'src', pkg_name)):
                    ArchiveFileInstaller._safe_move(
                        os.path.join(src_dir,
                                     'src',
                                     pkg_name),
                        os.path.join(self.site_packages,
                                     pkg_name)
                    )
                    return [os.path.join(self.site_packages, pkg_name)], []

                else:
                    raise PipError('Cannot locate packages. Manual installation required.')

        finally:
            shutil.rmtree(extracted_folder)
            os.remove(archive_filename)

        Main method for Installer to do its job.
        :param pkg_name: name of package
        :type pkg_name: str
        :param archive_filename: path to archive
        :type param: str
        :param extras: extras to install
        :type extras: list of str
        :return: tuple of (files installed, dependencies)
        :rtype: tuple of (list of str, list of str)
        
bin/pip.py