diff --git a/mdagent/utils/__init__.py b/mdagent/utils/__init__.py index ad59b1e4..ef0fa47b 100644 --- a/mdagent/utils/__init__.py +++ b/mdagent/utils/__init__.py @@ -1,5 +1,4 @@ -from .general_utils import find_file_path from .makellm import _make_llm from .path_registry import FileType, PathRegistry -__all__ = ["_make_llm", "PathRegistry", "FileType", "find_file_path"] +__all__ = ["_make_llm", "PathRegistry", "FileType"] diff --git a/mdagent/utils/general_utils.py b/mdagent/utils/general_utils.py deleted file mode 100644 index 6a1a6652..00000000 --- a/mdagent/utils/general_utils.py +++ /dev/null @@ -1,24 +0,0 @@ -import os - - -def find_file_path(file_name: str, exact_match: bool = True): - """get the path of a file, if it exists in repo""" - setup_dir = None - for dirpath, dirnames, filenames in os.walk("."): - if "setup.py" in filenames: - setup_dir = dirpath - break - - if setup_dir is None: - raise FileNotFoundError("Unable to find root directory.") - - for dirpath, dirnames, filenames in os.walk(setup_dir): - for filename in filenames: - if (exact_match and filename == file_name) or ( - not exact_match and file_name in filename - ): - path_full = os.path.join(dirpath, filename) - # make sure its absolute - return os.path.abspath(path_full) - - return None