Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

perf(test): cache bash probe resolution per session with functools.lru_cache

Gracy769a916bf9d660c
diff --git a/tests/test_pre_push_hook_contract.py b/tests/test_pre_push_hook_contract.py
index 0cc1f287..a9ef026a 100644
--- a/tests/test_pre_push_hook_contract.py
+++ b/tests/test_pre_push_hook_contract.py
@@ -1,3 +1,4 @@
+import functools
import os
import shutil
import subprocess
@@ -5,6 +6,7 @@ import unittest
from pathlib import Path
[email protected]_cache(maxsize=1)
def get_bash_executable() -> str | None:
if os.name == 'nt':
for candidate in (
@@ -21,6 +23,7 @@ def get_bash_executable() -> str | None:
return None
[email protected]_cache(maxsize=1)
def require_bash() -> bool:
bash = get_bash_executable()
if not bash:
diff --git a/tests/test_roadmap_helpers.py b/tests/test_roadmap_helpers.py
index 3b376357..f7307c71 100644
--- a/tests/test_roadmap_helpers.py
+++ b/tests/test_roadmap_helpers.py
@@ -1,7 +1,10 @@
from __future__ import annotations
+import functools
+import os
import shutil
import subprocess
+import sys
import tempfile
import unittest
from pathlib import Path
@@ -12,12 +15,8 @@ NEXT_ID = REPO_ROOT / 'scripts' / 'roadmap-next-id.sh'
DOGFOOD_PROBE = REPO_ROOT / 'scripts' / 'dogfood-probe.py'
-
-
-import sys
-
[email protected]_cache(maxsize=1)
def get_bash_executable() -> str | None:
- import os
if os.name == 'nt':
for candidate in (
r'C:\Program Files\Git\bin\bash.exe',
@@ -33,6 +32,7 @@ def get_bash_executable() -> str | None:
return None
[email protected]_cache(maxsize=1)
def require_bash() -> bool:
bash = get_bash_executable()
if not bash: