def _compile_dependecies(user, modules, session=None):
    logging.debug('_compile_dependecies: enter')

    dmodules_list = Compiler.get_dependencies(user, modules, session)
    if not dmodules_list:
        logging.debug('_compile_dependecies: no dependency found !!')
        return

    # strip file path
    dmodules = []
    for m in dmodules_list:
        base_m = os.path.basename(m)
        base_m = os.path.splitext(base_m)[0]
        if '@' in base_m:
            base_m = base_m.split('@')[0]
        dmodules.append(base_m)

    yangdst = ServerSettings.yang_path(user)
    for yangfile in glob.glob(os.path.join(yangdst, '*.yang')):
        basename = os.path.basename(yangfile)

        # skip dependency module itself
        if basename in modules: continue

        base = os.path.splitext(basename)[0]
        if '@' in base: base = base.split('@')[0]

        if base in dmodules:
            # ignore some common files
            if base in ignore_list:
                logging.debug('Compile dependency: ignoring ' + base)
                continue
            Compiler.compile_cxml(user, None, yangfile)

    logging.debug('_compile_dependecies: done')
Compile affected modules
dataset/ETHPy150Open CiscoDevNet/yang-explorer/server/explorer/utils/uploader.py/_compile_dependecies