def get_all_modules_from_dir(dirname):
    '''
    Get all modules required for Meson itself from directories.
    '''
    modname = os.path.basename(dirname)
    modules = [os.path.splitext(os.path.split(x)[1])[0] for x in glob(os.path.join(dirname, '*'))]
    modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]
    return modules

    Get all modules required for Meson itself from directories.
    
packaging/hook-mesonbuild.py