Esempio n. 1
0
def get_all_components():

    comps = {}

    # If RMF is being built as part of IMP, split out its build (rather than
    # building it as part of IMP.rmf)
    special_dep_targets = {"RMF": RMFDependency}
    for dep, cls in special_dep_targets.items():
        i = tools.get_dependency_info(dep, "")
        if i['ok']:
            comps[dep] = cls(dep)
            comps[dep].set_dep_modules(comps, [], [], special_dep_targets)

    modules = tools.get_sorted_order()
    for m in modules:
        comps[m] = Module(m)

    for m in modules:
        i = tools.get_module_info(m, "")
        comps[m].set_dep_modules(comps, i['modules'], i['dependencies'],
                                 special_dep_targets)
    source_dir = os.path.join(os.path.dirname(sys.argv[0]), '..', '..')
    all_modules = [x[0] for x in tools.get_modules(source_dir)]
    add_disabled_components(modules, all_modules, comps, "module")
    return comps
Esempio n. 2
0
def get_all_components():

    comps = {}

    # If RMF is being built as part of IMP, split out its build (rather than
    # building it as part of IMP.rmf)
    special_dep_targets = {"RMF": RMFDependency}
    for dep, cls in special_dep_targets.items():
        i = tools.get_dependency_info(dep, "")
        if i['ok'] and internal_dep(dep):
            comps[dep] = cls(dep)
            comps[dep].set_dep_modules(comps, [], [], special_dep_targets)

    modules = tools.get_sorted_order()
    apps = tools.get_all_configured_applications()
    for m in modules:
        comps[m] = Module(m)
    for a in apps:
        comps[a] = Application(a)

    for m in modules:
        i = tools.get_module_info(m, "")
        comps[m].set_dep_modules(comps, i['modules'], i['dependencies'],
                                 special_dep_targets)
    for a in apps:
        i = tools.get_application_info(a, "")
        comps[a].set_dep_modules(comps, i['modules'], i['dependencies'],
                                 special_dep_targets)
    source_dir = os.path.join(os.path.dirname(sys.argv[0]), '..', '..')
    all_modules= [x[0] for x in tools.get_modules(source_dir)]
    all_apps= [x[0] for x in tools.get_applications(source_dir)]
    add_disabled_components(modules, all_modules, comps, "module")
    add_disabled_components(apps, all_apps, comps, "application")
    return comps
Esempio n. 3
0
def main():
    (options, args) = parser.parse_args()
    sorted_order = tools.get_sorted_order()
    if options.module != "":
        if options.module == "kernel":
            tools.rewrite("lib/IMP/__init__.py", imp_init)
        build_wrapper(
            options.module, os.path.join(
                options.source, "modules", options.module),
            options.source, sorted_order,
            tools.get_module_description(
                options.source,
                options.module,
                options.datapath),
            os.path.join("swig", "IMP_" + options.module + ".i"),
            options.datapath)
    else:
        tools.rewrite("lib/IMP/__init__.py", imp_init)
        for m, path in tools.get_modules(options.source):
            build_wrapper(m, path, options.source, sorted_order,
                          tools.get_module_description(
                              options.source,
                              m,
                              options.datapath),
                          os.path.join("swig", "IMP_" + m + ".i"),
                          options.datapath)
Esempio n. 4
0
def parse_args():
    parser = OptionParser(usage="""%prog [options] outdir

Generate HTML coverage reports for IMP C++/Python code in the given directory.
""")
    parser.add_option("--report", type="choice",
                      choices=['python', 'cpp', 'both'], default='both',
                      help="Generate reports for Python code ('python'), "
                           "C++ code ('cpp') or both Python and C++ ('both'). "
                           "Default '%default'.")
    parser.add_option("--modules", metavar='STR', default=None,
                      help="Report only for the given colon-separated list of "
                           "IMP modules, e.g. 'base:kernel'. By default, "
                           "coverage for all modules is reported.")
    parser.add_option("--dependencies", metavar='STR', default=None,
                      help="Report only for the given colon-separated list of "
                           "IMP dependencies, e.g. 'RMF'. By default, coverage "
                           "for all supported dependencies (currently only "
                           "RMF) is reported.")
    parser.add_option("--exclude", metavar='PCK', default=None,
                      help="Don't report coverage for any of the components "
                           "listed in the given summary file (as generated by "
                           "build_all.py).")
    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error("wrong number of arguments")
    if opts.exclude:
        exclude = pickle.load(open(opts.exclude, 'rb'))
    else:
        exclude = {}
    opts.modules = _get_components(opts.modules, tools.get_sorted_order(),
                                   exclude)
    opts.dependencies = _get_components(opts.dependencies, ['RMF'], exclude)
    return opts, args[0]
Esempio n. 5
0
def main():
    (options, args) = parser.parse_args()
    pool = thread_pool.ThreadPool()
    ordered = tools.get_sorted_order()
    for m in ordered:
        #setup_one(m, ordered, options.build_system, options.swig)
        pool.add_task(setup_one, m, ordered, options.build_system, options.swig)
    pool.wait_completion()
