From d82dd4afa3df822d0ccaae9215d3ccfa59fcafb1 Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 03:55:38 +0100 Subject: [PATCH 1/3] Merge origin/main and retain hosted test imports Architecture-Review: unchanged; merge recovery keeps the reviewed head checks and the conflict resolution only changes a test reference. Co-Authored-By: Codex --- src/loopzero/cli.py | 2 +- src/loopzero/github.py | 18 ++++++++++++------ tests/test_cli.py | 26 ++++++++++++++++++++++---- tests/test_github.py | 14 ++++++++++---- 4 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/loopzero/cli.py b/src/loopzero/cli.py index 2077c223..f2b5f9d7 100644 --- a/src/loopzero/cli.py +++ b/src/loopzero/cli.py @@ -1411,7 +1411,7 @@ def _wait_for_merge(config: Config, pr: github.PR, timeout: float) -> str | None sha = _landed(config, pr, closed) if sha: return sha - if not github.merge_pending(config.repo, pr.number): + if not github.merge_pending(config.repo, pr.number, pr.head_sha): sha = _landed(config, pr, closed) if sha: return sha diff --git a/src/loopzero/github.py b/src/loopzero/github.py index c9a77a48..944c67ef 100644 --- a/src/loopzero/github.py +++ b/src/loopzero/github.py @@ -1322,7 +1322,7 @@ def mark_ready(repo: str, number: int) -> None: _QUEUE_QUERY = ( "query($owner:String!,$name:String!,$number:Int!){repository(owner:$owner,name:$name)" - "{pullRequest(number:$number){isInMergeQueue autoMergeRequest{enabledAt}}}}" + "{pullRequest(number:$number){headRefOid isInMergeQueue autoMergeRequest{enabledAt}}}}" ) @@ -1354,7 +1354,7 @@ def merged_sha( raise GhError(argv, "PR closed without a verified merge or invalid merge evidence") -def merge_pending(repo: str, number: int) -> bool: +def merge_pending(repo: str, number: int, head_sha: str) -> bool: """True when GitHub holds the PR for merging: queued, or accepted as an auto-merge request that it moves into the queue shortly after (observed ~1 minute, #180).""" owner, name = repo.split("/", 1) @@ -1373,6 +1373,8 @@ def merge_pending(repo: str, number: int) -> bool: raise MergeFailed(("gh", "api", "graphql"), f"GitHub queue lookup for PR #{number}: queue status could not be verified. " f"Check the PR's queue or merge state before retrying.\n{str(exc)[-300:]}") from exc + if pr.get("headRefOid") != head_sha: + raise MergeFailed(("gh", *argv), "PR head changed or unavailable during queue verification") return queued or bool(auto) @@ -1389,16 +1391,19 @@ def merge(repo: str, number: int, strategy: str, head_sha: str) -> str | None: argv = ( "pr", "merge", str(number), "--repo", repo, *method, "--match-head-commit", head_sha, ) + if strategy == "queue" and merge_pending(repo, number, head_sha): + return None + write_error = None try: _gh(*argv, timeout=300) - except GhError as exc: - raise MergeFailed(exc.command, exc.tail) from exc + except (GhError, ProcTimeout, OSError) as exc: + write_error = exc sha = merged_sha(repo, number, expected_head=head_sha) if sha: return sha queue_error = None try: - if merge_pending(repo, number): + if merge_pending(repo, number, head_sha): return None except MergeFailed as exc: queue_error = exc @@ -1408,7 +1413,8 @@ def merge(repo: str, number: int, strategy: str, head_sha: str) -> str | None: return sha if queue_error: raise queue_error - raise MergeFailed(("gh", *argv), f"PR #{number} neither merged nor queued") + detail = f": {write_error}" if write_error else "" + raise MergeFailed(("gh", *argv), f"PR #{number} neither merged nor queued{detail}") def _remote_branch_head(endpoint: str) -> str | None: diff --git a/tests/test_cli.py b/tests/test_cli.py index 6933ecd3..5a23ba1f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3223,6 +3223,19 @@ def test_merge_refuses_when_not_ready(wt: Path, gh: FakeGh, capsys, head) -> Non assert wt.exists() +def lose_native_merge_reply(monkeypatch): + original = github._gh + + def transport(*args, **kwargs): + result = original(*args, **kwargs) + if args[:2] == ("pr", "merge"): + raise github.ProcTimeout("lost native merge reply", "") + return result + + monkeypatch.setattr(github, "_gh", transport) + + +@pytest.mark.parametrize("lost_reply", [False, True]) @pytest.mark.parametrize("branch,changed", [ ("lz/t1", False), ("t3/archive-review-receipts", False), @@ -3231,13 +3244,15 @@ def test_merge_refuses_when_not_ready(wt: Path, gh: FakeGh, capsys, head) -> Non ("lz/t1", True), ]) def test_merge_prints_sha_and_cleans_up( - wt: Path, repo: Path, gh: FakeGh, capsys, changed, head, branch + wt: Path, repo: Path, gh: FakeGh, capsys, changed, head, branch, monkeypatch, lost_reply ) -> None: git(wt, "branch", "-m", branch) arm_approved_ready_pr(gh, head, wt, isDraft=False, branch=branch) gh.respond("pr merge", "") gh.append(f"api repos/{REPO}/pulls/7", merge_json(state='MERGED', head='f' * 40 if changed else head_of(wt), sha='c' * 40)) gh.respond("api -X", "") + if lost_reply: + lose_native_merge_reply(monkeypatch) code, out, err = run(capsys, "merge") out = without_accepted_receipt(out) if changed: @@ -3914,12 +3929,15 @@ def test_merge_of_externally_merged_pr_verifies_sha_and_cleans_up( assert all(c["argv"][:2] != ["pr", "merge"] for c in gh.calls) -def test_merge_queued_prints_and_keeps_worktree(wt: Path, gh: FakeGh, capsys, head) -> None: +@pytest.mark.parametrize("lost_reply", [False, True]) +def test_merge_queued_prints_and_keeps_worktree(wt, gh, capsys, head, monkeypatch, lost_reply): arm_approved_ready_pr(gh, head, wt, isDraft=False) gh.respond("pr merge", "") gh.append(f"api repos/{REPO}/pulls/7", merge_json(state='OPEN', head=head_of(wt), sha=None)) gh.respond("api graphql", threads_json(), - {"data": {"repository": {"pullRequest": {"isInMergeQueue": True}}}}) + {"data": {"repository": {"pullRequest": {"isInMergeQueue": True, "headRefOid": head}}}}) + if lost_reply: + lose_native_merge_reply(monkeypatch) code, out, err = run(capsys, "merge") assert (code, err) == (0, "") assert "queued for merge into main" in out and out.endswith( @@ -4045,7 +4063,7 @@ def test_merge_wait_preserves_reviewed_head_and_cleans_only_landed_work( merge_json(state="MERGED", head=head, sha="e" * 40) if landed else open_pr] gh.append(f"api repos/{REPO}/pulls/7", *snapshots) def queue(value: bool) -> dict: - return {"data": {"repository": {"pullRequest": {"isInMergeQueue": value}}}} + return {"data": {"repository": {"pullRequest": {"isInMergeQueue": value, "headRefOid": head}}}} ejected = outcome in {"ejected", "landed-on-ejection"} gh.respond("api graphql", threads_json(), queue(True), queue(not ejected)) gh.respond("api -X", "") diff --git a/tests/test_github.py b/tests/test_github.py index cbdc0588..2a8d08dd 100644 --- a/tests/test_github.py +++ b/tests/test_github.py @@ -1221,6 +1221,8 @@ def test_merge_success_verifies_rest_landing( def test_merge_command_failure(gh: FakeGh) -> None: gh.fail("pr merge", "head commit mismatch") + gh.respond(f"api repos/{REPO}/pulls/7", merge_json()) + gh.respond("api graphql", _queue_json(False)) with pytest.raises(github.MergeFailed) as info: github.merge(REPO, 7, "rebase", HEAD) assert "--rebase" in info.value.command and "mismatch" in info.value.tail @@ -1239,7 +1241,7 @@ def test_delete_remote_branch_checks_encoded_ref(gh: FakeGh, remote_head: str | def _queue_json(queued: bool) -> dict: - return {"data": {"repository": {"pullRequest": {"isInMergeQueue": queued}}}} + return {"data": {"repository": {"pullRequest": {"isInMergeQueue": queued, "headRefOid": HEAD}}}} @pytest.mark.parametrize("missing", [False, True]) @@ -1262,10 +1264,14 @@ def test_merge_queued_returns_none(gh: FakeGh, strategy, auto) -> None: accepted = _queue_json(not auto) if auto: accepted["data"]["repository"]["pullRequest"]["autoMergeRequest"] = {"enabledAt": "t"} - gh.respond("api graphql", accepted) + gh.respond("api graphql", *([_queue_json(False)] if strategy == "queue" else []), accepted) assert github.merge(REPO, 7, strategy, HEAD) is None - assert ("--squash" in gh.argv(0)) == (strategy == "squash") - assert "--queue" not in gh.argv(0) + if strategy == "queue": + assert github.merge(REPO, 7, strategy, HEAD) is None + writes = [c["argv"] for c in gh.calls if c["argv"][:2] == ["pr", "merge"]] + assert len(writes) == 1 + assert ("--squash" in writes[0]) == (strategy == "squash") + assert "--queue" not in writes[0] def test_merge_landed_between_reads_is_reported_merged(gh: FakeGh) -> None: From 0b6b62cf1b9247b11ccbd9d25f666255963a047b Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 15:04:35 +0100 Subject: [PATCH 2/3] Deduplicate CLI readiness and command plumbing Architecture-Review: unchanged; command entry points, trusted configuration, review locking, and readiness policy retain their existing boundaries. Co-Authored-By: Codex --- src/loopzero/cli.py | 136 +++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 78 deletions(-) diff --git a/src/loopzero/cli.py b/src/loopzero/cli.py index cb219532..8b4c87bc 100644 --- a/src/loopzero/cli.py +++ b/src/loopzero/cli.py @@ -21,7 +21,7 @@ import tempfile import time from collections.abc import Callable, Iterator -from contextlib import suppress +from contextlib import ExitStack, suppress from functools import partial, wraps from pathlib import Path @@ -137,11 +137,9 @@ def _load_config( return config -def _context(args: argparse.Namespace, *, pin_checks: bool = False) -> tuple[Path, Config]: +def _context(args: argparse.Namespace, *, pin_checks: bool = True) -> tuple[Path, Config]: wt = _toplevel() - return wt, _load_config( - args, wt, pin_checks=pin_checks, refresh=args.command in {"ready", "merge"}, - ) + return wt, _load_config(args, wt, pin_checks=pin_checks, refresh=args.command in {"ready", "merge"}) def _is_ancestor(wt: Path, sha: str, head: str) -> bool: @@ -269,13 +267,10 @@ def _conflict_delta_base(config: Config, pr: github.PR, head: str, reviews: list if len({primary, reviewed, head}) != 3: return None publishers = publishers or (github.login(),) - if not eligibility.approved_delta(reviews, reviewed, publishers, repo=config.repo, number=pr.number): - return None - if eligibility.base_merge_material( - config.repo, pr.number, reviewed, head, config.base_branch, clean=False, conflict_only=True, - ) is None: - return None - if github.open_blocking_findings(config.repo, pr.number, None, publishers): + if (not eligibility.approved_delta(reviews, reviewed, publishers, repo=config.repo, number=pr.number) + or eligibility.base_merge_material( + config.repo, pr.number, reviewed, head, config.base_branch, clean=False, conflict_only=True, + ) is None or github.open_blocking_findings(config.repo, pr.number, None, publishers)): return None return reviewed @@ -288,31 +283,17 @@ def _select_review_round(config: Config, pr: github.PR, head: str, reviews: list return _decide_kind(markers, head) -def _review_cap_reason(config: Config, pr: github.PR, head: str, reviews: list[dict], - markers: list[Marker], publishers: tuple[str, ...]) -> str: - if _conflict_delta_base(config, pr, head, reviews, markers, publishers): - return f"Run `loopzero review` for the available conflict-resolution delta on {head[:12]}." - return ( - f"The review budget is exhausted and {head[:12]} has no eligible review. " - "Open a replacement PR for changes that need review. Another `loopzero review` on this PR will be refused." - ) - - MERGEABILITY_PENDING = github.MERGEABILITY_PENDING -def _readiness_precheck(wt: Path, config: Config, pr: github.PR, head: str, diagnostics: bool) -> str | None: - return github.merge_hold(pr.number, pr.labels) or ( - None if diagnostics else _check_report_problem(_load_report(wt), config, head) - ) - - def _readiness( wt: Path, config: Config, pr: github.PR, head: str, reviews: list[dict] | None = None, *, workflow_wait: bool = False, announce_receipt: bool = False, diagnostics: bool = False, mergify_deadline: float | None = None, ) -> github.Readiness: - if problem := _readiness_precheck(wt, config, pr, head, diagnostics): + if problem := github.merge_hold(pr.number, pr.labels) or ( + None if diagnostics else _check_report_problem(_load_report(wt), config, head) + ): return github.Readiness(False, (problem,)) dates: list[str] = [] reviews = (_pr_reviews(config.repo, pr.number, **({"dates": dates} if workflow_wait else {})) @@ -351,15 +332,21 @@ def _readiness( if github.MISSING_REVIEW_REASON in result.reasons: markers = _pr_markers(reviews, head, publishers, repo=config.repo, number=pr.number) if _review_cap_spent(markers) and all(marker.head != head for marker in markers): - exhausted = _review_cap_reason(config, pr, head, reviews, markers, publishers) + if _conflict_delta_base(config, pr, head, reviews, markers, publishers): + exhausted = f"Run `loopzero review` for the available conflict-resolution delta on {head[:12]}." + else: + exhausted = ( + f"The review budget is exhausted and {head[:12]} has no eligible review. " + "Open a replacement PR for changes that need review. Another `loopzero review` on this PR will be refused." + ) result = dataclasses.replace(result, reasons=tuple( exhausted if reason == github.MISSING_REVIEW_REASON else reason for reason in result.reasons )) report = _load_report(wt) receipt_problem = _check_report_problem(report, config, head) if receipt_problem: - result = github.Readiness(False, (*result.reasons, receipt_problem)) - elif announce_receipt: + return github.Readiness(False, (*result.reasons, receipt_problem)) + if announce_receipt: _print_receipt(wt, report, "accepted") return result @@ -462,13 +449,11 @@ def _validation_section(wt: Path, head: str, config: Config) -> str: loaded = _load_report(wt) if loaded is None: return "(no `loopzero check` run recorded)" - recorded, results = loaded.head, loaded.results - lines = [f"Recorded for `{recorded[:12]}`" + ("" if recorded == head else " (not current head)")] + heading = f"Recorded for `{loaded.head[:12]}`" + ("" if loaded.head == head else " (not current head)") if _check_report_problem(loaded, config, head, require_pass=False): - lines[0] += " (unverified, run `loopzero check`)" - lines += [f"- `{github.redact_credentials(r.command)}`: exit {r.exit_code}" - for r in results] or ["- (no check commands configured)"] - return "\n".join(lines) + heading += " (unverified, run `loopzero check`)" + results = [f"- `{github.redact_credentials(r.command)}`: exit {r.exit_code}" for r in loaded.results] + return "\n".join([heading, *(results or ["- (no check commands configured)"])]) _CHECKS_START = "" @@ -624,7 +609,7 @@ def _check_failure_preview(tail: str, limit: int = 1536) -> str: def cmd_check(args: argparse.Namespace) -> int: - wt, config = _context(args, pin_checks=True) + wt, config = _context(args) worktree.local_state_files(wt, CHECKS_FILE.name) if not config.checks: raise config_mod.ConfigError("checks.commands must list at least one command to run checks") @@ -692,7 +677,7 @@ def _finish_check(wt: Path, config: Config, report: CheckReport, locked_fd: int) def cmd_pr(args: argparse.Namespace) -> int: - wt, config = _context(args, pin_checks=True) + wt, config = _context(args) branch, head = worktree.branch(wt), worktree.head(wt) _require_task_branch(config, branch) _require_clean(wt) @@ -779,18 +764,16 @@ def _require_review_pr(config: Config, branch: str, *, repost: bool) -> github.P def _lock_review(run_review: Callable[[argparse.Namespace, Path, Config], int]): @wraps(run_review) def locked(args: argparse.Namespace) -> int: - wt, config = _context(args, pin_checks=True) + wt, config = _context(args) git_dir = _git(wt, "rev-parse", "--absolute-git-dir", paths=True) - fd = os.open(git_dir, os.O_RDONLY | os.O_DIRECTORY) - try: + with ExitStack() as cleanup: + fd = os.open(git_dir, os.O_RDONLY | os.O_DIRECTORY) + cleanup.callback(os.close, fd) try: fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) except BlockingIOError as exc: raise CliError("review already running in this worktree") from exc return run_review(args, wt, config) - finally: - os.close(fd) - return locked @@ -1321,8 +1304,13 @@ def _warn_queue_size( print(f"warning: projected size budget after {predecessors}:\n{result.stdout.rstrip()}") +def _mark_ready(wt: Path, config: Config, number: int, head: str) -> None: + _require_receipt(wt, config, head) + github.mark_ready(config.repo, number) + + def cmd_ready(args: argparse.Namespace) -> int: - wt, config = _context(args, pin_checks=True) + wt, config = _context(args) read_started = time.monotonic() pr, readiness = _pr_readiness(wt, config, worktree.branch(wt), workflow_wait=args.wait is not None) assert readiness is not None @@ -1332,8 +1320,7 @@ def cmd_ready(args: argparse.Namespace) -> int: wait = partial(_wait_with_deadline, wt, config, timeout=args.wait, started=started, args=args, allow_skipped=True, initial_read_time=started - read_started) if waiting: - _require_receipt(wt, config, pr.head_sha) - github.mark_ready(config.repo, pr.number) + _mark_ready(wt, config, pr.number, pr.head_sha) if args.wait is None: pending = f"; {MERGEABILITY_PENDING}" if pr.mergeable == "UNKNOWN" else "" print(f"marked ready; waiting for required checks: {', '.join(waiting)}{pending}; {NEXT_WAIT}") @@ -1342,20 +1329,17 @@ def cmd_ready(args: argparse.Namespace) -> int: if args.wait is not None and ( waiting or _pending_checks(config, pr, readiness, allow_skipped=not pr.is_draft) ): - waited = wait(pr, kicked=kicked, shown=readiness.reasons if kicked else (), - initial=None if kicked else readiness) - if waited is None: + if (waited := wait(pr, kicked=kicked, shown=readiness.reasons if kicked else (), + initial=None if kicked else readiness)) is None: return 3 pr, readiness, kicked = waited _prequeue_size_budget(wt, config, pr, readiness) if readiness.ready and pr.is_draft and not kicked: - _require_receipt(wt, config, pr.head_sha) - github.mark_ready(config.repo, pr.number) + _mark_ready(wt, config, pr.number, pr.head_sha) if args.wait is not None: - waited = wait(pr, kicked=True) - if waited is None: + if (waited := wait(pr, kicked=True)) is None: return 3 - pr, readiness, kicked = waited + pr, readiness, _ = waited for reason in _readiness_messages(pr, readiness): print(f"not ready: {reason}") if not readiness.ready: @@ -1460,27 +1444,25 @@ def _wait_with_deadline( if timeout == 0: return wait() deadline = started + timeout - if time.monotonic() >= deadline: - _print_check_wait_timeout(pr, args) - return None reported_timeout = False try: - with github.bounded_reads(deadline, token=None, retry=True): - waited = wait(bounded=True, initial_read_time=initial_read_time) - reported_timeout = waited is None + if time.monotonic() < deadline: + with github.bounded_reads(deadline, token=None, retry=True): + waited = wait(bounded=True, initial_read_time=initial_read_time) + reported_timeout = waited is None + return waited except (github.ReadDeadline, _proc.ProcTimeout) as exc: if isinstance(exc, _proc.ProcTimeout) and time.monotonic() < deadline: raise - if not reported_timeout: - _print_check_wait_timeout(pr, args) - return None - return waited + if not reported_timeout: + _print_check_wait_timeout(pr, args) + return None -def _print_check_wait_timeout(pr: github.PR, args: argparse.Namespace | None) -> None: +def _print_check_wait_timeout(pr: github.PR, args: argparse.Namespace) -> None: waiting_for = "GitHub to compute mergeability" if pr.mergeable == "UNKNOWN" else "required checks" - command = ["loopzero", args.command if args else "ready", "--wait"] - if args and args.config: + command = ["loopzero", args.command, "--wait"] + if args.config: command.insert(1, f"--config={args.config}") print( f"timed out waiting for {waiting_for} on {pr.head_sha[:12]}. " @@ -1488,12 +1470,12 @@ def _print_check_wait_timeout(pr: github.PR, args: argparse.Namespace | None) -> ) def _verify_wait_snapshot( - args: argparse.Namespace | None, wt: Path, config: Config, head: str, current_head: str, + args: argparse.Namespace, wt: Path, config: Config, head: str, current_head: str, previous: Config, ) -> Config: if current_head != head: raise CliError(f"PR head changed while waiting: {head[:12]} to {current_head[:12]}") - latest = config if args is None else _load_config(args, wt, pin_checks=True, previous=previous, refresh=True) + latest = _load_config(args, wt, pin_checks=True, previous=previous, refresh=True) if latest == config: return latest retry = "retry with the current settings" if _current_check_report(wt, latest, head) else "run loopzero check and retry" @@ -1512,14 +1494,13 @@ def by_check(reasons: tuple[str, ...]) -> dict[str, str]: def _wait_for_checks( wt: Path, config: Config, pr: github.PR, timeout: float, *, kicked: bool, - started: float | None = None, shown: tuple[str, ...] = (), - args: argparse.Namespace | None = None, bounded: bool = False, allow_merged: bool = False, + started: float, args: argparse.Namespace, shown: tuple[str, ...] = (), + bounded: bool = False, allow_merged: bool = False, allow_skipped: bool = False, initial: github.Readiness | None = None, initial_read_time: float = 0.0, ) -> tuple[github.PR, github.Readiness | None, bool] | None: """Poll the same head until it settles, omitting readiness for an allowed merge.""" grace_started = time.monotonic() - started = grace_started if started is None else started current = pr stale_notice = False previous = config @@ -1535,8 +1516,7 @@ def _wait_for_checks( readiness = _readiness(wt, config, current, pr.head_sha, workflow_wait=True, mergify_deadline=started + timeout) if not kicked and _draft_checks_waiting(config, current, readiness): - _require_receipt(wt, config, current.head_sha) - github.mark_ready(config.repo, pr.number) + _mark_ready(wt, config, pr.number, current.head_sha) print("marked ready; " + "; ".join(readiness.reasons)) return _wait_for_checks(wt, config, pr, timeout, kicked=True, started=started, shown=readiness.reasons, args=args, bounded=bounded, @@ -1771,7 +1751,7 @@ def _merge_with_mergify( def cmd_merge(args: argparse.Namespace) -> int: if args.cancel and args.wait is not None: raise CliError("merge --cancel cannot be combined with --wait") - wt, config = _context(args, pin_checks=True) + wt, config = _context(args) branch = worktree.branch(wt) if args.cancel: if config.merge_strategy != "mergify": From 534fa2f0895e250e3c07fcf20f4426e7e3977350 Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 15:12:15 +0100 Subject: [PATCH 3/3] Document standalone scratch clones for slotted checks Architecture-Review: unchanged; documents the established sandbox visibility check and leaves admission and mounts unchanged. Co-Authored-By: Codex --- SETUP.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SETUP.md b/SETUP.md index 4747e04d..0484df66 100644 --- a/SETUP.md +++ b/SETUP.md @@ -365,6 +365,9 @@ writes the receipt. For remote stages, configure an operator-trusted Without a stage adapter, run the whole check locally. Use a local slot if the host requires one. On miki, if you used the isolated install, run these from the task worktree with the `install_dir` from that recipe. +Make a scratch clone standalone before queueing, for example with +`git clone --no-local`. If a Git object alternate is outside the check sandbox, +`loopzero check` refuses it after the slot wait and before any stage runs. ```sh export PATH="$install_dir/venv/bin:$PATH"