How to use the pydeps.py2depgraph.pysource function in pydeps

To help you get started, we’ve selected a few pydeps 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 seddonym / layer_linter / layer_linter / dependencies.py View on Github external
Get a list of Python files within the supplied package directory.
         Return:
            Generator of Python file names.
        """
        for root, dirs, files in os.walk(directory):
            # Don't include directories that aren't Python packages,
            # nor their subdirectories.
            if '__init__.py' not in files:
                [dirs.remove(d) for d in list(dirs)]
                continue
            # Don't include hidden directories.
            dotdirs = [d for d in dirs if d.startswith('.')]
            for d in dotdirs:
                dirs.remove(d)
            for filename in files:
                if is_python_file(filename):
                    yield os.path.abspath(os.path.join(root, filename))