Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ jobs:
working-directory: python
run: |
source .venv/bin/activate
uv pip install dist/*.whl
WHEEL=$(ls dist/*.whl)
uv pip install "${WHEEL}[lance-python]"

- name: Run tests
working-directory: python
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ integrations can opt in explicitly:
pip install "lance-context[graph]"
```

If you need direct Python-side Lance/LanceDB inspection of the datasets written
by `lance-context`, install the Lance Python packages extra:

```bash
pip install "lance-context[lance-python]"
```

Then follow the usage examples below to create a `Context`, append entries, and time-travel through versions.

### Python wheels
Expand Down
21 changes: 17 additions & 4 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
name = "lance-context"
version = "0.3.2"
dependencies = [
"pylance==7.0.0",
"lancedb==0.27.1",
"lance-namespace==0.7.7",
"pyarrow>=14",
]
description = "Multimodal, versioned context storage for agentic workflows"
authors = [{ name = "Lance Devs", email = "dev@lancedb.com" }]
Expand Down Expand Up @@ -41,9 +39,24 @@ build-backend = "maturin"

[project.optional-dependencies]
graph = ["lance-graph==0.5.4"]
lance-python = [
"pylance>=7.0.0,<8",
"lance-namespace>=0.7.7,<0.8",
"lancedb==0.27.1",
]
# `moto[server]` pulls in flask + flask-cors so moto.server can be launched
# as a subprocess for the S3 integration tests.
tests = ["pytest", "pytest-asyncio", "ruff", "moto[s3,server]", "boto3", "botocore"]
tests = [
"pytest",
"pytest-asyncio",
"ruff",
"moto[s3,server]",
"boto3",
"botocore",
"pylance>=7.0.0,<8",
"lance-namespace>=0.7.7,<0.8",
"lancedb==0.27.1",
]
dev = ["ruff", "pyright"]

[tool.ruff]
Expand Down
31 changes: 31 additions & 0 deletions python/tests/test_packaging_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from __future__ import annotations

import tomllib
from pathlib import Path

PYTHON_ROOT = Path(__file__).resolve().parents[1]
LANCE_PYTHON_DEPS = {"pylance", "lancedb", "lance-namespace"}


def _dependency_names(dependencies: list[str]) -> set[str]:
return {
dependency.split(";", 1)[0]
.split("[", 1)[0]
.split("=", 1)[0]
.split("<", 1)[0]
.split(">", 1)[0]
.strip()
.lower()
for dependency in dependencies
}


def test_lance_python_packages_are_optional_runtime_dependencies() -> None:
pyproject = tomllib.loads((PYTHON_ROOT / "pyproject.toml").read_text())
project = pyproject["project"]
runtime_deps = _dependency_names(project["dependencies"])
optional_deps = project["optional-dependencies"]

assert LANCE_PYTHON_DEPS.isdisjoint(runtime_deps)
assert LANCE_PYTHON_DEPS <= _dependency_names(optional_deps["lance-python"])
assert LANCE_PYTHON_DEPS <= _dependency_names(optional_deps["tests"])
26 changes: 18 additions & 8 deletions python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading