def test_msg(self): output = get_package_version("42foobarnoexist", "test") self.assertTrue("test" in output)
def get_optional_config_values(): """ Read the optional package versions into a dictionary. """ output = OrderedDict() output["Pytorch Ignite"] = get_package_version("ignite") output["Nibabel"] = get_package_version("nibabel") output["scikit-image"] = get_package_version("skimage") output["Pillow"] = get_package_version("PIL") output["Tensorboard"] = get_package_version("tensorboard") output["gdown"] = get_package_version("gdown") output["TorchVision"] = get_package_version("torchvision") output["tqdm"] = get_package_version("tqdm") output["lmdb"] = get_package_version("lmdb") output["psutil"] = psutil_version output["pandas"] = get_package_version("pandas") output["einops"] = get_package_version("einops") output["transformers"] = get_package_version("transformers") output["mlflow"] = get_package_version("mlflow") output["pynrrd"] = get_package_version("nrrd") return output
def test_default(self): output = get_package_version("42foobarnoexist") self.assertTrue("UNKNOWN" in output) output = get_package_version("numpy") self.assertFalse("UNKNOWN" in output)