Esempio n. 6
0
def write_no_ok(module):
    new_order = [x for x in tools.get_sorted_order() if x != module]
    tools.set_sorted_order(new_order)
    tools.rewrite(
        os.path.join(
            "data",
            "build_info",
            "IMP." + module),
        "ok=False\n",
        verbose=False)
Esempio n. 7
0
def write_no_ok(module):
    new_order = [x for x in tools.get_sorted_order() if x != module]
    tools.set_sorted_order(new_order)
    tools.rewrite(
        os.path.join(
            "data",
            "build_info",
            "IMP." + module),
        "ok=False\n",
        verbose=False)
def main():
    (options, args) = parser.parse_args()
    sorted_order = tools.get_sorted_order()

    if options.module != "":
        mf = tools.ModulesFinder(source_dir=options.source,
                                 external_dir=options.build_dir,
                                 module_name=options.module)
        module = mf[options.module]
        build_wrapper(module, mf, sorted_order,
                      os.path.join("swig", "IMP_" + module.name + ".i"))
Esempio n. 9
0
def main():
    (options, args) = parser.parse_args()
    pool = tools.thread_pool.ThreadPool()
    ordered = tools.get_sorted_order()
    for m in ordered:
        #setup_one(m, ordered, options.build_system, options.swig)
        pool.add_task(setup_one, m, ordered, options.build_system,
                      options.swig)
    err = pool.wait_completion()
    if err:
        sys.stderr.write(err + '\n')
        return 1
    return 0
Esempio n. 10
0
File: report.py Progetto: sirusb/imp
def parse_args():
    parser = OptionParser(usage="""%prog [options] outdir

Generate HTML coverage reports for IMP C++/Python code in the given directory.
""")
    parser.add_option("--report",
                      type="choice",
                      choices=['python', 'cpp', 'both'],
                      default='both',
                      help="Generate reports for Python code ('python'), "
                      "C++ code ('cpp') or both Python and C++ ('both'). "
                      "Default 'both'.")
    parser.add_option("--modules",
                      metavar='STR',
                      default=None,
                      help="Report only for the given colon-separated list of "
                      "IMP modules, e.g. 'base:kernel'. By default, "
                      "coverage for all modules is reported.")
    parser.add_option("--applications",
                      metavar='STR',
                      default=None,
                      help="Report only for the given colon-separated list of "
                      "IMP applications, e.g. 'foxs:saxs_merge'. By "
                      "default, coverage for all applications is "
                      "reported.")
    parser.add_option("--dependencies",
                      metavar='STR',
                      default=None,
                      help="Report only for the given colon-separated list of "
                      "IMP dependencies, e.g. 'RMF'. By default, coverage "
                      "for all supported dependencies (currently only "
                      "RMF) is reported.")
    parser.add_option("--exclude",
                      metavar='PCK',
                      default=None,
                      help="Don't report coverage for any of the components "
                      "listed in the given summary file (as generated by "
                      "build_all.py).")
    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error("wrong number of arguments")
    if opts.exclude:
        exclude = pickle.load(open(opts.exclude))
    else:
        exclude = {}
    opts.modules = _get_components(opts.modules, tools.get_sorted_order(),
                                   exclude)
    opts.applications = _get_components(
        opts.applications, tools.get_all_configured_applications(), exclude)
    opts.dependencies = _get_components(opts.dependencies, ['RMF'], exclude)
    return opts, args[0]
Esempio n. 11
0
def main():
    (options, args) = parser.parse_args()
    sorted_order = tools.get_sorted_order()
    if options.module != "":
        build_wrapper(
            options.module, os.path.join(
                options.source, "modules", options.module),
            options.source, sorted_order,
            tools.get_module_description(
                options.source,
                options.module,
                options.datapath),
            os.path.join("swig", "IMP_" + options.module + ".i"),
            options.datapath)
Esempio n. 12
0
def main():
    (options, args) = parser.parse_args()
    pool = tools.thread_pool.ThreadPool()
    ordered = tools.get_sorted_order()
    for m in ordered:
        #setup_one(m, ordered, options.build_system, options.swig)
        pool.add_task(
            setup_one,
            m,
            ordered,
            options.build_system,
            options.swig)
    err = pool.wait_completion()
    if err:
        sys.stderr.write(err + '\n')
        return 1
    return 0
Esempio n. 13
0
def main():
    (options, args) = parser.parse_args()
    sorted_order = tools.get_sorted_order()
    if options.module != "":
        if options.module == "kernel":
            tools.rewrite("lib/IMP/__init__.py", imp_init)
        build_wrapper(
            options.module,
            os.path.join(options.source, "modules",
                         options.module), options.source, sorted_order,
            tools.get_module_description(options.source, options.module,
                                         options.datapath),
            os.path.join("swig", "IMP_" + options.module + ".i"),
            options.datapath)
    else:
        tools.rewrite("lib/IMP/__init__.py", imp_init)
        for m, path in tools.get_modules(options.source):
            build_wrapper(
                m, path, options.source, sorted_order,
                tools.get_module_description(options.source, m,
                                             options.datapath),
                os.path.join("swig", "IMP_" + m + ".i"), options.datapath)