scripts/deps.py
def load_external_dependencies(path):
    """
    Extracts external dependencies from code files in the path.
    This considers only non `crate::`, `self::`, and `super::` uses.
    Moreover, it includes `extern crate` statements with a `#[macro_use]`.
    Renames with `extern crate` are considered, but overapproximated (i.e. all renames apply for the whole path).
    Note: This does not check for `mod` statements, but considers all Rust files relevant.
    :param path: The path to recursively scan for dependencies.
    :return: A set in the form of:
    {
        <dependency_name>, ...
    }
    """
    def external_crate_name(rust_path):
        elements = rust_path.split('::')
        if elements[0] not in ('crate', 'super', 'self'):
            return elements[0]
        return None

    dependency_tree = list_dependencies_recursive(path)
    renames = {}
    dependencies = set()

    for (filename, info) in dependency_tree.items():
        renames.update(info['renames'])
        curated_dependencies = filter(lambda x: x is not None, map(external_crate_name, info['dependencies']))
        dependencies.update(curated_dependencies)

    return set([renames[name] if name in renames else name for name in dependencies])

    Extracts external dependencies from code files in the path.
    This considers only non `crate::`, `self::`, and `super::` uses.
    Moreover, it includes `extern crate` statements with a `#[macro_use]`.
    Renames with `extern crate` are considered, but overapproximated (i.e. all renames apply for the whole path).
    Note: This does not check for `mod` statements, but considers all Rust files relevant.
    :param path: The path to recursively scan for dependencies.
    :return: A set in the form of:
    {
        <dependency_name>, ...
    }
    
Extracts external dependencies from code files in the path.
Extracts external dependencies from code files in the path .
def load_external_dependencies(path):
    def external_crate_name(rust_path):
        elements = rust_path.split('::')
        if elements[0] not in ('crate', 'super', 'self'):
            return elements[0]
        return None
    dependency_tree = list_dependencies_recursive(path)
    renames = {}
    dependencies = set()
    for (filename, info) in dependency_tree.items():
        renames.update(info['renames'])
        curated_dependencies = filter(lambda x: x is not None, map(external_crate_name, info['dependencies']))
        dependencies.update(curated_dependencies)
    return set([renames[name] if name in renames else name for name in dependencies])
def load_external_dependencies ( path ) : def external_crate_name ( rust_path ) : elements = rust_path . split ( '::' ) if elements [ 0 ] not in ( 'crate' , 'super' , 'self' ) : return elements [ 0 ] return None dependency_tree = list_dependencies_recursive ( path ) renames = { } dependencies = set ( ) for ( filename , info ) in dependency_tree . items ( ) : renames . update ( info [ 'renames' ] ) curated_dependencies = filter ( lambda x : x is not None , map ( external_crate_name , info [ 'dependencies' ] ) ) dependencies . update ( curated_dependencies ) return set ( [ renames [ name ] if name in renames else name for name in dependencies ] )
Extracts external dependencies from code files in the path.
Extracts external dependencies from code files in the path .
"""
    Extracts external dependencies from code files in the path.
    This considers only non `crate::`, `self::`, and `super::` uses.
    Moreover, it includes `extern crate` statements with a `#[macro_use]`.
    Renames with `extern crate` are considered, but overapproximated (i.e. all renames apply for the whole path).
    Note: This does not check for `mod` statements, but considers all Rust files relevant.
    :param path: The path to recursively scan for dependencies.
    :return: A set in the form of:
    {
        <dependency_name>, ...
    }
    """
A set in the form of:
{
,
}
A set in the form of : { }
path
The path to recursively scan for dependencies.
The path to recursively scan for dependencies .