Skip to content

Commit 6af7d56

Browse files
cdcore09Copilot
andauthored
chore: Update tests/test_installation.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 96acf27 commit 6af7d56

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/test_installation.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,21 @@ def test_required_dependencies_in_pyproject(self):
269269
"""Verify all required dependencies are in pyproject.toml."""
270270
import tomllib
271271
from pathlib import Path
272+
from packaging.requirements import Requirement
272273

273274
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
274275
with open(pyproject_path, "rb") as f:
275276
pyproject = tomllib.load(f)
276277

277278
dependencies = pyproject.get("project", {}).get("dependencies", [])
278-
dep_names = [dep.split("[")[0].split(">=")[0].split("<")[0].split("==")[0] for dep in dependencies]
279+
dep_names = []
280+
for dep in dependencies:
281+
try:
282+
req = Requirement(dep)
283+
dep_names.append(req.name)
284+
except Exception:
285+
# Fallback for unparseable dependencies
286+
dep_names.append(dep.split("[")[0].split(">=")[0].split("==")[0].strip())
279287

280288
required_deps = ["fastmcp", "panel", "chromadb", "pydantic", "sentence-transformers"]
281289

0 commit comments

Comments
 (0)