def extract_reqs(self):
        reqs = ReqsModules()
        guess = ReqsModules()
        modules, try_imports, local_mods = project_import_modules(
            self._project_path, self._ignores)
        app_name = os.path.basename(self._project_path)
        if app_name in local_mods:
            local_mods.remove(app_name)

        # Filtering modules
        candidates = self._filter_modules(modules, local_mods)

        logger.info('Check module in local environment.')
        for name in candidates:
            logger.info('Checking module: {0}'.format(name))
            if name in self._installed_pkgs:
                pkg_name, version = self._installed_pkgs[name]
                reqs.add(pkg_name, version, modules[name])
            else:
                guess.add(name, 0, modules[name])
        logger.info('Finish local environment checking.')
        return reqs, try_imports, guess
Extract requirements from project.
dataset/ETHPy150Open Damnever/pigar/pigar/__main__.py/GenerateReqs.extract_reqs