def _vv(): """Finds the nearest venv going upward in the directory hierarchy and activates it.""" d = Path.cwd() while True: if (d / "venv").exists(): vox activate @(str(d / "venv")) return True if d == d.parent or (d / ".git").exists(): print("Could not find venv.") return False d = d.parent aliases["vv"] = _vv