import os.path

def configure(context):
    # extract its installation path
    context.start_msg("Checking for NumPy module")

    try:
        import numpy

        path = os.path.dirname(numpy.__file__)
    except ImportError:
        context.end_msg(False)
        context.fatal("Unable to import NumPy")

    context.end_msg(path)

    # bring in its headers
    context.env.append_value("INCLUDES", os.path.join(path, "core/include"))

def build(context):
    context(
        source = [
            "__init__.py",
            "concurrent.py",
            "condor.py",
            "defaults.py",
            "errors.py",
            "io.py",
            "iterators.py",
            "json.py",
            "labor2.py",
            "log.py",
            "numpy.py",
            "plot.py",
            "profile.py",
            "random.py",
            "sugar.py",
            "temporal.py",
            "testing.py",
            ],
        install_path = "${PYTHONDIR}/cargo",
        )

    context.recurse("sql")
    context.recurse("unix")
    context.recurse("tools")
    context.recurse("test")

