fix: make git path resolution lazy instead of import-time #161

Merged
fuzzy merged 1 commit from fix/125-git-import-side-effect into main 2026-07-06 08:20:04 +00:00
Owner

Moves shutil.which("git") from module-level import into a lazy _resolve_git() function. The module can now be imported in environments without git; GitNotFoundError only raises when a git function is actually called.

Closes #125

Moves `shutil.which("git")` from module-level import into a lazy `_resolve_git()` function. The module can now be imported in environments without git; `GitNotFoundError` only raises when a git function is actually called. Closes #125
fix(git): make git path resolution lazy instead of import-time
All checks were successful
CI / lint-and-test (pull_request) Successful in 1m31s
2977520ceb
Move shutil.which('git') from module level into lazy
_resolve_git() function. The module can now be imported safely
in environments without git; GitNotFoundError only raises
when a git function is actually called.

Closes #125
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-06 08:17:10 +00:00
the.auditor left a comment

Audit Review — PR #161

Clean fix for #125. Module-level shutil.which("git") moved to lazy _resolve_git() with caching. _GIT_PATH initialized to None, resolved on first _run_git() call. No more import-time side effects.

No suggestions.

Summary

Result: COMMENT — no issues found.

## Audit Review — PR #161 Clean fix for #125. Module-level `shutil.which("git")` moved to lazy `_resolve_git()` with caching. `_GIT_PATH` initialized to `None`, resolved on first `_run_git()` call. No more import-time side effects. No suggestions. ## Summary **Result:** COMMENT — no issues found.
the.auditor left a comment

APPROVED. Clean lazy resolution, closes #125. Merge when ready.

APPROVED. Clean lazy resolution, closes #125. Merge when ready.
fuzzy merged commit 2977520ceb into main 2026-07-06 08:20:04 +00:00
fuzzy deleted branch fix/125-git-import-side-effect 2026-07-06 08:20:04 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/hottea!161
No description provided.