ITADN

`coral validate` / `coral start` fail when CORAL is installed via `uv tool install` (the README path)

#114ClosedBobbyZhouZijian 创建于 2026-05-20
B
BobbyZhouZijiancommented
## Summary Following the canonical install in the README (`curl … install.sh | sh`, which runs `uv tool install`), `coral validate` and `coral start` fail while building the grader venv: ``` RuntimeError: Setup command failed (exit 2): uv pip install -q -e /Users/<me>/.local/share/uv/tools/coral/lib/python3.13/site-packages stderr: error: <path> does not appear to be a Python project, as neither `pyproject.toml` nor `setup.py` are present in the directory ``` ## Root cause In [`coral/workspace/grader_env.py`](https://github.com/Human-Agent-Society/CORAL/blob/main/coral/workspace/grader_env.py): ```python def _coral_source_root() -> Path: return Path(coral.__file__).resolve().parent.parent ``` This assumes CORAL is installed editable from a source checkout (so `parent.parent` contains `pyproject.toml`). With `uv tool install`, `coral.__file__` lives in a venv `site-packages/`, and `parent.parent` is that site-packages dir — not a Python project — so the subsequent `uv pip install -q -e <site-packages>` always fails. ## Reproduce ```bash curl -fsSL https://raw.githubusercontent.com/Human-Agent-Society/CORAL/main/install.sh | sh coral init demo && cd demo coral validate . ``` ## Environment - CORAL `0.5.2.dev17+gf2c9a9801` (installed via the README `install.sh`) - macOS 25.2.0, arm64 - Python 3.13.12, uv-managed - `uv` 0.5.x ## Why this matters Every user who follows the README install path hits this on first `coral validate` / `coral start`. It silently steers people toward git-clone-and-`pip install -e .`, which the docs don't describe. ## Suggested fixes (happy to PR) 1. **Detect non-editable installs and fall back to installing `coral` by name** — if `parent.parent` doesn't have a `pyproject.toml`, run `uv pip install coral` (or `git+https://github.com/Human-Agent-Society/CORAL.git@<pinned-sha>` while there's no PyPI release). 2. **Share the parent CORAL install with the grader venv** — `uv venv --system-site-packages`, or append the parent's site-packages to the grader venv's `sys.path`. 3. **Build a wheel from the installed package** and install that into the grader venv. Option 1 is the most explicit. Option 2 is the simplest. Let me know which direction you'd prefer and I'll send a PR. ## Workaround for users hitting this today ```bash git clone https://github.com/Human-Agent-Society/CORAL.git ~/src/coral uv tool install -e ~/src/coral --force ``` After this `_coral_source_root()` points at the cloned repo and `coral validate` succeeds.
关闭于 2026-05-21 0 条评论