How to use the pipreqs.pipreqs.get_pkg_names function in pipreqs

To help you get started, we’ve selected a few pipreqs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bndr / pipreqs / tests / test_pipreqs.py View on Github external
def test_deduplicate_dependencies(self):
        imports = pipreqs.get_all_imports(self.project_with_duplicated_deps)
        pkgs = pipreqs.get_pkg_names(imports)
        self.assertEqual(len(pkgs), 1)
        self.assertTrue("pymongo" in pkgs)