def extract_data(self):
        """Extracts data from archive.
        Returns:
            PackageData object containing the extracted data.
        """
        data = PackageData(
            local_file=self.local_file,
            name=self.name,
            pkg_name=self.rpm_name or self.name_convertor.rpm_name(
                self.name, pkg_name=True),
            version=self.version,
            srcname=self.srcname)

        with self.archive:
            data.set_from(self.data_from_archive)

        # for example nose has attribute `packages` but instead of name
        # listing the pacakges is using function to find them, that makes
        # data.packages an empty set if virtualenv is disabled
        if self.venv_extraction_disabled and getattr(data, "packages") == []:
            data.packages = [data.name]

        return data