How to use the pipreqs.pipreqs.get_name_without_alias 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_get_import_name_without_alias(self):
        """
        Test that function get_name_without_alias() will work on a string.
        - Note: This isn't truly needed when pipreqs is walking the AST to find imports
        """
        import_name_with_alias = "requests as R"
        expected_import_name_without_alias = "requests"
        import_name_without_aliases = pipreqs.get_name_without_alias(
            import_name_with_alias)
        self.assertEqual(
            import_name_without_aliases, expected_import_name_without_alias)

pipreqs

Pip requirements.txt generator based on imports in project

Apache-2.0
Latest version published 10 months ago

Package Health Score

77 / 100
Full package analysis

Similar packages