Skip to content

Commit 5e29400

Browse files
authored
fix(installer): include click runtime dependency (#1299)
1 parent da3086c commit 5e29400

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ requires-python = ">=3.12"
1010
dependencies = [
1111
"aiosqlite>=0.20.0,<1.0.0",
1212
"anyio>=4.0.0,<5.0.0",
13+
"click>=8.1.0,<9.0.0",
1314
"jsonschema>=4.21.0,<5.0.0",
1415
"pydantic>=2.0.0,<3.0.0",
1516
"prompt-toolkit>=3.0.0,<4.0.0",

scripts/install.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
set -euo pipefail
1313

1414
PACKAGE_NAME="ouroboros-ai"
15+
CLICK_SPEC="click>=8.1.0,<9.0.0"
1516
MIN_PYTHON="3.12"
1617
IS_LOCAL=false
1718
RECONFIGURE="${OUROBOROS_INSTALL_RECONFIGURE:-}"
@@ -333,7 +334,9 @@ echo "Installing ${INSTALL_SPEC} ..."
333334
INSTALL_METHOD=""
334335
if [ "$HAS_UV" = true ]; then
335336
INSTALL_METHOD="uv"
336-
UV_ARGS=(tool install --upgrade --python ">=3.12" "$PACKAGE_NAME")
337+
# `click` is also declared in pyproject, but keep this explicit so the
338+
# installer can repair already-published wheels whose metadata missed it.
339+
UV_ARGS=(tool install --upgrade --python ">=3.12" "$PACKAGE_NAME" --with "$CLICK_SPEC")
337340
if [ -n "$PRE_FLAG" ]; then
338341
UV_ARGS+=(--prerelease=allow)
339342
fi
@@ -375,12 +378,14 @@ elif [ "$HAS_PIPX" = true ]; then
375378
else
376379
pipx install --force --python "$PYTHON" "$INSTALL_SPEC"
377380
fi
381+
# The venv name is the distribution name even when installing from a local path.
382+
pipx inject "ouroboros-ai" "$CLICK_SPEC"
378383
else
379384
INSTALL_METHOD="pip"
380385
if [ -n "$PRE_FLAG" ]; then
381-
$PYTHON -m pip install --user --upgrade --pre "$INSTALL_SPEC"
386+
$PYTHON -m pip install --user --upgrade --pre "$INSTALL_SPEC" "$CLICK_SPEC"
382387
else
383-
$PYTHON -m pip install --user --upgrade "$INSTALL_SPEC"
388+
$PYTHON -m pip install --user --upgrade "$INSTALL_SPEC" "$CLICK_SPEC"
384389
fi
385390
fi
386391

tests/unit/scripts/test_install_runtime_selection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_preserves_opencode_backend_from_existing_config(tmp_path: Path) -> None
9898
assert "Runtime: opencode (preserved from" in result.stdout
9999
assert "Installing . ..." in result.stdout
100100
assert (tmp_path / "calls.log").read_text(encoding="utf-8").splitlines() == [
101-
"uv tool install --upgrade --python >=3.12 .",
101+
"uv tool install --upgrade --python >=3.12 . --with click>=8.1.0,<9.0.0",
102102
"ouroboros setup --runtime opencode --non-interactive",
103103
]
104104

@@ -114,7 +114,7 @@ def test_explicit_claude_installs_mcp_and_claude_extras(tmp_path: Path) -> None:
114114
calls = (tmp_path / "calls.log").read_text(encoding="utf-8")
115115
assert "Runtime: claude (from --runtime / OUROBOROS_INSTALL_RUNTIME)" in result.stdout
116116
assert (
117-
"uv tool install --upgrade --python >=3.12 . --with mcp>=1.26.0,<2.0.0 --with claude-agent-sdk>=0.1.0,<1.0.0 --with anthropic>=0.52.0,<1.0.0"
117+
"uv tool install --upgrade --python >=3.12 . --with click>=8.1.0,<9.0.0 --with mcp>=1.26.0,<2.0.0 --with claude-agent-sdk>=0.1.0,<1.0.0 --with anthropic>=0.52.0,<1.0.0"
118118
in calls
119119
)
120120
assert "ouroboros setup --runtime claude --non-interactive" in calls
@@ -130,7 +130,9 @@ def test_pypi_lookup_failure_stays_stable_only_for_remote_install(tmp_path: Path
130130

131131
assert result.returncode == 0, result.stderr
132132
calls = (tmp_path / "calls.log").read_text(encoding="utf-8")
133-
assert "uv tool install --upgrade --python >=3.12 ouroboros-ai" in calls
133+
assert (
134+
"uv tool install --upgrade --python >=3.12 ouroboros-ai --with click>=8.1.0,<9.0.0" in calls
135+
)
134136
assert "--prerelease=allow" not in calls
135137

136138

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)