# Path: bento/core/pkg_objects.py
# class Extension(Compiled):
#     pass
# 
# class CompiledLibrary(Compiled):
#     pass
# 
# Path: bento/utils/utils.py
# class memoized(object):
#     """Decorator that caches a function's return value each time it is called.
#     If called later with the same arguments, the cached value is returned, and
#     not re-evaluated.
#     """
#     def __init__(self, func):
#        self.func = func
#        self.cache = {}
#     def __call__(self, *args):
#        try:
#           return self.cache[args]
#        except KeyError:
#           value = self.func(*args)
#           self.cache[args] = value
#           return value
#        except TypeError:
#           # uncachable -- for instance, passing a list as an argument.
#           # Better to not cache than to blow up entirely.
#           return self.func(*args)
# 
#     def __repr__(self):
#        """Return the function's docstring."""
#        return self.func.__doc__
# 
#     def __get__(self, obj, objtype):
#        """Support instance methods."""
#        return partial(self.__call__, obj)


import os
import sys
import tempfile
    import yaku.context
from bento.compat.api.moves \
    import \
        unittest
from bento.core.package \
    import \
        raw_parse, raw_to_pkg_kw
from bento.core.pkg_objects \
    import \
        Extension, CompiledLibrary
from bento.utils.utils \
    import \
        memoized
    from bento.core._nose_compat import install_proxy, install_result
    from bento.commands.build_distutils import DistutilsBuilder


if "nose" in sys.modules:
    install_proxy()
    install_result()

def skip_if(condition, msg=""):
    return unittest.skipIf(condition, msg)

def expected_failure(f):
    return unittest.expectedFailure(f)

def require_c_compiler(builder="yaku"):
    if builder == "yaku":
        return _require_c_compiler_yaku()
    elif builder == "distutils":
        return _require_c_compiler_distutils()
    else:
        raise ValueError("Unrecognized builder: %r" % builder)

@memoized
def _require_c_compiler_distutils():
    builder = DistutilsBuilder()
    try:
        if len(builder.ext_bld_cmd.compiler.executables) < 1:
            return unittest.skipIf(True, "No C compiler available")
        return unittest.skipIf(False, "")
    except Exception:
        return unittest.skipIf(True, "No C compiler available")


# Path: bento/core/pkg_objects.py
# class Extension(Compiled):
#     pass
# 
# class CompiledLibrary(Compiled):
#     pass
# 
# Path: bento/utils/utils.py
# class memoized(object):
#     """Decorator that caches a function's return value each time it is called.
#     If called later with the same arguments, the cached value is returned, and
#     not re-evaluated.
#     """
#     def __init__(self, func):
#        self.func = func
#        self.cache = {}
#     def __call__(self, *args):
#        try:
#           return self.cache[args]
#        except KeyError:
#           value = self.func(*args)
#           self.cache[args] = value
#           return value
#        except TypeError:
#           # uncachable -- for instance, passing a list as an argument.
#           # Better to not cache than to blow up entirely.
#           return self.func(*args)
# 
#     def __repr__(self):
#        """Return the function's docstring."""
#        return self.func.__doc__
# 
#     def __get__(self, obj, objtype):
#        """Support instance methods."""
#        return partial(self.__call__, obj)


# Path: bento/core/testing.py
import os
import sys
import tempfile
    import yaku.context
from bento.compat.api.moves \
    import \
        unittest
from bento.core.package \
    import \
        raw_parse, raw_to_pkg_kw
from bento.core.pkg_objects \
    import \
        Extension, CompiledLibrary
from bento.utils.utils \
    import \
        memoized
    from bento.core._nose_compat import install_proxy, install_result
    from bento.commands.build_distutils import DistutilsBuilder



if "nose" in sys.modules:
    install_proxy()
    install_result()

def skip_if(condition, msg=""):
    return unittest.skipIf(condition, msg)

def expected_failure(f):
    return unittest.expectedFailure(f)

def require_c_compiler(builder="yaku"):
    if builder == "yaku":
        return _require_c_compiler_yaku()
    elif builder == "distutils":
        return _require_c_compiler_distutils()
    else:
        raise ValueError("Unrecognized builder: %r" % builder)

@memoized
def _require_c_compiler_distutils():
    builder = DistutilsBuilder()
    try:
        if len(builder.ext_bld_cmd.compiler.executables) < 1:
            return unittest.skipIf(True, "No C compiler available")
        return unittest.skipIf(False, "")
    except Exception:
        return unittest.skipIf(True, "No C compiler available")


@memoized