How to use the pipdeptree.construct_tree function in pipdeptree

To help you get started, we’ve selected a few pipdeptree 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 naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def venv_fixture(pickle_file):
    """Loads required virtualenv pkg data from a pickle file

    :param pickle_file: path to a .pickle file
    :returns: a tuple of pkgs, pkg_index, req_map
    :rtype: tuple

    """
    with open(pickle_file, 'rb') as f:
        pkgs = pickle.load(f)
        dist_index = build_dist_index(pkgs)
        tree = construct_tree(dist_index)
        return pkgs, dist_index, tree
github sbg / dante / dante / core / commands.py View on Github external
include_only = [i.lower() for i in include_only] if include_only else []
    packages = [
        package for package in
        pip.get_installed_distributions()
        if package.key not in ignore_list
    ]

    # if include_only is set, remove other packages
    if include_only:
        packages = [
            package for package in packages
            if package.key in include_only
        ]

    dist_index = pipdeptree.build_dist_index(pkgs=packages)
    tree = pipdeptree.construct_tree(index=dist_index)
    return tree