def test_is_zenml_dir(): ok_path = config_root not_ok_path = TEST_ROOT assert ZenMLConfig.is_zenml_dir(ok_path) assert not ZenMLConfig.is_zenml_dir(not_ok_path)
def test_is_zenml_dir(): ok_path = TEST_ROOT not_ok_path = pipelines_dir assert ZenMLConfig.is_zenml_dir(ok_path) assert not ZenMLConfig.is_zenml_dir(not_ok_path)
def get_zenml_dir(path: Text): """ Recursive function to find the zenml config starting from path. Args: path (str): starting path """ if ZenMLConfig.is_zenml_dir(path): return path if path_utils.is_root(path): raise Exception( 'Looks like you used ZenML outside of a ZenML repo. ' 'Please init a ZenML repo first before you using ' 'the framework.') return Repository.get_zenml_dir(str(Path(path).parent))