conduct-cli 0.4.19__tar.gz → 0.4.20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.19
3
+ Version: 0.4.20
4
4
  Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
5
  Author-email: Conduct AI <hello@conductai.ai>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "conduct-cli"
7
- version = "0.4.19"
7
+ version = "0.4.20"
8
8
  description = "CLI for Conduct AI — install agents, manage projects, run tests"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -402,6 +402,20 @@ if __name__ == "__main__":
402
402
  main()
403
403
  '''
404
404
 
405
+ # ── Python interpreter selection ─────────────────────────────────────────────
406
+
407
+ def _best_python() -> str:
408
+ """Return the best available Python 3 interpreter path.
409
+ Prefers 3.11+ (Homebrew) over Apple's system Python 3.9 which has
410
+ restrictions that cause the hook to fail silently."""
411
+ import shutil
412
+ for candidate in ("python3.13", "python3.12", "python3.11", "python3.10"):
413
+ found = shutil.which(candidate)
414
+ if found:
415
+ return found
416
+ return sys.executable
417
+
418
+
405
419
  # ── Hook write helper ─────────────────────────────────────────────────────────
406
420
 
407
421
  def _write_hook(path: Path) -> None:
@@ -502,7 +516,7 @@ def _install_codex_hook(hook_path: Path) -> None:
502
516
  hook_section = hooks.setdefault("hooks", {})
503
517
 
504
518
  # PreToolUse
505
- pre_cmd = f"{sys.executable} {hook_path}"
519
+ pre_cmd = f"{_best_python()} {hook_path}"
506
520
  hook_path_str = str(hook_path)
507
521
  pre = hook_section.setdefault("PreToolUse", [])
508
522
  # Match by hook path so old python3/python3.11 entries are treated as already registered
@@ -524,7 +538,7 @@ def _install_codex_hook(hook_path: Path) -> None:
524
538
  changed = True
525
539
 
526
540
  # PostToolUse
527
- post_cmd = f"{sys.executable} {hook_path} post"
541
+ post_cmd = f"{_best_python()} {hook_path} post"
528
542
  post = hook_section.setdefault("PostToolUse", [])
529
543
  # Remove stale conductguard-post entries registered by older CLI versions
530
544
  stale = "conductguard-post"
@@ -619,7 +633,7 @@ def _install_claude_hook(hook_path: Path) -> None:
619
633
 
620
634
  # PreToolUse — existing hook script
621
635
  pre = hooks.setdefault("PreToolUse", [])
622
- pre_cmd = f"{sys.executable} {hook_path}"
636
+ pre_cmd = f"{_best_python()} {hook_path}"
623
637
  hook_path_str = str(hook_path)
624
638
  pre_already = any(
625
639
  hook_path_str in e.get("command", "")
@@ -640,7 +654,7 @@ def _install_claude_hook(hook_path: Path) -> None:
640
654
 
641
655
  # PostToolUse
642
656
  post = hooks.setdefault("PostToolUse", [])
643
- post_cmd = f"{sys.executable} {hook_path} post"
657
+ post_cmd = f"{_best_python()} {hook_path} post"
644
658
  # Remove stale conductguard-post entries registered by older CLI versions
645
659
  stale = "conductguard-post"
646
660
  cleaned = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.19
3
+ Version: 0.4.20
4
4
  Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
5
  Author-email: Conduct AI <hello@conductai.ai>
6
6
  License: MIT
File without changes
File without changes
File without changes