1a4b390e8a
Addresses the review on PR #481. Self-contained wheel (review point 1): the gateway/infra/orchestrator images build from a context that must hold bot_bottle/, pyproject.toml, and the root-level Dockerfiles. Modules previously located these by walking __file__ to the repo root, so an installed wheel (package in site-packages, no repo root) passed `doctor` but failed `start`. - Add bot_bottle/resources.py: build_root() returns the repo root in a checkout (unchanged) or a staged copy from the wheel's bundled _resources/ otherwise; dockerfile()/nix_netpool_module()/ netpool_script() derive from it. - setup.py bundles the root Dockerfiles, nix module, netpool script, and pyproject.toml into bot_bottle/_resources/ at build; MANIFEST.in ships them in the sdist. - Route every _REPO_ROOT/_REPO_DIR call site (docker/macos launch, macos infra, firecracker infra_vm/infra_artifact/setup, orchestrator lifecycle/gateway) through resources. Checkout behavior is unchanged. install.sh prerequisites (review point 2): check for git when installing a git+ spec, and — before the pip fallback — that pip is usable and the interpreter isn't externally managed (PEP 668), pointing at pipx. Tests: test_resources covers checkout + staged-wheel layouts; test_wheel_install builds the wheel, installs it into an isolated venv, and asserts `doctor` runs and build_root() yields a valid context. Running `start` end-to-end still needs a Docker/KVM host (CI). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1.3 KiB
INI
29 lines
1.3 KiB
INI
[run]
|
|
branch = True
|
|
source = .
|
|
# Store paths relative to the project root so .coverage.* files produced on
|
|
# different runners (ubuntu-latest vs self-hosted KVM) can be combined by the
|
|
# coverage job without a [paths] remapping section.
|
|
relative_files = True
|
|
|
|
[report]
|
|
# Coverage policy: see docs/decisions/0004-coverage-policy.md.
|
|
#
|
|
# `omit` is reserved for genuinely interactive entry-point shells whose
|
|
# bodies are `read_tty_line()` / curses prompt loops — there is no
|
|
# behaviour to assert that a test wouldn't have to fake wholesale, so a
|
|
# test here would inflate the number without buying confidence. This is
|
|
# NOT a place to hide subprocess/backend orchestration: that code is
|
|
# security-relevant and is measured via the integration suite instead
|
|
# (run scripts/coverage.sh for the combined unit+integration number).
|
|
omit =
|
|
bot_bottle/cli/tui.py
|
|
bot_bottle/cli/init.py
|
|
tests/*
|
|
# Build-time only: setuptools invokes it out-of-process to build the
|
|
# wheel/sdist (it's never imported by the running app), so in-process
|
|
# coverage can't reach it. Its one job — bundling the root resources into
|
|
# bot_bottle/_resources/ — is exercised end-to-end by test_wheel_install,
|
|
# which builds and installs a real wheel and checks the result.
|
|
setup.py
|