e1940769de
* feat: add bedrock + vertex optional extras with install docs and import hints (#574) Declare [project.optional-dependencies] with vertex (google-auth) and bedrock (boto3) extras so "strix-agent[vertex]" / "strix-agent[bedrock]" install the provider SDKs. Add an Installation section to the Bedrock docs mirroring Vertex, and a _provider_import_hint helper in warm_up_llm that surfaces a pip-install hint when a provider dependency is missing. Fixes #574, #573 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(providers): use pipx in install hint to match docs A pipx-installed strix can't add an extra with 'pip install' (wrong env); mirror the documented 'pipx install "strix-agent[...]"' command. Addresses Greptile review.
27 lines
775 B
Python
27 lines
775 B
Python
"""Tests for the optional-dependency extras declared in pyproject.toml."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import tomllib
|
|
from pathlib import Path
|
|
|
|
|
|
PYPROJECT = Path(__file__).resolve().parent.parent / "pyproject.toml"
|
|
|
|
|
|
def _optional_dependencies() -> dict[str, list[str]]:
|
|
data = tomllib.loads(PYPROJECT.read_text(encoding="utf-8"))
|
|
return data["project"]["optional-dependencies"]
|
|
|
|
|
|
def test_vertex_extra_pins_google_auth() -> None:
|
|
extras = _optional_dependencies()
|
|
assert "vertex" in extras
|
|
assert any(req.startswith("google-auth") for req in extras["vertex"])
|
|
|
|
|
|
def test_bedrock_extra_pins_boto3() -> None:
|
|
extras = _optional_dependencies()
|
|
assert "bedrock" in extras
|
|
assert any(req.startswith("boto3") for req in extras["bedrock"])
|