We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6e2b051 + 491e616 commit f41fb3fCopy full SHA for f41fb3f
1 file changed
codeflash/code_utils/config_parser.py
@@ -5,6 +5,7 @@
5
6
import tomlkit
7
8
+PYPROJECT_TOML_CACHE = {}
9
ALL_CONFIG_FILES = {} # map path to closest config file
10
11
@@ -21,10 +22,15 @@ def find_pyproject_toml(config_file: Path | None = None) -> Path:
21
22
raise ValueError(msg)
23
return config_file
24
dir_path = Path.cwd()
-
25
+ cur_path = dir_path
26
+ # see if it was encountered before in search
27
+ if cur_path in PYPROJECT_TOML_CACHE:
28
+ return PYPROJECT_TOML_CACHE[cur_path]
29
+ # map current path to closest file
30
while dir_path != dir_path.parent:
31
config_file = dir_path / "pyproject.toml"
32
if config_file.exists():
33
+ PYPROJECT_TOML_CACHE[cur_path] = config_file
34
35
# Search for pyproject.toml in the parent directories
36
dir_path = dir_path.parent
0 commit comments