def package_is_installed(prefix, package, exact=False): packages = list(install_linked(prefix)) if '::' not in package: packages = list(map(dist2dirname, packages)) if exact: return package in packages return any(p.startswith(package) for p in packages)
def assert_package_is_installed(prefix, package, exact=False): if not package_is_installed(prefix, package, exact): print(list(install_linked(prefix))) raise AssertionError("package {0} is not in prefix".format(package))
def package_is_installed(prefix, package, exact=False): if exact: return any(p == package for p in install_linked(prefix)) return any(p.startswith(package) for p in install_linked(prefix))
def assert_package_is_installed(prefix, package): if not package_is_installed(prefix, package): print([p for p in install_linked(prefix)]) raise AssertionError("package {0} is not in prefix".format(package))
def package_is_installed(prefix, package): return any(p.startswith(package) for p in install_linked(prefix))